btgsolutions-dataservices-python-client 2.4.2__tar.gz → 2.5.2__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.4.2/btgsolutions_dataservices_python_client.egg-info → btgsolutions-dataservices-python-client-2.5.2}/PKG-INFO +1 -1
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/intraday_tick_data.py +13 -1
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/websocket/market_data_websocket_client.py +8 -1
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2/btgsolutions_dataservices_python_client.egg-info}/PKG-INFO +1 -1
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices_python_client.egg-info/SOURCES.txt +0 -1
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/setup.py +1 -1
- btgsolutions-dataservices-python-client-2.4.2/LICENSE +0 -19
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/MANIFEST.in +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/README.md +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/__init__.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/config.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/exceptions.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/__init__.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/authenticator.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/bulk_data.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/company_data.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/corporate_events.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/hfn.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/historical_candles.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/intraday_candles.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/public_sources.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/quotes.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/rest/ticker_last_event.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/websocket/__init__.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/websocket/hfn_websocket_client.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices/websocket/websocket_default_functions.py +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices_python_client.egg-info/dependency_links.txt +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices_python_client.egg-info/requires.txt +3 -3
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/btgsolutions_dataservices_python_client.egg-info/top_level.txt +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/pyproject.toml +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/requirements.txt +0 -0
- {btgsolutions-dataservices-python-client-2.4.2 → btgsolutions-dataservices-python-client-2.5.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: btgsolutions-dataservices-python-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.2
|
|
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
|
|
@@ -36,7 +36,7 @@ class IntradayTickData:
|
|
|
36
36
|
self.token = Authenticator(self.api_key).token
|
|
37
37
|
self.headers = {"authorization": f"authorization {self.token}"}
|
|
38
38
|
|
|
39
|
-
def get_trades(self, ticker:str, raw_data:bool=False):
|
|
39
|
+
def get_trades(self, ticker:str, start:str=None, end:str=None, raw_data:bool=False):
|
|
40
40
|
|
|
41
41
|
"""
|
|
42
42
|
This method provides tick-by-tick trade data from the current day, for the provided ticker.
|
|
@@ -46,11 +46,23 @@ class IntradayTickData:
|
|
|
46
46
|
ticker: str
|
|
47
47
|
Ticker symbol.
|
|
48
48
|
Field is required. Example: 'PETR4'.
|
|
49
|
+
start: str
|
|
50
|
+
Query start datetime, in ISO string format (UTC).
|
|
51
|
+
Field is required. Examples: '2025-02-11', '2025-02-11T17:40:00.000Z'.
|
|
52
|
+
end: str
|
|
53
|
+
Query end datetime, in ISO string format (UTC).
|
|
54
|
+
Field is required. Examples: '2025-02-12', '2025-02-11T18:10:00.000Z'.
|
|
49
55
|
raw_data: bool
|
|
50
56
|
If false, returns data in a dataframe. If true, returns raw data.
|
|
51
57
|
Field is not required. Default: False.
|
|
52
58
|
"""
|
|
53
59
|
url = f"{url_api_v1}/marketdata/tick/intraday/trades/{ticker}"
|
|
60
|
+
if isinstance(start, str) and isinstance(end, str):
|
|
61
|
+
url += f'?start={start}&end={end}'
|
|
62
|
+
elif isinstance(start, str):
|
|
63
|
+
url += f'?start={start}'
|
|
64
|
+
elif isinstance(end, str):
|
|
65
|
+
url += f'?end={end}'
|
|
54
66
|
|
|
55
67
|
response = requests.request("GET", url, headers=self.headers)
|
|
56
68
|
if response.status_code == 200:
|
|
@@ -123,6 +123,7 @@ class MarketDataWebSocketClient:
|
|
|
123
123
|
on_close=None,
|
|
124
124
|
reconnect=True,
|
|
125
125
|
spawn_thread:bool=True,
|
|
126
|
+
default_logs:bool=True,
|
|
126
127
|
):
|
|
127
128
|
"""
|
|
128
129
|
Initializes a connection to websocket and subscribes to the instruments, if it was passed in the class initialization.
|
|
@@ -163,6 +164,10 @@ class MarketDataWebSocketClient:
|
|
|
163
164
|
Spawn a new thread for incoming server messages (on_message callback function)
|
|
164
165
|
Field is not required.
|
|
165
166
|
Default: True.
|
|
167
|
+
default_logs: bool
|
|
168
|
+
Default non-required logs, detailing messages sent from the client to the WebSocket server.
|
|
169
|
+
Field is not required.
|
|
170
|
+
Default: True.
|
|
166
171
|
"""
|
|
167
172
|
if on_open is None:
|
|
168
173
|
on_open = _on_open
|
|
@@ -172,6 +177,7 @@ class MarketDataWebSocketClient:
|
|
|
172
177
|
on_error = _on_error
|
|
173
178
|
if on_close is None:
|
|
174
179
|
on_close = _on_close
|
|
180
|
+
self.default_logs = default_logs if default_logs is True else False
|
|
175
181
|
|
|
176
182
|
def intermediary_on_open(ws):
|
|
177
183
|
on_open()
|
|
@@ -236,7 +242,8 @@ class MarketDataWebSocketClient:
|
|
|
236
242
|
"""
|
|
237
243
|
if not isinstance(data, str):
|
|
238
244
|
data = json.dumps(data)
|
|
239
|
-
|
|
245
|
+
if self.default_logs:
|
|
246
|
+
print(f'Sending data: {data}')
|
|
240
247
|
return self.ws.send(data)
|
|
241
248
|
|
|
242
249
|
def close(self):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: btgsolutions-dataservices-python-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.2
|
|
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
|
|
@@ -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.5.2',
|
|
26
26
|
description=description,
|
|
27
27
|
long_description=long_description,
|
|
28
28
|
long_description_content_type='text/markdown',
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2022 BTG Solutions
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
in the Software without restriction, including without limitation the rights
|
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
|
11
|
-
copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
-
SOFTWARE.
|
|
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
|