btgsolutions-dataservices-python-client 2.17.1__tar.gz → 2.18.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.17.1 → btgsolutions_dataservices_python_client-2.18.0}/PKG-INFO +5 -16
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/README.md +2 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/ticker_last_event_polling.py +21 -6
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices_python_client.egg-info/PKG-INFO +4 -15
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/setup.py +2 -2
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/LICENSE +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/MANIFEST.in +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/config.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/exceptions.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/authenticator.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/bulk_data.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/company_data.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/corporate_events.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/hfn.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/historical_candles.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/intraday_candles.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/intraday_tick_data.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/public_sources.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/quotes.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/reference_data.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/stock_loan.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/rest/ticker_last_event.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/websocket/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/websocket/hfn_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/websocket/market_data_feed.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/websocket/market_data_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices/websocket/websocket_default_functions.py +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices_python_client.egg-info/SOURCES.txt +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices_python_client.egg-info/dependency_links.txt +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices_python_client.egg-info/requires.txt +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/btgsolutions_dataservices_python_client.egg-info/top_level.txt +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/pyproject.toml +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/requirements.txt +0 -0
- {btgsolutions_dataservices_python_client-2.17.1 → btgsolutions_dataservices_python_client-2.18.0}/setup.cfg +0 -0
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: btgsolutions_dataservices_python_client
|
|
3
|
+
Version: 2.18.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.14
|
|
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
|
|
|
26
13
|
Real time and historical Financial Market Data, News, Corporate Events and more.
|
|
14
|
+
More information at https://dataservices.btgpactualsolutions.com/.
|
|
27
15
|
|
|
28
16
|
## Installation
|
|
29
17
|
|
|
@@ -478,3 +466,4 @@ import btgsolutions_dataservices as btg
|
|
|
478
466
|
ref = btg.ReferenceData(api_key='YOUR_API_KEY')
|
|
479
467
|
ref.ticker_reference(tickers=['VALE3','PETR4'])
|
|
480
468
|
```
|
|
469
|
+
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# BTG Solutions - Data Services
|
|
2
2
|
|
|
3
3
|
Real time and historical Financial Market Data, News, Corporate Events and more.
|
|
4
|
+
More information at https://dataservices.btgpactualsolutions.com/.
|
|
4
5
|
|
|
5
6
|
## Installation
|
|
6
7
|
|
|
@@ -455,3 +456,4 @@ import btgsolutions_dataservices as btg
|
|
|
455
456
|
ref = btg.ReferenceData(api_key='YOUR_API_KEY')
|
|
456
457
|
ref.ticker_reference(tickers=['VALE3','PETR4'])
|
|
457
458
|
```
|
|
459
|
+
|
|
@@ -33,11 +33,11 @@ class TickerLastEventPolling:
|
|
|
33
33
|
Field is required.
|
|
34
34
|
data_type: str
|
|
35
35
|
Market Data type.
|
|
36
|
-
Options: 'top-of-books'
|
|
36
|
+
Options: 'top-of-books', 'snapshot-tob'.
|
|
37
37
|
Field is required.
|
|
38
38
|
data_subtype: str
|
|
39
39
|
Market Data subtype.
|
|
40
|
-
Options: 'stocks', 'options', 'derivatives'.
|
|
40
|
+
Options: 'stocks', 'options', 'derivatives', 'equities'.
|
|
41
41
|
Field is required.
|
|
42
42
|
"""
|
|
43
43
|
def __init__(
|
|
@@ -45,24 +45,33 @@ class TickerLastEventPolling:
|
|
|
45
45
|
api_key:Optional[str],
|
|
46
46
|
data_type: str,
|
|
47
47
|
data_subtype: str,
|
|
48
|
-
interval_seconds: float
|
|
48
|
+
interval_seconds: Optional[float]=None
|
|
49
49
|
):
|
|
50
50
|
self.api_key = api_key
|
|
51
51
|
self.authenticator = Authenticator(self.api_key)
|
|
52
|
-
self.interval_seconds = interval_seconds
|
|
53
52
|
self.data_type = data_type
|
|
54
53
|
|
|
55
54
|
self._last_request_datetime = None
|
|
56
55
|
self._cache = {}
|
|
57
56
|
|
|
58
57
|
self._available_data_types = {
|
|
59
|
-
"top-of-books": ['stocks', 'derivatives', 'options']
|
|
58
|
+
"top-of-books": ['stocks', 'derivatives', 'options'],
|
|
59
|
+
"snapshot-tob": ['equities', 'derivatives']
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
self._default_interval_seconds = {
|
|
63
|
+
"top-of-books": 1,
|
|
64
|
+
"snapshot-tob": 10
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
self._available_url = {
|
|
63
68
|
"top-of-books": {
|
|
64
69
|
"data": f"{url_api_v1}/marketdata/last-event/books/top/{data_subtype}/batch",
|
|
65
70
|
"available": f"{url_api_v1}/marketdata/last-event/books/{data_subtype}/availables"
|
|
71
|
+
},
|
|
72
|
+
"snapshot-tob": {
|
|
73
|
+
"data": f"{url_api_v1}/marketdata/br/b3/snapshot/book/tob/{data_subtype}/batch",
|
|
74
|
+
"available": f"{url_api_v1}/marketdata/br/b3/snapshot/book/tob/{data_subtype}/available-tickers"
|
|
66
75
|
}
|
|
67
76
|
}
|
|
68
77
|
|
|
@@ -72,6 +81,12 @@ class TickerLastEventPolling:
|
|
|
72
81
|
if data_subtype not in self._available_data_types[data_type]:
|
|
73
82
|
raise Exception(f"Must provide a valid data_subtype. Valid data subtypes are: {self._available_data_types[data_type]}")
|
|
74
83
|
|
|
84
|
+
|
|
85
|
+
if interval_seconds is None:
|
|
86
|
+
self.interval_seconds = self._default_interval_seconds[data_type]
|
|
87
|
+
else:
|
|
88
|
+
self.interval_seconds = interval_seconds
|
|
89
|
+
|
|
75
90
|
self.url = self._available_url[self.data_type]["data"]
|
|
76
91
|
|
|
77
92
|
self._update_data()
|
|
@@ -96,7 +111,7 @@ class TickerLastEventPolling:
|
|
|
96
111
|
request_datetime = datetime.now(timezone.utc)
|
|
97
112
|
|
|
98
113
|
response = requests.request("GET", url, headers={"authorization": f"Bearer {self.authenticator.token}"})
|
|
99
|
-
|
|
114
|
+
|
|
100
115
|
if response.status_code != 200:
|
|
101
116
|
return
|
|
102
117
|
|
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: btgsolutions-dataservices-python-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.18.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.14
|
|
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
|
|
|
26
13
|
Real time and historical Financial Market Data, News, Corporate Events and more.
|
|
14
|
+
More information at https://dataservices.btgpactualsolutions.com/.
|
|
27
15
|
|
|
28
16
|
## Installation
|
|
29
17
|
|
|
@@ -478,3 +466,4 @@ import btgsolutions_dataservices as btg
|
|
|
478
466
|
ref = btg.ReferenceData(api_key='YOUR_API_KEY')
|
|
479
467
|
ref.ticker_reference(tickers=['VALE3','PETR4'])
|
|
480
468
|
```
|
|
469
|
+
|
|
@@ -21,8 +21,8 @@ else:
|
|
|
21
21
|
description = "Python package containing several classes and data for extracting and manipulating market and trading data."
|
|
22
22
|
|
|
23
23
|
setup(
|
|
24
|
-
name='
|
|
25
|
-
version='2.
|
|
24
|
+
name='btgsolutions_dataservices_python_client',
|
|
25
|
+
version='2.18.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|