btgsolutions-dataservices-python-client 3.0.0__tar.gz → 3.1.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-3.0.0/btgsolutions_dataservices_python_client.egg-info → btgsolutions_dataservices_python_client-3.1.0}/PKG-INFO +6 -15
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/config.py +19 -19
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/public_sources.py +33 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0/btgsolutions_dataservices_python_client.egg-info}/PKG-INFO +7 -16
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/setup.py +1 -1
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/LICENSE +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/MANIFEST.in +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/README.md +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/exceptions.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/authenticator.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/bulk_data.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/company_data.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/corporate_events.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/hfn.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/historical_candles.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/intraday_candles.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/intraday_tick_data.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/quotes.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/reference_data.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/stock_loan.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/ticker_last_event.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/rest/ticker_last_event_polling.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/websocket/__init__.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/websocket/hfn_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/websocket/market_data_feed.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/websocket/market_data_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices/websocket/websocket_default_functions.py +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices_python_client.egg-info/SOURCES.txt +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices_python_client.egg-info/dependency_links.txt +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices_python_client.egg-info/requires.txt +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/btgsolutions_dataservices_python_client.egg-info/top_level.txt +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/pyproject.toml +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/requirements.txt +0 -0
- {btgsolutions_dataservices_python_client-3.0.0 → btgsolutions_dataservices_python_client-3.1.0}/setup.cfg +0 -0
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: btgsolutions_dataservices_python_client
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.1.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
|
+
License: UNKNOWN
|
|
8
|
+
Platform: UNKNOWN
|
|
7
9
|
Requires-Python: >=3.9,<3.14
|
|
8
10
|
Description-Content-Type: text/markdown
|
|
9
11
|
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
12
|
|
|
24
13
|
# BTG Solutions - Data Services
|
|
25
14
|
|
|
@@ -480,3 +469,5 @@ ref = btg.ReferenceData(api_key='YOUR_API_KEY')
|
|
|
480
469
|
ref.ticker_reference(tickers=['VALE3','PETR4'])
|
|
481
470
|
```
|
|
482
471
|
|
|
472
|
+
|
|
473
|
+
|
|
@@ -58,33 +58,33 @@ market_data_socket_urls = {
|
|
|
58
58
|
B3: {
|
|
59
59
|
TRADES: {
|
|
60
60
|
REALTIME: {
|
|
61
|
-
STOCKS: f'{
|
|
62
|
-
OPTIONS: f'{
|
|
63
|
-
DERIVATIVES: f'{
|
|
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}',
|
|
64
64
|
},
|
|
65
65
|
DELAYED: {
|
|
66
|
-
STOCKS: f'{
|
|
67
|
-
OPTIONS: f'{
|
|
68
|
-
DERIVATIVES: f"{
|
|
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}",
|
|
69
69
|
},
|
|
70
70
|
},
|
|
71
71
|
PROCESSEDTRADES: {
|
|
72
72
|
REALTIME: {
|
|
73
|
-
STOCKS: f'{
|
|
74
|
-
OPTIONS: f'{
|
|
75
|
-
DERIVATIVES: f'{
|
|
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}',
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
BOOKS: {
|
|
79
79
|
REALTIME: {
|
|
80
|
-
STOCKS: f'{
|
|
81
|
-
OPTIONS: f'{
|
|
82
|
-
DERIVATIVES: f'{
|
|
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}',
|
|
83
83
|
},
|
|
84
84
|
THROTTLE: {
|
|
85
|
-
STOCKS: f"{
|
|
86
|
-
OPTIONS: f"{
|
|
87
|
-
DERIVATIVES: f"{
|
|
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}",
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
INDICES: {
|
|
@@ -97,14 +97,14 @@ market_data_socket_urls = {
|
|
|
97
97
|
},
|
|
98
98
|
INSTRUMENTSTATUS: {
|
|
99
99
|
REALTIME: {
|
|
100
|
-
STOCKS: f"{
|
|
101
|
-
DERIVATIVES: f"{
|
|
102
|
-
OPTIONS: f"{
|
|
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}",
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
SETTLEMENTPRICES: {
|
|
106
106
|
REALTIME: {
|
|
107
|
-
ALL: f"{
|
|
107
|
+
ALL: f"{base_url}{ws_br_b3_base_path}{SETTLEMENTPRICES}",
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
},
|
|
@@ -61,6 +61,39 @@ class PublicSources:
|
|
|
61
61
|
|
|
62
62
|
url = f"{url_api_v1}/public-sources/opas?start_date={start_date}&end_date={end_date}" + (f"&asset={asset}" if asset else "") + (f"&type={type}" if type else "")
|
|
63
63
|
|
|
64
|
+
response = requests.request("GET", url, headers=self.headers)
|
|
65
|
+
if response.status_code == 200:
|
|
66
|
+
if raw_data:
|
|
67
|
+
return response.json()
|
|
68
|
+
else:
|
|
69
|
+
return pd.DataFrame(response.json())
|
|
70
|
+
else:
|
|
71
|
+
response = json.loads(response.text)
|
|
72
|
+
raise BadResponse(f'Error: {response.get("error", "")}')
|
|
73
|
+
|
|
74
|
+
def get_share_repurchase(self, start_date:str, end_date:str, asset:Optional[str]=None, raw_data:bool=False):
|
|
75
|
+
|
|
76
|
+
"""
|
|
77
|
+
This method returns a list of share repurchase transactions filtered by period (reference_date) and/or asset.
|
|
78
|
+
|
|
79
|
+
Parameters
|
|
80
|
+
----------------
|
|
81
|
+
start_date: string<date>
|
|
82
|
+
Lower bound. Filtering by reference_date. Format: "YYYY-MM-DD".
|
|
83
|
+
Field is required. Example: '2023-10-06'.
|
|
84
|
+
end_date: string<date>
|
|
85
|
+
Upper bound. Filtering by reference_date. Format: "YYYY-MM-DD".
|
|
86
|
+
Field is required. Example: '2023-10-06'.
|
|
87
|
+
asset: str
|
|
88
|
+
Ticker asset.
|
|
89
|
+
Field is not required. Example: VALE. Default: None.
|
|
90
|
+
raw_data: bool
|
|
91
|
+
If false, returns data in a dataframe. If true, returns raw data.
|
|
92
|
+
Field is not required. Default: False.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
url = f"{url_api_v1}/public-sources/share-repurchase?start_date={start_date}&end_date={end_date}" + (f"&asset={asset}" if asset else "")
|
|
96
|
+
|
|
64
97
|
response = requests.request("GET", url, headers=self.headers)
|
|
65
98
|
if response.status_code == 200:
|
|
66
99
|
if raw_data:
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 3.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: btgsolutions-dataservices-python-client
|
|
3
|
+
Version: 3.1.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
|
+
License: UNKNOWN
|
|
8
|
+
Platform: UNKNOWN
|
|
7
9
|
Requires-Python: >=3.9,<3.14
|
|
8
10
|
Description-Content-Type: text/markdown
|
|
9
11
|
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
12
|
|
|
24
13
|
# BTG Solutions - Data Services
|
|
25
14
|
|
|
@@ -480,3 +469,5 @@ ref = btg.ReferenceData(api_key='YOUR_API_KEY')
|
|
|
480
469
|
ref.ticker_reference(tickers=['VALE3','PETR4'])
|
|
481
470
|
```
|
|
482
471
|
|
|
472
|
+
|
|
473
|
+
|
|
@@ -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.
|
|
25
|
+
version='3.1.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
|