bw-essentials-core 0.1.17__py3-none-any.whl → 0.1.18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bw-essentials-core might be problematic. Click here for more details.

@@ -33,7 +33,8 @@ class ModelPortfolioReporting(ApiClient):
33
33
  self.object = None
34
34
  self.urls = {
35
35
  "portfolio": "portfolio",
36
- "portfolio_performance": "portfolio/%s/performance"
36
+ "portfolio_performance": "portfolio/%s/performance",
37
+ "index_performance": "index/%s/performance/"
37
38
  }
38
39
  self.name = Services.MODEL_PORTFOLIO.value
39
40
  self.base_url = self.get_base_url(Services.MODEL_PORTFOLIO.value)
@@ -79,3 +80,31 @@ class ModelPortfolioReporting(ApiClient):
79
80
  )
80
81
  logger.info(f"Received response from get_portfolio_performance_by_dates: {performance}")
81
82
  return performance.get("data")
83
+
84
+ def get_index_performance_by_dates(
85
+ self,
86
+ index: str,
87
+ start_date: str,
88
+ end_date: str
89
+ ) -> Optional[Dict[str, Any]]:
90
+ """
91
+ Fetch Index performance for a given date range.
92
+
93
+ Args:
94
+ index (str): The index identifier.
95
+ start_date (str): The start date for performance metrics (format: YYYY-MM-DD).
96
+ end_date (str): The end date for performance metrics (format: YYYY-MM-DD).
97
+
98
+ Returns:
99
+ dict | None: The performance data within the date range.
100
+ """
101
+ logger.info(f"In - get_index_performance_by_dates with index={index}, start_date={start_date}, end_date={end_date}")
102
+ endpoint = self.urls['index_performance'] % index
103
+ params = {"start_date": start_date, "end_date": end_date}
104
+ performance = self._get(
105
+ url=self.base_url,
106
+ endpoint=endpoint,
107
+ params=params
108
+ )
109
+ logger.info(f"Received response from get_index_performance_by_dates: {performance}")
110
+ return performance.get("data")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bw-essentials-core
3
- Version: 0.1.17
3
+ Version: 0.1.18
4
4
  Summary: Reusable utilities for S3, email, Data Loch, Microsoft Teams Notifications and more.
5
5
  Author: InvestorAI
6
6
  Author-email: support+tech@investorai.in
@@ -16,7 +16,7 @@ bw_essentials/services/broker.py,sha256=W4y31K7dF4LHfQSvnAwVWfGoYKkdz-W2TXqTLhkU
16
16
  bw_essentials/services/job_scheduler.py,sha256=1fQDWBvNa3bMCm3YzlJehoS-HONUSu4_oquuBv6t0Lg,1966
17
17
  bw_essentials/services/market_pricer.py,sha256=Qc9lxzAjhefAvjyEKsBPDu60bF6_61cnSpZNfjGMyDg,11755
18
18
  bw_essentials/services/master_data.py,sha256=2o_r2gdhIKBeTFgn5IIY-becgCEpYBymO4BKmixdV1g,11987
19
- bw_essentials/services/model_portfolio_reporting.py,sha256=iOtm4gyfU8P7C0R1gp6gUJI4ZRxJD5K2GLOalI_gToM,3249
19
+ bw_essentials/services/model_portfolio_reporting.py,sha256=VLSvfRZOdn-nI3MtgfcqP0ZE3aTqBU0NcncLffPVtD8,4407
20
20
  bw_essentials/services/notification.py,sha256=q4jIZzIWIHvn-XaIIbkEjjhkYUV8ZGQWUXaY4NNRFgI,5078
21
21
  bw_essentials/services/payment.py,sha256=Em8Lvg7aX1Ga4CJDpJimyE_ByZhJZKM6W6rw2cUUIvw,1479
22
22
  bw_essentials/services/portfolio_catalogue.py,sha256=Eal2wJd2qQB_qk2B_7u0-SwsZTN9nMsSxwgoIud845Y,7201
@@ -25,7 +25,7 @@ bw_essentials/services/trade_placement.py,sha256=PrzeU2XXC9HF1IQ1dMDM_ZHxmC491sO
25
25
  bw_essentials/services/user_app.py,sha256=1z73G91TygW_MgHjkUVA2WIdN4CQjx_oSZWW6NqFit8,11774
26
26
  bw_essentials/services/user_portfolio.py,sha256=uUQUCG8Av8eKBIw-TlNtOPpQluO9HjAkxMzzO5jfzbo,22179
27
27
  bw_essentials/services/user_portfolio_reporting.py,sha256=pwqfW95LTiGOGufcTphljFxPlOd-G4Q263UtoQURPxM,6772
28
- bw_essentials_core-0.1.17.dist-info/METADATA,sha256=9reGA-4ZeYNOVS7aIbRbjv9MjXrEEhPS0x85ZcXwGgQ,7502
29
- bw_essentials_core-0.1.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
- bw_essentials_core-0.1.17.dist-info/top_level.txt,sha256=gDc5T_y5snwKGXDQUusEus-FEt0RFwG644Yn_58wQOQ,14
31
- bw_essentials_core-0.1.17.dist-info/RECORD,,
28
+ bw_essentials_core-0.1.18.dist-info/METADATA,sha256=7Jbm6MRXIKxsoPYYas102hfzY8VeeoueNg6Cc5ppDZ0,7502
29
+ bw_essentials_core-0.1.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
+ bw_essentials_core-0.1.18.dist-info/top_level.txt,sha256=gDc5T_y5snwKGXDQUusEus-FEt0RFwG644Yn_58wQOQ,14
31
+ bw_essentials_core-0.1.18.dist-info/RECORD,,