btgsolutions-dataservices-python-client 4.7.0__tar.gz → 4.8.1__tar.gz
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.
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/PKG-INFO +21 -2
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/README.md +6 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/__init__.py +1 -1
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/bulk_data.py +3 -1
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/dataservices_catalog.py +25 -3
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/ticker_last_event.py +27 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices_python_client.egg-info/PKG-INFO +22 -3
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/setup.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/LICENSE +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/MANIFEST.in +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/config.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/exceptions.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/algohunter.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/alternative_data_catalog.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/alternative_data_companies.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/alternative_data_funds.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/alternative_data_macro_markets.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/alternative_data_metadata.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/alternative_data_ownership.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/alternative_data_people.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/authenticator.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/book_scope.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/broker_analytics.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/broker_reference.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/company_data.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/corporate_events.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/hfn.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/historical_candles.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/historical_candles_crypto.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/intraday_candles.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/intraday_tick_data.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/public_sources.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/quotes.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/reference_data.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/stock_loan.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/rest/ticker_last_event_polling.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/websocket/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/websocket/broker_analytics.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/websocket/hfn_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/websocket/market_data_feed.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/websocket/market_data_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices/websocket/websocket_default_functions.py +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices_python_client.egg-info/SOURCES.txt +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices_python_client.egg-info/dependency_links.txt +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices_python_client.egg-info/requires.txt +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/btgsolutions_dataservices_python_client.egg-info/top_level.txt +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/pyproject.toml +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/requirements.txt +0 -0
- {btgsolutions_dataservices_python_client-4.7.0 → btgsolutions_dataservices_python_client-4.8.1}/setup.cfg +0 -0
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: btgsolutions_dataservices_python_client
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.8.1
|
|
4
4
|
Summary: Python package containing several classes and data for extracting and manipulating market and trading data.
|
|
5
5
|
Home-page: https://github.com/BTG-Pactual-Solutions/btgsolutions-dataservices-python-client
|
|
6
6
|
Author: BTG Solutions Data Services powered by BTG Pactual Solutions
|
|
7
7
|
Requires-Python: >=3.9,<3.15
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
|
+
Requires-Dist: pandas>=2.2.2
|
|
11
|
+
Requires-Dist: websocket-client>=1.8.0
|
|
12
|
+
Requires-Dist: PyJWT>=2.8.0
|
|
13
|
+
Requires-Dist: requests>=2.32.3
|
|
14
|
+
Requires-Dist: pyarrow>=17.0.0
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: description-content-type
|
|
18
|
+
Dynamic: home-page
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
Dynamic: requires-dist
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
10
23
|
|
|
11
24
|
# BTG Solutions - Data Services
|
|
12
25
|
|
|
@@ -336,6 +349,12 @@ bulk_data.get_data(ticker='DI1F18', date='2017-01-02', data_type='trades')
|
|
|
336
349
|
# bulk_data.get_data(ticker='PETR4', date='2024-01-22', data_type='books')
|
|
337
350
|
# bulk_data.get_data(ticker='VALE3', date='2024-04-01', data_type='trades-and-book-events')
|
|
338
351
|
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='instrument-status')
|
|
352
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='price-events')
|
|
353
|
+
# bulk_data.get_data(ticker='AURE3T', date='2025-05-07', data_type='open-interest')
|
|
354
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='execution-summary')
|
|
355
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='execution-statistics')
|
|
356
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='auction-imbalance')
|
|
357
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='price-quantity-bands')
|
|
339
358
|
```
|
|
340
359
|
|
|
341
360
|
##### Get Data With Billing Headers
|
|
@@ -326,6 +326,12 @@ bulk_data.get_data(ticker='DI1F18', date='2017-01-02', data_type='trades')
|
|
|
326
326
|
# bulk_data.get_data(ticker='PETR4', date='2024-01-22', data_type='books')
|
|
327
327
|
# bulk_data.get_data(ticker='VALE3', date='2024-04-01', data_type='trades-and-book-events')
|
|
328
328
|
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='instrument-status')
|
|
329
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='price-events')
|
|
330
|
+
# bulk_data.get_data(ticker='AURE3T', date='2025-05-07', data_type='open-interest')
|
|
331
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='execution-summary')
|
|
332
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='execution-statistics')
|
|
333
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='auction-imbalance')
|
|
334
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='price-quantity-bands')
|
|
329
335
|
```
|
|
330
336
|
|
|
331
337
|
##### Get Data With Billing Headers
|
|
@@ -207,7 +207,9 @@ class BulkData:
|
|
|
207
207
|
Format: 'YYYY-MM-DD'. Example: '2023-07-03', '2023-07-28'.
|
|
208
208
|
data_type: str
|
|
209
209
|
Market data type.
|
|
210
|
-
Field is required. Available types: 'trades', 'books', 'trades-and-book-events'
|
|
210
|
+
Field is required. Available types: 'trades', 'books', 'trades-and-book-events',
|
|
211
|
+
'instrument-status', 'price-events', 'open-interest', 'execution-summary',
|
|
212
|
+
'execution-statistics', 'auction-imbalance', 'price-quantity-bands'
|
|
211
213
|
raw_data: bool
|
|
212
214
|
If false, returns data in a dataframe. If true, returns raw data.
|
|
213
215
|
Field is not required. Default: False.
|
|
@@ -575,6 +575,20 @@ DATASERVICES_ENDPOINTS: dict[str, dict[str, Any]] = {
|
|
|
575
575
|
"not a last trade or top-of-book snapshot."
|
|
576
576
|
),
|
|
577
577
|
},
|
|
578
|
+
"TickerLastEvent.get_settlement_price": {
|
|
579
|
+
"category": "last_event",
|
|
580
|
+
"path": "/api/v1/marketdata/br/b3/snapshot/settlement-price/batch",
|
|
581
|
+
"method": "GET",
|
|
582
|
+
"client": "TickerLastEvent",
|
|
583
|
+
"description": (
|
|
584
|
+
"Return the most recent settlement price records for a list of B3 "
|
|
585
|
+
"derivatives tickers. Results are grouped by ticker and price type."
|
|
586
|
+
),
|
|
587
|
+
"parameters": {
|
|
588
|
+
"tickers": "List of derivatives tickers such as ['WDOH25', 'WINM25'].",
|
|
589
|
+
},
|
|
590
|
+
"relationships": ["ticker_discovery", "reference_enrichment"],
|
|
591
|
+
},
|
|
578
592
|
"ReferenceData.ticker_reference": {
|
|
579
593
|
"category": "reference_data",
|
|
580
594
|
"path": "/api/v1/marketdata/br/b3/snapshot/instruments/batch",
|
|
@@ -844,13 +858,20 @@ DATASERVICES_ENDPOINTS: dict[str, dict[str, Any]] = {
|
|
|
844
858
|
"client": "BulkData",
|
|
845
859
|
"description": (
|
|
846
860
|
"Return tick-by-tick bulk market data for one ticker and date as a "
|
|
847
|
-
"Parquet-backed dataset. Data types include trades, books
|
|
848
|
-
"trades-and-book-events
|
|
861
|
+
"Parquet-backed dataset. Data types include trades, books, "
|
|
862
|
+
"trades-and-book-events, instrument-status, price-events, "
|
|
863
|
+
"open-interest, execution-summary, execution-statistics, "
|
|
864
|
+
"auction-imbalance and price-quantity-bands."
|
|
849
865
|
),
|
|
850
866
|
"parameters": {
|
|
851
867
|
"ticker": "Ticker such as DI1F18 or PETR4.",
|
|
852
868
|
"date": "Coverage date in YYYY-MM-DD.",
|
|
853
|
-
"data_type":
|
|
869
|
+
"data_type": (
|
|
870
|
+
"Bulk data type: trades, books, trades-and-book-events, "
|
|
871
|
+
"instrument-status, price-events, open-interest, "
|
|
872
|
+
"execution-summary, execution-statistics, auction-imbalance "
|
|
873
|
+
"or price-quantity-bands."
|
|
874
|
+
),
|
|
854
875
|
},
|
|
855
876
|
"relationships": [
|
|
856
877
|
"bulk_data_discovery", "book_scope_microstructure",
|
|
@@ -997,6 +1018,7 @@ DATASERVICES_TOOL_ENDPOINTS: dict[str, str] = {
|
|
|
997
1018
|
"get_last_top_of_book": "TickerLastEvent.get_tobs",
|
|
998
1019
|
"get_trading_status": "TickerLastEvent.get_status",
|
|
999
1020
|
"list_last_event_tickers": "TickerLastEvent.get_available_tickers",
|
|
1021
|
+
"get_last_settlement_price": "TickerLastEvent.get_settlement_price",
|
|
1000
1022
|
"get_ticker_reference": "ReferenceData.ticker_reference",
|
|
1001
1023
|
"get_corporate_events": "CorporateEvents.get",
|
|
1002
1024
|
"get_company_general_info": "CompanyData.general_info",
|
|
@@ -145,6 +145,33 @@ class TickerLastEvent:
|
|
|
145
145
|
response = json.loads(response.text)
|
|
146
146
|
raise BadResponse(f'Error: {response}')
|
|
147
147
|
|
|
148
|
+
def get_settlement_price(self, tickers: List[str], raw_data: bool = False):
|
|
149
|
+
|
|
150
|
+
"""
|
|
151
|
+
This method provides the most recent settlement price records for a list of B3 derivatives tickers.
|
|
152
|
+
|
|
153
|
+
Parameters
|
|
154
|
+
----------------
|
|
155
|
+
tickers: List[str]
|
|
156
|
+
List of ticker symbols.
|
|
157
|
+
Field is required. Example: ['WDOH25', 'WINM25'].
|
|
158
|
+
raw_data: bool
|
|
159
|
+
If false, returns data in a dataframe. If true, returns raw data.
|
|
160
|
+
Field is not required. Default: False.
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
url = f"{base_url}/api/v1/marketdata/br/b3/snapshot/settlement-price/batch?tickers={','.join(tickers)}"
|
|
164
|
+
|
|
165
|
+
response = requests.request("GET", url, headers={"authorization": f"Bearer {self.authenticator.token}"})
|
|
166
|
+
if response.status_code == 200:
|
|
167
|
+
if raw_data:
|
|
168
|
+
return response.json()
|
|
169
|
+
else:
|
|
170
|
+
return pd.DataFrame([r for records in response.json().values() for r in records])
|
|
171
|
+
else:
|
|
172
|
+
response = json.loads(response.text)
|
|
173
|
+
raise BadResponse(f'Error: {response.get("ApiClientError", response.get("error", ""))}')
|
|
174
|
+
|
|
148
175
|
def get_available_tickers(self,type:str, data_type:str):
|
|
149
176
|
|
|
150
177
|
"""
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 4.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: btgsolutions_dataservices_python_client
|
|
3
|
+
Version: 4.8.1
|
|
4
4
|
Summary: Python package containing several classes and data for extracting and manipulating market and trading data.
|
|
5
5
|
Home-page: https://github.com/BTG-Pactual-Solutions/btgsolutions-dataservices-python-client
|
|
6
6
|
Author: BTG Solutions Data Services powered by BTG Pactual Solutions
|
|
7
7
|
Requires-Python: >=3.9,<3.15
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
|
+
Requires-Dist: pandas>=2.2.2
|
|
11
|
+
Requires-Dist: websocket-client>=1.8.0
|
|
12
|
+
Requires-Dist: PyJWT>=2.8.0
|
|
13
|
+
Requires-Dist: requests>=2.32.3
|
|
14
|
+
Requires-Dist: pyarrow>=17.0.0
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: description-content-type
|
|
18
|
+
Dynamic: home-page
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
Dynamic: requires-dist
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
10
23
|
|
|
11
24
|
# BTG Solutions - Data Services
|
|
12
25
|
|
|
@@ -336,6 +349,12 @@ bulk_data.get_data(ticker='DI1F18', date='2017-01-02', data_type='trades')
|
|
|
336
349
|
# bulk_data.get_data(ticker='PETR4', date='2024-01-22', data_type='books')
|
|
337
350
|
# bulk_data.get_data(ticker='VALE3', date='2024-04-01', data_type='trades-and-book-events')
|
|
338
351
|
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='instrument-status')
|
|
352
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='price-events')
|
|
353
|
+
# bulk_data.get_data(ticker='AURE3T', date='2025-05-07', data_type='open-interest')
|
|
354
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='execution-summary')
|
|
355
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='execution-statistics')
|
|
356
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='auction-imbalance')
|
|
357
|
+
# bulk_data.get_data(ticker='PETR4', date='2025-05-07', data_type='price-quantity-bands')
|
|
339
358
|
```
|
|
340
359
|
|
|
341
360
|
##### Get Data With Billing Headers
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|