bw-essentials-core 0.1.5__py3-none-any.whl → 0.1.6__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.
- bw_essentials/services/user_portfolio_reporting.py +18 -1
- {bw_essentials_core-0.1.5.dist-info → bw_essentials_core-0.1.6.dist-info}/METADATA +1 -1
- {bw_essentials_core-0.1.5.dist-info → bw_essentials_core-0.1.6.dist-info}/RECORD +5 -5
- {bw_essentials_core-0.1.5.dist-info → bw_essentials_core-0.1.6.dist-info}/WHEEL +0 -0
- {bw_essentials_core-0.1.5.dist-info → bw_essentials_core-0.1.6.dist-info}/top_level.txt +0 -0
|
@@ -65,7 +65,8 @@ class UserReporting(ApiClient):
|
|
|
65
65
|
self.urls = {
|
|
66
66
|
"instructions": "reporting/instructions/",
|
|
67
67
|
"portfolio_performance": "reporting/user/%s/userportfolio/%s/performance/",
|
|
68
|
-
"portfolio_performance_breakdown": "reporting/user/%s/userportfolio/%s/performance/breakdown/"
|
|
68
|
+
"portfolio_performance_breakdown": "reporting/user/%s/userportfolio/%s/performance/breakdown/",
|
|
69
|
+
'portfolio_stock_performance': "reporting/user/%s/userportfolio/%s/stock/performance/"
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
def _get_integer_quantity(self, qty, side):
|
|
@@ -151,3 +152,19 @@ class UserReporting(ApiClient):
|
|
|
151
152
|
endpoint=endpoint)
|
|
152
153
|
logger.info(f"{data =}")
|
|
153
154
|
return data.get("data")
|
|
155
|
+
|
|
156
|
+
def get_portfolio_stock_performance(self, user_id, user_portfolio_id):
|
|
157
|
+
"""
|
|
158
|
+
Retrieves a detailed breakdown of portfolio pnl
|
|
159
|
+
|
|
160
|
+
:param user_id: ID of the user
|
|
161
|
+
:param user_portfolio_id: ID of the user portfolio
|
|
162
|
+
:return: Performance breakdown data from the response
|
|
163
|
+
"""
|
|
164
|
+
logger.info(f"In get_portfolio_stock_performance {user_id=}, {user_portfolio_id=}")
|
|
165
|
+
endpoint = self.urls.get('portfolio_stock_performance') % (
|
|
166
|
+
user_id, user_portfolio_id)
|
|
167
|
+
data = self._get(url=self.base_url,
|
|
168
|
+
endpoint=endpoint)
|
|
169
|
+
logger.info(f"{data=}")
|
|
170
|
+
return data.get("data")
|
|
@@ -22,8 +22,8 @@ bw_essentials/services/portfolio_content.py,sha256=rdFTTsUUIt-AgFfA1SAItqg2njakV
|
|
|
22
22
|
bw_essentials/services/trade_placement.py,sha256=PrzeU2XXC9HF1IQ1dMDM_ZHxmC491sOl-JbA6GWPwII,20772
|
|
23
23
|
bw_essentials/services/user_app.py,sha256=_Y2NgDq6kEoco7ZRJ3-MMYJ-K2HGStJoFoeGOH_HotQ,11107
|
|
24
24
|
bw_essentials/services/user_portfolio.py,sha256=_5M6yPfQt4MXedINBawEoPkb_o7IGzxPeHkvZkoQm8k,16191
|
|
25
|
-
bw_essentials/services/user_portfolio_reporting.py,sha256=
|
|
26
|
-
bw_essentials_core-0.1.
|
|
27
|
-
bw_essentials_core-0.1.
|
|
28
|
-
bw_essentials_core-0.1.
|
|
29
|
-
bw_essentials_core-0.1.
|
|
25
|
+
bw_essentials/services/user_portfolio_reporting.py,sha256=pwqfW95LTiGOGufcTphljFxPlOd-G4Q263UtoQURPxM,6772
|
|
26
|
+
bw_essentials_core-0.1.6.dist-info/METADATA,sha256=_l1af2qiqA9GAR4Wdzu1AhoCncXfLVyxolbvPNk0yeU,7501
|
|
27
|
+
bw_essentials_core-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
+
bw_essentials_core-0.1.6.dist-info/top_level.txt,sha256=gDc5T_y5snwKGXDQUusEus-FEt0RFwG644Yn_58wQOQ,14
|
|
29
|
+
bw_essentials_core-0.1.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|