btgsolutions-dataservices-python-client 2.14.1__tar.gz → 2.15.0__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-2.14.1/btgsolutions_dataservices_python_client.egg-info → btgsolutions-dataservices-python-client-2.15.0}/PKG-INFO +17 -15
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/README.md +15 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/config.py +8 -1
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/websocket/market_data_feed.py +1 -1
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/websocket/market_data_websocket_client.py +3 -3
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0/btgsolutions_dataservices_python_client.egg-info}/PKG-INFO +17 -15
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/setup.py +1 -1
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/LICENSE +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/MANIFEST.in +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/exceptions.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/authenticator.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/bulk_data.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/company_data.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/corporate_events.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/hfn.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/historical_candles.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/intraday_candles.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/intraday_tick_data.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/public_sources.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/quotes.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/reference_data.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/rest/ticker_last_event.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/websocket/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/websocket/hfn_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices/websocket/websocket_default_functions.py +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices_python_client.egg-info/SOURCES.txt +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices_python_client.egg-info/dependency_links.txt +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices_python_client.egg-info/requires.txt +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/btgsolutions_dataservices_python_client.egg-info/top_level.txt +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/pyproject.toml +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/requirements.txt +0 -0
- {btgsolutions_dataservices_python_client-2.14.1 → btgsolutions-dataservices-python-client-2.15.0}/setup.cfg +0 -0
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: btgsolutions-dataservices-python-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.15.0
|
|
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.13
|
|
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
|
|
23
10
|
|
|
24
11
|
# BTG Solutions - Data Services
|
|
25
12
|
|
|
@@ -170,6 +157,21 @@ ws.run(on_message=lambda message: print(message))
|
|
|
170
157
|
ws.instrument_status('PETR4')
|
|
171
158
|
ws.instrument_status_history('PETR4')
|
|
172
159
|
|
|
160
|
+
## The following is optional to keep the program running in a .py file:
|
|
161
|
+
# from time import sleep
|
|
162
|
+
# while True:
|
|
163
|
+
# sleep(1)
|
|
164
|
+
```
|
|
165
|
+
##### Settlement Price
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
import btgsolutions_dataservices as btg
|
|
169
|
+
ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='settlement-price', instruments=['ABEVOU25', 'WINV25'])
|
|
170
|
+
ws.run(on_message=lambda message: print(message))
|
|
171
|
+
|
|
172
|
+
## Getting the last event (settlement-price) of ABEVOU25:
|
|
173
|
+
# ws.get_last_event(['ABEVOU25'])
|
|
174
|
+
|
|
173
175
|
## The following is optional to keep the program running in a .py file:
|
|
174
176
|
# from time import sleep
|
|
175
177
|
# while True:
|
|
@@ -147,6 +147,21 @@ ws.run(on_message=lambda message: print(message))
|
|
|
147
147
|
ws.instrument_status('PETR4')
|
|
148
148
|
ws.instrument_status_history('PETR4')
|
|
149
149
|
|
|
150
|
+
## The following is optional to keep the program running in a .py file:
|
|
151
|
+
# from time import sleep
|
|
152
|
+
# while True:
|
|
153
|
+
# sleep(1)
|
|
154
|
+
```
|
|
155
|
+
##### Settlement Price
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
import btgsolutions_dataservices as btg
|
|
159
|
+
ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='settlement-price', instruments=['ABEVOU25', 'WINV25'])
|
|
160
|
+
ws.run(on_message=lambda message: print(message))
|
|
161
|
+
|
|
162
|
+
## Getting the last event (settlement-price) of ABEVOU25:
|
|
163
|
+
# ws.get_last_event(['ABEVOU25'])
|
|
164
|
+
|
|
150
165
|
## The following is optional to keep the program running in a .py file:
|
|
151
166
|
# from time import sleep
|
|
152
167
|
# while True:
|
|
@@ -26,6 +26,7 @@ SECURITIES = 'securities'
|
|
|
26
26
|
TRADES = 'trades'
|
|
27
27
|
PROCESSEDTRADES = 'processed-trades'
|
|
28
28
|
INSTRUMENTSTATUS = 'instrument_status'
|
|
29
|
+
SETTLEMENTPRICES = 'settlement-price'
|
|
29
30
|
BOOKS = 'books'
|
|
30
31
|
INDICES = 'indices'
|
|
31
32
|
CANDLES1S = 'candles-1S'
|
|
@@ -49,7 +50,8 @@ VALID_MARKET_DATA_TYPES = [
|
|
|
49
50
|
CANDLES1S,
|
|
50
51
|
CANDLES1M,
|
|
51
52
|
STOPLOSS,
|
|
52
|
-
INSTRUMENTSTATUS
|
|
53
|
+
INSTRUMENTSTATUS,
|
|
54
|
+
SETTLEMENTPRICES
|
|
53
55
|
]
|
|
54
56
|
VALID_MARKET_DATA_SUBTYPES = [ALL, STOCKS, OPTIONS, DERIVATIVES]
|
|
55
57
|
|
|
@@ -134,6 +136,11 @@ market_data_socket_urls = {
|
|
|
134
136
|
DERIVATIVES: f"{url_ws}v2/marketdata/{INSTRUMENTSTATUS}/{DERIVATIVES}",
|
|
135
137
|
OPTIONS: f"{url_ws}v2/marketdata/{INSTRUMENTSTATUS}/{OPTIONS}",
|
|
136
138
|
}
|
|
139
|
+
},
|
|
140
|
+
SETTLEMENTPRICES: {
|
|
141
|
+
REALTIME: {
|
|
142
|
+
ALL: f"{url_ws}v2/marketdata/{SETTLEMENTPRICES}",
|
|
143
|
+
}
|
|
137
144
|
}
|
|
138
145
|
},
|
|
139
146
|
BMV: {
|
|
@@ -61,7 +61,7 @@ class MarketDataFeed:
|
|
|
61
61
|
Field is not required. Default: 'b3'.
|
|
62
62
|
data_type: str
|
|
63
63
|
Market Data type.
|
|
64
|
-
Options: 'trades', 'processed-trades', 'books', 'indices', 'securities', 'stoploss', 'candles-1S', 'candles-1M', 'instrument_status'.
|
|
64
|
+
Options: 'trades', 'processed-trades', 'books', 'indices', 'securities', 'stoploss', 'candles-1S', 'candles-1M', 'instrument_status', 'settlement-price'.
|
|
65
65
|
Field is not required. Default: 'trades'.
|
|
66
66
|
data_subtype: str
|
|
67
67
|
Market Data subtype (when applicable).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
from typing import Optional, List
|
|
3
3
|
from ..exceptions import WSTypeError, DelayedError, FeedError
|
|
4
4
|
from ..rest import Authenticator
|
|
5
|
-
from ..config import market_data_socket_urls, market_data_feedb_socket_urls, MAX_WS_RECONNECT_RETRIES, VALID_STREAM_TYPES, VALID_EXCHANGES, VALID_MARKET_DATA_TYPES, VALID_MARKET_DATA_SUBTYPES, REALTIME, B3, TRADES, INDICES, ALL, STOCKS, BOOKS, FEED_A, FEED_B
|
|
5
|
+
from ..config import market_data_socket_urls, market_data_feedb_socket_urls, MAX_WS_RECONNECT_RETRIES, VALID_STREAM_TYPES, VALID_EXCHANGES, VALID_MARKET_DATA_TYPES, VALID_MARKET_DATA_SUBTYPES, REALTIME, B3, TRADES, INDICES, ALL, STOCKS, BOOKS, FEED_A, FEED_B, SETTLEMENTPRICES
|
|
6
6
|
from .websocket_default_functions import _on_open, _on_message, _on_error, _on_close
|
|
7
7
|
import websocket
|
|
8
8
|
import json
|
|
@@ -49,7 +49,7 @@ class MarketDataWebSocketClient:
|
|
|
49
49
|
|
|
50
50
|
data_type: str
|
|
51
51
|
Market Data type.
|
|
52
|
-
Options: 'trades', 'processed-trades', 'books', 'indices', 'securities', 'stoploss', 'candles-1S', 'candles-1M', 'instrument_status'.
|
|
52
|
+
Options: 'trades', 'processed-trades', 'books', 'indices', 'securities', 'stoploss', 'candles-1S', 'candles-1M', 'instrument_status', 'settlement-price'.
|
|
53
53
|
Field is not required. Default: 'trades'.
|
|
54
54
|
|
|
55
55
|
data_subtype: str
|
|
@@ -93,7 +93,7 @@ class MarketDataWebSocketClient:
|
|
|
93
93
|
self.__nro_reconnect_retries = 0
|
|
94
94
|
|
|
95
95
|
if data_subtype is None:
|
|
96
|
-
if exchange is B3 and data_type
|
|
96
|
+
if exchange is B3 and not data_type in [INDICES, SETTLEMENTPRICES]:
|
|
97
97
|
data_subtype = STOCKS
|
|
98
98
|
else:
|
|
99
99
|
data_subtype = ALL
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: btgsolutions-dataservices-python-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.15.0
|
|
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.13
|
|
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
|
|
23
10
|
|
|
24
11
|
# BTG Solutions - Data Services
|
|
25
12
|
|
|
@@ -170,6 +157,21 @@ ws.run(on_message=lambda message: print(message))
|
|
|
170
157
|
ws.instrument_status('PETR4')
|
|
171
158
|
ws.instrument_status_history('PETR4')
|
|
172
159
|
|
|
160
|
+
## The following is optional to keep the program running in a .py file:
|
|
161
|
+
# from time import sleep
|
|
162
|
+
# while True:
|
|
163
|
+
# sleep(1)
|
|
164
|
+
```
|
|
165
|
+
##### Settlement Price
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
import btgsolutions_dataservices as btg
|
|
169
|
+
ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='settlement-price', instruments=['ABEVOU25', 'WINV25'])
|
|
170
|
+
ws.run(on_message=lambda message: print(message))
|
|
171
|
+
|
|
172
|
+
## Getting the last event (settlement-price) of ABEVOU25:
|
|
173
|
+
# ws.get_last_event(['ABEVOU25'])
|
|
174
|
+
|
|
173
175
|
## The following is optional to keep the program running in a .py file:
|
|
174
176
|
# from time import sleep
|
|
175
177
|
# while True:
|
|
@@ -22,7 +22,7 @@ description = "Python package containing several classes and data for extracting
|
|
|
22
22
|
|
|
23
23
|
setup(
|
|
24
24
|
name='btgsolutions-dataservices-python-client',
|
|
25
|
-
version='2.
|
|
25
|
+
version='2.15.0',
|
|
26
26
|
description=description,
|
|
27
27
|
long_description=long_description,
|
|
28
28
|
long_description_content_type='text/markdown',
|
|
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
|