bw-essentials-core 0.0.6__py3-none-any.whl → 0.0.7__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/api_client.py +1 -1
- bw_essentials/services/master_data.py +24 -2
- {bw_essentials_core-0.0.6.dist-info → bw_essentials_core-0.0.7.dist-info}/METADATA +1 -1
- {bw_essentials_core-0.0.6.dist-info → bw_essentials_core-0.0.7.dist-info}/RECORD +6 -6
- {bw_essentials_core-0.0.6.dist-info → bw_essentials_core-0.0.7.dist-info}/WHEEL +0 -0
- {bw_essentials_core-0.0.6.dist-info → bw_essentials_core-0.0.7.dist-info}/top_level.txt +0 -0
|
@@ -158,9 +158,9 @@ class ApiClient:
|
|
|
158
158
|
try:
|
|
159
159
|
response = requests.request(method, formatted_url, headers=self.headers, **kwargs)
|
|
160
160
|
elapsed_time_ms = (time.time() - start) * 1000
|
|
161
|
-
response.raise_for_status()
|
|
162
161
|
json_data = response.json()
|
|
163
162
|
self._log_response(method, formatted_url, response.status_code, elapsed_time_ms, json_data)
|
|
163
|
+
response.raise_for_status()
|
|
164
164
|
return json_data
|
|
165
165
|
except Exception as exc:
|
|
166
166
|
elapsed_time_ms = (time.time() - start) * 1000
|
|
@@ -44,7 +44,8 @@ class MasterData(ApiClient):
|
|
|
44
44
|
"constant": "constants",
|
|
45
45
|
"broker_config": "broker/config/keys",
|
|
46
46
|
"broker_details": "securities/{}/details",
|
|
47
|
-
"isin_details": "company/details/isin"
|
|
47
|
+
"isin_details": "company/details/isin",
|
|
48
|
+
"shorten_url": "shorten-url"
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
def get_security_details(self, securities: List[str]) -> Optional[Dict[str, Any]]:
|
|
@@ -107,7 +108,8 @@ class MasterData(ApiClient):
|
|
|
107
108
|
Returns:
|
|
108
109
|
Optional[Dict[str, Any]]: Configuration key data or None.
|
|
109
110
|
"""
|
|
110
|
-
logger.info(
|
|
111
|
+
logger.info(
|
|
112
|
+
f"Fetching broker config keys for broker={broker}, product_type={product_type}, category={category}")
|
|
111
113
|
params = {k: v for k, v in {'broker': broker, 'product': product_type, 'category': category}.items() if v}
|
|
112
114
|
response = self._get(url=self.base_url,
|
|
113
115
|
endpoint=self.urls["broker_config"],
|
|
@@ -255,3 +257,23 @@ class MasterData(ApiClient):
|
|
|
255
257
|
|
|
256
258
|
logger.info("Market is closed based on hours and/or holiday check.")
|
|
257
259
|
return False
|
|
260
|
+
|
|
261
|
+
def shorten_url(self, long_url: str) -> Dict[str, Any]:
|
|
262
|
+
"""Shorten a long URL using the configured URL-shortening service.
|
|
263
|
+
|
|
264
|
+
Args:
|
|
265
|
+
long_url (str): The long URL to shorten.
|
|
266
|
+
|
|
267
|
+
Returns:
|
|
268
|
+
dict: A dictionary containing the shortened URL or any error data.
|
|
269
|
+
|
|
270
|
+
Logs:
|
|
271
|
+
Information about the long_url being shortened.
|
|
272
|
+
|
|
273
|
+
"""
|
|
274
|
+
logger.info(f"Shortening URL: {long_url}")
|
|
275
|
+
response = self._post(url=self.base_url,
|
|
276
|
+
endpoint=self.urls["shorten_url"],
|
|
277
|
+
data={"long_url": long_url})
|
|
278
|
+
logger.info(f"Shortening URL {response =}")
|
|
279
|
+
return response.get("data", {})
|
|
@@ -11,15 +11,15 @@ bw_essentials/notifications/teams_notifications.py,sha256=1tkS3tTJQZ5ByMwK2WXpFg
|
|
|
11
11
|
bw_essentials/s3_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
bw_essentials/s3_utils/s3_utils.py,sha256=wzjVrTX22_8PMX86svKFYGMZwgjBHbOaeEsxO-lR7BY,12922
|
|
13
13
|
bw_essentials/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
bw_essentials/services/api_client.py,sha256=
|
|
14
|
+
bw_essentials/services/api_client.py,sha256=74tKxhY_HiVCN3kgtk27a4GNznMaRphAspt9CWecuiY,7793
|
|
15
15
|
bw_essentials/services/broker.py,sha256=As-VT1MxkCD9p-13dQJDwf0_aEJVA6H0wNqL-EYHO4g,8718
|
|
16
16
|
bw_essentials/services/market_pricer.py,sha256=WAFcG5JfnqWxjzXRPrMdovPuKqWJIwa3ENvGAyEyjeM,8712
|
|
17
|
-
bw_essentials/services/master_data.py,sha256=
|
|
17
|
+
bw_essentials/services/master_data.py,sha256=JpI7HfyN2hgkr9Mdcm4DzddSwmAv6AvsUmAuyrW0LYo,10828
|
|
18
18
|
bw_essentials/services/model_portfolio_reporting.py,sha256=iOtm4gyfU8P7C0R1gp6gUJI4ZRxJD5K2GLOalI_gToM,3249
|
|
19
19
|
bw_essentials/services/trade_placement.py,sha256=PrzeU2XXC9HF1IQ1dMDM_ZHxmC491sOl-JbA6GWPwII,20772
|
|
20
20
|
bw_essentials/services/user_portfolio.py,sha256=_5M6yPfQt4MXedINBawEoPkb_o7IGzxPeHkvZkoQm8k,16191
|
|
21
21
|
bw_essentials/services/user_portfolio_reporting.py,sha256=QaZzcw912Uos5ZafEaxLXDmCyetTFiVX3at3cTAv6MA,6003
|
|
22
|
-
bw_essentials_core-0.0.
|
|
23
|
-
bw_essentials_core-0.0.
|
|
24
|
-
bw_essentials_core-0.0.
|
|
25
|
-
bw_essentials_core-0.0.
|
|
22
|
+
bw_essentials_core-0.0.7.dist-info/METADATA,sha256=6nghqDj90cybbLd3LiSk_Ws3vVYydKFocJ0fgeZriGI,7501
|
|
23
|
+
bw_essentials_core-0.0.7.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
24
|
+
bw_essentials_core-0.0.7.dist-info/top_level.txt,sha256=gDc5T_y5snwKGXDQUusEus-FEt0RFwG644Yn_58wQOQ,14
|
|
25
|
+
bw_essentials_core-0.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|