btgsolutions-dataservices-python-client 3.2.0__tar.gz → 3.2.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.
Files changed (36) hide show
  1. {btgsolutions_dataservices_python_client-3.2.0/btgsolutions_dataservices_python_client.egg-info → btgsolutions_dataservices_python_client-3.2.1}/PKG-INFO +4 -31
  2. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/README.md +3 -30
  3. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/config.py +20 -19
  4. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/intraday_candles.py +2 -2
  5. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/reference_data.py +1 -1
  6. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1/btgsolutions_dataservices_python_client.egg-info}/PKG-INFO +4 -31
  7. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/setup.py +1 -1
  8. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/LICENSE +0 -0
  9. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/MANIFEST.in +0 -0
  10. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/__init__.py +0 -0
  11. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/exceptions.py +0 -0
  12. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/__init__.py +0 -0
  13. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/authenticator.py +0 -0
  14. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/bulk_data.py +0 -0
  15. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/company_data.py +0 -0
  16. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/corporate_events.py +0 -0
  17. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/hfn.py +0 -0
  18. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/historical_candles.py +0 -0
  19. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/intraday_tick_data.py +0 -0
  20. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/public_sources.py +0 -0
  21. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/quotes.py +0 -0
  22. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/stock_loan.py +0 -0
  23. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/ticker_last_event.py +0 -0
  24. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/rest/ticker_last_event_polling.py +0 -0
  25. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/websocket/__init__.py +0 -0
  26. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/websocket/hfn_websocket_client.py +0 -0
  27. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/websocket/market_data_feed.py +0 -0
  28. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/websocket/market_data_websocket_client.py +0 -0
  29. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices/websocket/websocket_default_functions.py +0 -0
  30. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices_python_client.egg-info/SOURCES.txt +0 -0
  31. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices_python_client.egg-info/dependency_links.txt +0 -0
  32. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices_python_client.egg-info/requires.txt +0 -0
  33. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/btgsolutions_dataservices_python_client.egg-info/top_level.txt +0 -0
  34. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/pyproject.toml +0 -0
  35. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/requirements.txt +0 -0
  36. {btgsolutions_dataservices_python_client-3.2.0 → btgsolutions_dataservices_python_client-3.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: btgsolutions_dataservices_python_client
3
- Version: 3.2.0
3
+ Version: 3.2.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
@@ -109,11 +109,11 @@ ws.run(on_message=lambda message: print(message))
109
109
  # sleep(1)
110
110
  ```
111
111
 
112
- ##### Trades, throttle (1 second throttle)
112
+ ##### Books, throttle (1 second throttle)
113
113
 
114
114
  ```python
115
115
  import btgsolutions_dataservices as btg
116
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='trades', stream_type='throttle', instruments=['PETR4', 'VALE3'])
116
+ ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='books', stream_type='throttle', instruments=['PETR4', 'VALE3'])
117
117
  ws.run(on_message=lambda message: print(message))
118
118
 
119
119
  ## The following is optional to keep the program running in a .py file:
@@ -149,19 +149,6 @@ ws.run(on_message=lambda message: print(message))
149
149
  # sleep(1)
150
150
  ```
151
151
 
152
- ##### Security List
153
-
154
- ```python
155
- import btgsolutions_dataservices as btg
156
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='securities', data_subtype='derivatives')
157
- ws.run(on_message=lambda message: print(message))
158
-
159
- ## The following is optional to keep the program running in a .py file:
160
- # from time import sleep
161
- # while True:
162
- # sleep(1)
163
- ```
164
-
165
152
  ##### Security Status
166
153
 
167
154
  ```python
@@ -192,20 +179,6 @@ ws.run(on_message=lambda message: print(message))
192
179
  # sleep(1)
193
180
  ```
194
181
 
195
- ##### Candles (1 second candles)
196
-
197
- ```python
198
- import btgsolutions_dataservices as btg
199
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='candles-1S', stream_type='realtime')
200
- ws.run(on_message=lambda message: print(message))
201
- ws.candle_subscribe(list_instruments=['PETR4','VALE3'], candle_type='partial')
202
-
203
- ## The following is optional to keep the program running in a .py file:
204
- # from time import sleep
205
- # while True:
206
- # sleep(1)
207
- ```
208
-
209
182
  #### Intraday Candles
210
183
 
211
184
  ```python
@@ -243,7 +216,7 @@ last_event.get_trades(data_type='equities', ticker='VALE3')
243
216
  ```python
244
217
  import btgsolutions_dataservices as btg
245
218
  last_event = btg.TickerLastEvent(api_key='YOUR_API_KEY')
246
- last_event.get_tobs(data_type='stocks')
219
+ last_event.get_tobs(data_type='equities')
247
220
  ```
248
221
 
249
222
  #### Ticker Last Trading Status
@@ -86,11 +86,11 @@ ws.run(on_message=lambda message: print(message))
86
86
  # sleep(1)
87
87
  ```
88
88
 
89
- ##### Trades, throttle (1 second throttle)
89
+ ##### Books, throttle (1 second throttle)
90
90
 
91
91
  ```python
92
92
  import btgsolutions_dataservices as btg
93
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='trades', stream_type='throttle', instruments=['PETR4', 'VALE3'])
93
+ ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='books', stream_type='throttle', instruments=['PETR4', 'VALE3'])
94
94
  ws.run(on_message=lambda message: print(message))
95
95
 
96
96
  ## The following is optional to keep the program running in a .py file:
@@ -126,19 +126,6 @@ ws.run(on_message=lambda message: print(message))
126
126
  # sleep(1)
127
127
  ```
128
128
 
129
- ##### Security List
130
-
131
- ```python
132
- import btgsolutions_dataservices as btg
133
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='securities', data_subtype='derivatives')
134
- ws.run(on_message=lambda message: print(message))
135
-
136
- ## The following is optional to keep the program running in a .py file:
137
- # from time import sleep
138
- # while True:
139
- # sleep(1)
140
- ```
141
-
142
129
  ##### Security Status
143
130
 
144
131
  ```python
@@ -169,20 +156,6 @@ ws.run(on_message=lambda message: print(message))
169
156
  # sleep(1)
170
157
  ```
171
158
 
172
- ##### Candles (1 second candles)
173
-
174
- ```python
175
- import btgsolutions_dataservices as btg
176
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='candles-1S', stream_type='realtime')
177
- ws.run(on_message=lambda message: print(message))
178
- ws.candle_subscribe(list_instruments=['PETR4','VALE3'], candle_type='partial')
179
-
180
- ## The following is optional to keep the program running in a .py file:
181
- # from time import sleep
182
- # while True:
183
- # sleep(1)
184
- ```
185
-
186
159
  #### Intraday Candles
187
160
 
188
161
  ```python
@@ -220,7 +193,7 @@ last_event.get_trades(data_type='equities', ticker='VALE3')
220
193
  ```python
221
194
  import btgsolutions_dataservices as btg
222
195
  last_event = btg.TickerLastEvent(api_key='YOUR_API_KEY')
223
- last_event.get_tobs(data_type='stocks')
196
+ last_event.get_tobs(data_type='equities')
224
197
  ```
225
198
 
226
199
  #### Ticker Last Trading Status
@@ -1,4 +1,5 @@
1
1
  base_url = "https://dataservices.btgpactualsolutions.com"
2
+ base_url_ws = "wss://dataservices.btgpactualsolutions.com"
2
3
 
3
4
  # WS
4
5
  url_ws = "wss://dataservices.btgpactualsolutions.com/stream/"
@@ -58,33 +59,33 @@ market_data_socket_urls = {
58
59
  B3: {
59
60
  TRADES: {
60
61
  REALTIME: {
61
- STOCKS: f'{base_url}{ws_br_b3_base_path}trade/{STOCKS}',
62
- OPTIONS: f'{base_url}{ws_br_b3_base_path}trade/{OPTIONS}',
63
- DERIVATIVES: f'{base_url}{ws_br_b3_base_path}trade/{DERIVATIVES}',
62
+ STOCKS: f'{base_url_ws}{ws_br_b3_base_path}trade/{STOCKS}',
63
+ OPTIONS: f'{base_url_ws}{ws_br_b3_base_path}trade/{OPTIONS}',
64
+ DERIVATIVES: f'{base_url_ws}{ws_br_b3_base_path}trade/{DERIVATIVES}',
64
65
  },
65
66
  DELAYED: {
66
- STOCKS: f'{base_url}{ws_br_b3_base_path}{DELAYED}/trade/{STOCKS}/{DELAYED}',
67
- OPTIONS: f'{base_url}{ws_br_b3_base_path}{DELAYED}/trade/{OPTIONS}/{DELAYED}',
68
- DERIVATIVES: f"{base_url}{ws_br_b3_base_path}{DELAYED}/trade/{DERIVATIVES}/{DELAYED}",
67
+ STOCKS: f'{base_url_ws}{ws_br_b3_base_path}{DELAYED}/trade/{STOCKS}/{DELAYED}',
68
+ OPTIONS: f'{base_url_ws}{ws_br_b3_base_path}{DELAYED}/trade/{OPTIONS}/{DELAYED}',
69
+ DERIVATIVES: f"{base_url_ws}{ws_br_b3_base_path}{DELAYED}/trade/{DERIVATIVES}/{DELAYED}",
69
70
  },
70
71
  },
71
72
  PROCESSEDTRADES: {
72
73
  REALTIME: {
73
- STOCKS: f'{base_url}{ws_br_b3_base_path}{PROCESSED}-trade/{STOCKS}',
74
- OPTIONS: f'{base_url}{ws_br_b3_base_path}{PROCESSED}-trade/{OPTIONS}',
75
- DERIVATIVES: f'{base_url}{ws_br_b3_base_path}{PROCESSED}-trade/{DERIVATIVES}',
74
+ STOCKS: f'{base_url_ws}{ws_br_b3_base_path}{PROCESSED}-trade/{STOCKS}',
75
+ OPTIONS: f'{base_url_ws}{ws_br_b3_base_path}{PROCESSED}-trade/{OPTIONS}',
76
+ DERIVATIVES: f'{base_url_ws}{ws_br_b3_base_path}{PROCESSED}-trade/{DERIVATIVES}',
76
77
  },
77
78
  },
78
79
  BOOKS: {
79
80
  REALTIME: {
80
- STOCKS: f'{base_url}{ws_br_b3_base_path}book-snapshot-mbp/{STOCKS}',
81
- OPTIONS: f'{base_url}{ws_br_b3_base_path}book-snapshot-mbp/{OPTIONS}',
82
- DERIVATIVES: f'{base_url}{ws_br_b3_base_path}book-snapshot-mbp/{DERIVATIVES}',
81
+ STOCKS: f'{base_url_ws}{ws_br_b3_base_path}book-snapshot-mbp/{STOCKS}',
82
+ OPTIONS: f'{base_url_ws}{ws_br_b3_base_path}book-snapshot-mbp/{OPTIONS}',
83
+ DERIVATIVES: f'{base_url_ws}{ws_br_b3_base_path}book-snapshot-mbp/{DERIVATIVES}',
83
84
  },
84
85
  THROTTLE: {
85
- STOCKS: f"{base_url}{ws_br_b3_base_path}throttled/book-snapshot-mbp/{STOCKS}",
86
- OPTIONS: f"{base_url}{ws_br_b3_base_path}throttled/book-snapshot-mbp/{OPTIONS}",
87
- DERIVATIVES: f"{base_url}{ws_br_b3_base_path}throttled/book-snapshot-mbp/{DERIVATIVES}",
86
+ STOCKS: f"{base_url_ws}{ws_br_b3_base_path}throttled/book-snapshot-mbp/{STOCKS}",
87
+ OPTIONS: f"{base_url_ws}{ws_br_b3_base_path}throttled/book-snapshot-mbp/{OPTIONS}",
88
+ DERIVATIVES: f"{base_url_ws}{ws_br_b3_base_path}throttled/book-snapshot-mbp/{DERIVATIVES}",
88
89
  },
89
90
  },
90
91
  INDICES: {
@@ -97,14 +98,14 @@ market_data_socket_urls = {
97
98
  },
98
99
  INSTRUMENTSTATUS: {
99
100
  REALTIME: {
100
- STOCKS: f"{base_url}{ws_br_b3_base_path}instrument-status/{STOCKS}",
101
- DERIVATIVES: f"{base_url}{ws_br_b3_base_path}instrument-status/{DERIVATIVES}",
102
- OPTIONS: f"{base_url}{ws_br_b3_base_path}instrument-status/{OPTIONS}",
101
+ STOCKS: f"{base_url_ws}{ws_br_b3_base_path}instrument-status/{STOCKS}",
102
+ DERIVATIVES: f"{base_url_ws}{ws_br_b3_base_path}instrument-status/{DERIVATIVES}",
103
+ OPTIONS: f"{base_url_ws}{ws_br_b3_base_path}instrument-status/{OPTIONS}",
103
104
  }
104
105
  },
105
106
  SETTLEMENTPRICES: {
106
107
  REALTIME: {
107
- ALL: f"{base_url}{ws_br_b3_base_path}{SETTLEMENTPRICES}",
108
+ ALL: f"{base_url_ws}{ws_br_b3_base_path}{SETTLEMENTPRICES}/stocks",
108
109
  }
109
110
  }
110
111
  },
@@ -111,7 +111,7 @@ class IntradayCandles:
111
111
 
112
112
  tickers = ','.join(tickers) if type(tickers) is list else tickers
113
113
 
114
- url = f"{base_url}/v1/marketdata/br/b3/{delay}/intraday-candles/{market_type}?tickers={tickers}&candle_period={candle_period}&mode={mode}&timezone={timezone}"
114
+ url = f"{base_url}/api/v1/marketdata/br/b3/{delay}/intraday-candles/{market_type}?tickers={tickers}&candle_period={candle_period}&mode={mode}&timezone={timezone}"
115
115
 
116
116
  if start: url += f'&start={start}'
117
117
 
@@ -153,7 +153,7 @@ class IntradayCandles:
153
153
 
154
154
  if delay not in ['delayed', 'realtime']: raise DelayError(f"Must provide a valid 'delay' parameter. Input: '{delay}'. Accepted values: 'delayed' or 'realtime'.")
155
155
 
156
- url = f"{base_url}/v1/marketdata/br/b3/{delay}/intraday-candles/{market_type}/available_tickers"
156
+ url = f"{base_url}/api/v1/marketdata/br/b3/{delay}/intraday-candles/{market_type}/available_tickers"
157
157
 
158
158
  response = requests.request("GET", url, headers=self.headers)
159
159
  if response.status_code == 200: return json.loads(response.text)
@@ -58,7 +58,7 @@ class ReferenceData:
58
58
  if raw_data:
59
59
  return response.json()
60
60
  else:
61
- return pd.DataFrame(response.json().values())
61
+ return pd.DataFrame(response.json())
62
62
  else:
63
63
  response = json.loads(response.text)
64
64
  raise BadResponse(f'Error: {response.get("ApiClientError", "")}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: btgsolutions_dataservices_python_client
3
- Version: 3.2.0
3
+ Version: 3.2.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
@@ -109,11 +109,11 @@ ws.run(on_message=lambda message: print(message))
109
109
  # sleep(1)
110
110
  ```
111
111
 
112
- ##### Trades, throttle (1 second throttle)
112
+ ##### Books, throttle (1 second throttle)
113
113
 
114
114
  ```python
115
115
  import btgsolutions_dataservices as btg
116
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='trades', stream_type='throttle', instruments=['PETR4', 'VALE3'])
116
+ ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='books', stream_type='throttle', instruments=['PETR4', 'VALE3'])
117
117
  ws.run(on_message=lambda message: print(message))
118
118
 
119
119
  ## The following is optional to keep the program running in a .py file:
@@ -149,19 +149,6 @@ ws.run(on_message=lambda message: print(message))
149
149
  # sleep(1)
150
150
  ```
151
151
 
152
- ##### Security List
153
-
154
- ```python
155
- import btgsolutions_dataservices as btg
156
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='securities', data_subtype='derivatives')
157
- ws.run(on_message=lambda message: print(message))
158
-
159
- ## The following is optional to keep the program running in a .py file:
160
- # from time import sleep
161
- # while True:
162
- # sleep(1)
163
- ```
164
-
165
152
  ##### Security Status
166
153
 
167
154
  ```python
@@ -192,20 +179,6 @@ ws.run(on_message=lambda message: print(message))
192
179
  # sleep(1)
193
180
  ```
194
181
 
195
- ##### Candles (1 second candles)
196
-
197
- ```python
198
- import btgsolutions_dataservices as btg
199
- ws = btg.MarketDataWebSocketClient(api_key='YOUR_API_KEY', data_type='candles-1S', stream_type='realtime')
200
- ws.run(on_message=lambda message: print(message))
201
- ws.candle_subscribe(list_instruments=['PETR4','VALE3'], candle_type='partial')
202
-
203
- ## The following is optional to keep the program running in a .py file:
204
- # from time import sleep
205
- # while True:
206
- # sleep(1)
207
- ```
208
-
209
182
  #### Intraday Candles
210
183
 
211
184
  ```python
@@ -243,7 +216,7 @@ last_event.get_trades(data_type='equities', ticker='VALE3')
243
216
  ```python
244
217
  import btgsolutions_dataservices as btg
245
218
  last_event = btg.TickerLastEvent(api_key='YOUR_API_KEY')
246
- last_event.get_tobs(data_type='stocks')
219
+ last_event.get_tobs(data_type='equities')
247
220
  ```
248
221
 
249
222
  #### Ticker Last Trading Status
@@ -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='3.2.0',
25
+ version='3.2.1',
26
26
  description=description,
27
27
  long_description=long_description,
28
28
  long_description_content_type='text/markdown',