From 66149728496efc4eea8f2dd0d8900e596990e810 Mon Sep 17 00:00:00 2001 From: Ravi Maheshwari Date: Tue, 18 Mar 2025 18:57:08 +0530 Subject: [PATCH] Raw Code added to identify benchmark names --- utils/benchmark_names.py | 170 +++++++++++++++++++++++++++++++++++++++ utils/biz_utils.py | 17 +++- 2 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 utils/benchmark_names.py diff --git a/utils/benchmark_names.py b/utils/benchmark_names.py new file mode 100644 index 0000000..b76b411 --- /dev/null +++ b/utils/benchmark_names.py @@ -0,0 +1,170 @@ +benchmark_keywords =[ + "OECD G20 Inflation Index", + "OECD G7 inflation index", + "Absolute return (only applicable as an indirect performance fee on underlying investments in the AAM Managed Funds, being applied as 20% of the amount by which the increase in the Fund’s NAV for a financial year exceeds a return of 8% p.a)", + "MSCI all countries world accumulation Index Unhedged", + "MSCI World ex Australia Index", + "S&P / ASX 300 Accumulation Index", + "RBA Cash Rate", + "MSCI World Net Index", + "MSCI All Country World Net Index", + "CSI300 index", + "S&P/ASX Small Resources Accumulation Index", + "Bloomberg AusBond Composite 0+ Yr Index", + "Composite Benchmark", + "Bloomberg AusBond Bank Bill Index", + "Bloomberg Barclays Global Aggregate Bond Index (fully hedged) in Australian dollars", + "MSCI World ex Australia (Standard) Index (Net Dividends) in Australian dollars", + "S&P/ASX 300 A-REIT Accumulation Index", + "FTSE EPRA/NAREIT Developed hedged (AUD) Net TRI", + "Bloomberg Global Aggregate Index hedged to Australian dollars", + "MSCI Emerging Markets Net Index in AUD", + "MSCI World Net Total Return (AUD)", + "S&P/ASX Small Ordinaries Accumulation Index", + "MSCI All CountryWorld Index (Net in AUD)", + "MSCI World Index (Net AUD)", + "RBA Cash Rate plus 2.5% per annum", + "Australian Listed Real Assets Index", + "The Ausbond Bank Bill Index plus 1 %", + "S&P/ASX Australian Government Bond Index", + "MSCI World Index (net dividends reinvested) expressed in AUD", + "JP Morgan Global Government Bond Index expressed in AUD", + "Reserve Bank of Australia cash rate", + "S&P/ASX 200 Accumulation Index", + "MSCI World ex Australia (Standard) Index (Net Dividends)", + "MSCI AWCI Small Cap Net (AUD) Index", + "S&P/ASX 200 Total Return Index", + "MSCI AC Asia ex-Japan Index", + "MSCI China Free Index", + "MSCI All Country Asia ex Japan Net Index in AUD", + "MSCI All Country World Net Index", + "Bloomberg AusBond Bank 0+Y TR AUD", + "S&P/ASX 300 TR", + "MSCI ACWI NR AUD", + "Credit Suisse Lvg Loans Hdg AUD", + "MSCI World Ex Australia NR AUD", + "S&P/ASX 200 TR AUD", + "FTSE Global Core Infra 50/50 NR Hdg AUD", + "MSCI World NR AUD", + "S&P/ASX 300 A-REIT TR", + "S&P/ASX Small Ordinaries TR AUD", + "CPI + 5.0%", + "CPI + 4.5%", + "S&P/ASX 100 TR", + "CPI + 3.0%", + "FTSE EPRA Nareit Dv ExAUS Rtl TR Hgd AUD", + "MSCI EM NR AUD", + "CPI + 2.5%", + "S&P/ASX 200 A-REIT TR", + "CPI + 5.5%", + "MSCI World ex Australia Hdg AUD", + "RBA Cash Rate Target", + "FTSE EPRA Nareit Dev Rental Hdg NR AUD", + "MSCI All Country Asia (ex Japan) Index", + "Bloomberg AusBond Bank Bill Index", + "MSCI All Countries World ex Australia Index", + "MSCI All Countries World ex-Aus (Hedged)", + "MSCI World Ex Australia Hedged", + "MSCI All Country World Small Cap ex Australia Index", + "MSCI ACWI Ex Australia Small Cap Index", + "S&P / ASX 300 A- REIT Accumulation Index", + "MSCI Australia 300 Index", + "Bloomberg barclays global aggregate Index", + "Bloomberg AUS Bond Bank bill index", + "MSCI All Country World SMID Cap Net Index in AUD", + "MSCI Emerging Markets Total Return Net Index (in AUD)", + "MSCI World Net Total Return Index ex-Australia", + "MSCI World Small Cap Net Total return (TR) Index in AUD", + "S&P/ASX Emerging Companies Accumulation Index", + "S&P/ASX 100 Accumulation Index", + "S&P/ASX Small Industrials Accumulation Index", + "MSCI/Mercer Australia Core Wholesale Monthly Property Fund Index", + "ICE BofA Green Bond Hedged", + "MSCI ACWI ex Australia Index Net Dividend Withholding Tax (AUD)", + "EMIX Global Mining Index", + "FTSE Gold Mines Index return (AUD)", + "MSCI All Country Asia ex-Japan Net Index in AUD", + "MSCI All Country World Net Index in AUD", + "S&P/ASX 200 Accumulation Index", + "FTSE World Government Bond Index hedged into Australian dollars", + "S&P 500 Total Return Index (Net Dividends) in AUD", + "S&P/ASX 200 A-REIT (Sector) (TR) Index", + "S&P North American Technology Sector Index in AUD", + "MSCI All Country World Net Index in AUD (for comparison purposes only)", + "Barclays Global Aggregate Corporate Total Return Index. Hedged to AUD", + "MSCI World Index", + "MSCI All Country World Index, incl. net dividends, measured in AUD", + "FTSE World Government Bond Index hedged to AUD", + "S&P 500 Total Return Index (Net Dividends) in AUD", + "S&P/ASX 200 A-REIT (Sector) (TR) Index", + "MSCI World Index (Total Return Net) Hedged to AUD", + "Bloomberg Barclays Multiverse Index (Total Return Gross) Hedged to AUD", + "S&P Global Infrastructure Index A$ Hedged Net Total Return", + "MSCI Emerging Markets ex-Tobacco ex-Controversial Weapons Net Dividends Reinvested in AUD Index", + "FTSE EPRA/NAREIT Developed ex Australia Rental Index NTR (AUD hedged)", + "S&P/ASX 200 Accumulation Index", + "MSCI All Country World Net Index in AUD", + "FTSE Developed Core Infrastructure 50/50 Index (AUD hedged) Net TRI", + "S&P Global Infrastructure Index (Net Total Return $A Hedged)", + "S&P Global Infrastructure Index A$ Hedged Net Total Return and yield of 10-year Australian Government Bonds", + "MSCI World Index (Total Return Net) Hedged to AUD", + "CPI + 2.5% p.a", + "CPI + 3.5% p.a.", + "Bloomberg Barclays Global Aggregate Bond Index (AUD Hedged)", + "MSCI All Country World ex-Australia Index with Net Dividends Reinvested (AUD Hedged)", + "MSCI All Country World ex-Australia Index with Net Dividends Reinvested (Unhedged)", + "CPI + 1.0% p.a.", + "CPI + 4.0% p.a.", + "CPI + 5.0% p.a.", + "No Performance fee charge", + "The higher of the MSCI World ex-Australia Total Return Net Index in AUD and the 10 Year Australian Government Bond Yield", + "The higher of 6% or the Australian Government 10 year Bond Yield +3.5%", + "ICE BofA Global High Yield Index (AUD hedged)", + "Bloomberg Barclays U.S. Aggregate Bond Index (AUD Hedged Total Return)", + "S&P/ASX 200 All Ordinaries Accumulation Index", + "S&P/ASX 300 Property Trusts Accum", + "UBS Composite Bond (All Maturities)", + "Bloomberg AusBond Bank Bill + 2.5%", + "FTSE Dvlp Core Infra 50/50 NR Hdg AUD", + "Bloomberg AusBond BB AUD", + "FTSE Global Core Infra 50/50 TR Hdg AUD", + "MSCI World SMID Index (Net) (AUD)", + "S&P ASX Small Ordinaries Accumulation Index", + "MSCI ACWI With Special Tax Index (with net dividends reinvested), expressed in AUD", + "MSCI Asia Ex-Japan (Net, AUD)", + "MSCI World (Net, AUD)", + "MSCI Emerging Markets Net Total Return Index (AUD) Unhedged", + "MSCI Asia Ex Japan Small Companies Index (Unhedged in AUD)", + "RBA Consumer Price Inflation (CPI) + 3.0%", + "ASX All Ordinaries Index", + "Australian Government 10-year Bond Yield", + "MSCI AC Asia ex Japan (Standard) Index (Net Dividends) in AUD", + "Bloomberg AusBond Non-Govt 0+ Yr Index", + "Bloomberg AusBond Composite 0+Yr Index", + "MSCI Emerging Markets (Standard) Index (Net Dividends) in AUD", + "FTSE EPRA/NAREIT Developed ex Australia hedged in AUD Net TRI", + "MSCI ACWI IMI Index in AUD", + "Bloomberg AusBond Govt 0+Yr Index", + "Pendal MidCap Custom Index", + "Australian CPI", + "MSCI Emerging Markets Net Total Return Index", + "MSCI ACWI Small Cap Index (net div. reinv.)", + "Reserve Bank of Australia Official Cash Rate", + "Bloomberg Global Aggregate Index ($A hedged)", + "MSCI World ex Australia net total return index (unhedged)", + "MSCI All Country World Index (with net dividends reinvested) in AUD", + "FTSE Developed Core Infrastructure Hedged into AUD Index", + "S2VenturaCapitalStableFundHybridIndex", + "S2VenturaDiversified50FundHybridIndex", + "S2VenturaGrowth70FundHybridIndex", + "MSCI World ex Australia ex Tobacco ex Controversial Weapons Index (AUD) with net dividends reinvested", + "MSCI World ex Australia (unhedged in $A)", + "S&P Global infrastructure AUD Net", + "MSCIWorldexAustraliaIndex,in$Aunhedgedwithnetdividendsreinvested", + "MSCI World Total Return Index with net dividends in Australian Dollars", + "MSCI Emerging Markets Index in Australian Dollars", + "MSCI All Country World Index ex-US Small Cap USD Gross Total Return Index (with gross dividends reinvested, reported in Australian dollars and unhedged)", + "MSCI All Country World Index ex-Australia (with gross dividends reinvested reported in Australian dollars and unhedged)", + "MSCI All Country World Index ex-Australia Net Total Return Index 100% hedged to AUD (reported in Australian dollars)", + "S&P 300 Industrials Accumulation Index" +] \ No newline at end of file diff --git a/utils/biz_utils.py b/utils/biz_utils.py index 12866ca..ba35531 100644 --- a/utils/biz_utils.py +++ b/utils/biz_utils.py @@ -4,7 +4,7 @@ import time from utils.logger import logger from copy import deepcopy from traceback import print_exc - +import benchmark_names total_currency_list = [ "USD", @@ -1103,4 +1103,19 @@ def replace_special_table_header(replace_table_header_config: list, page_text: s return page_text + +def get_bechmark_name(text, search_terms, word_count=300): + results = [] + try: + # text = bs(text).get_text() + for term in search_terms: + pattern = r'\b' + re.escape(term) + r'\b(?:\s+\S+){0,' + str(word_count) + '}' + matches = re.finditer(pattern, text, re.IGNORECASE) + for match in matches: + results.append(match.group()) + except Exception as e: + logger.error(f"An error occurred while processing the term '{term}': {e}") + + return " ".join(results) +#benchmark_name = get_bechmark_name(text, benchmark_names.benchmark_keywords) \ No newline at end of file