btgsolutions-dataservices-python-client 3.2.11__tar.gz → 3.3.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.2.11/btgsolutions_dataservices_python_client.egg-info → btgsolutions_dataservices_python_client-3.3.0}/PKG-INFO +164 -9
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/README.md +163 -8
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/__init__.py +1 -1
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/config.py +2 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/__init__.py +8 -0
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/rest/alternative_data_companies.py +577 -0
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/rest/alternative_data_funds.py +208 -0
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/rest/alternative_data_macro_markets.py +278 -0
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/rest/alternative_data_metadata.py +221 -0
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/rest/alternative_data_ownership.py +340 -0
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/rest/alternative_data_people.py +94 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/book_scope.py +31 -23
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/rest/broker_analytics.py +173 -0
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/rest/hfn_v3.py +340 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/historical_candles.py +66 -6
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/websocket/__init__.py +1 -0
- btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices/websocket/hfn_v3_websocket_client.py +321 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0/btgsolutions_dataservices_python_client.egg-info}/PKG-INFO +164 -9
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices_python_client.egg-info/SOURCES.txt +9 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/LICENSE +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/MANIFEST.in +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/exceptions.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/authenticator.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/broker_reference.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/bulk_data.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/company_data.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/corporate_events.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/hfn.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/historical_candles_crypto.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/intraday_candles.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/intraday_tick_data.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/public_sources.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/quotes.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/reference_data.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/stock_loan.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/ticker_last_event.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/rest/ticker_last_event_polling.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/websocket/broker_analytics.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/websocket/hfn_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/websocket/market_data_feed.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/websocket/market_data_websocket_client.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices/websocket/websocket_default_functions.py +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices_python_client.egg-info/dependency_links.txt +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices_python_client.egg-info/requires.txt +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/btgsolutions_dataservices_python_client.egg-info/top_level.txt +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/pyproject.toml +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/requirements.txt +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/setup.cfg +0 -0
- {btgsolutions_dataservices_python_client-3.2.11 → btgsolutions_dataservices_python_client-3.3.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: btgsolutions_dataservices_python_client
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.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
|
|
@@ -280,6 +280,14 @@ hist_candles = btg.HistoricalCandles(api_key='YOUR_API_KEY')
|
|
|
280
280
|
hist_candles.get_intraday_history_candles(ticker='PETR4', market_type='stocks', corporate_events_adj=True, date='2023-10-06', candle='1m', rmv_after_market=True, timezone='UTC', raw_data=False, round=True)
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
+
##### Interday Batch
|
|
284
|
+
|
|
285
|
+
```python
|
|
286
|
+
import btgsolutions_dataservices as btg
|
|
287
|
+
hist_candles = btg.HistoricalCandles(api_key='YOUR_API_KEY')
|
|
288
|
+
hist_candles.get_interday_history_candles_batch(market_type='stocks', tickers=['PETR4', 'VALE3'], start_date='2023-10-01', end_date='2023-10-13', corporate_events_adj=True, rmv_after_market=True, timezone='UTC', raw_data=False, round=True)
|
|
289
|
+
```
|
|
290
|
+
|
|
283
291
|
##### Available Tickers
|
|
284
292
|
|
|
285
293
|
```python
|
|
@@ -392,6 +400,51 @@ hfn = btg.HighFrequencyNews(api_key='YOUR_API_KEY')
|
|
|
392
400
|
hfn.latest_news()
|
|
393
401
|
```
|
|
394
402
|
|
|
403
|
+
#### High Frequency News V3 Stream
|
|
404
|
+
|
|
405
|
+
```python
|
|
406
|
+
import btgsolutions_dataservices as btg
|
|
407
|
+
ws = btg.HFNV3WebSocketClient(api_key='YOUR_API_KEY')
|
|
408
|
+
ws.run(on_message=lambda message: print(message))
|
|
409
|
+
|
|
410
|
+
# Subscribe to live economy news in Portuguese
|
|
411
|
+
ws.subscribe(settings={'feed': 'economy', 'text_language': 'portuguese'})
|
|
412
|
+
|
|
413
|
+
# Request latest news on demand (without subscribing to the live stream)
|
|
414
|
+
ws.latest_news(settings={'feed': 'crypto', 'limit': '10'})
|
|
415
|
+
|
|
416
|
+
# Get available filter values
|
|
417
|
+
ws.available_filters(settings={})
|
|
418
|
+
|
|
419
|
+
# Stop receiving broadcasts (keeps connection open)
|
|
420
|
+
ws.unsubscribe()
|
|
421
|
+
|
|
422
|
+
ws.close()
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
#### High Frequency News V3
|
|
426
|
+
|
|
427
|
+
```python
|
|
428
|
+
import btgsolutions_dataservices as btg
|
|
429
|
+
hfn = btg.HighFrequencyNewsV3(api_key='YOUR_API_KEY')
|
|
430
|
+
|
|
431
|
+
# Latest news with filters
|
|
432
|
+
hfn.get_latest_news(feed='economy', text_language='portuguese', limit=10)
|
|
433
|
+
|
|
434
|
+
# Latest news by ticker tags
|
|
435
|
+
hfn.get_latest_news(tags=['PETR4', 'VALE3'])
|
|
436
|
+
|
|
437
|
+
# Historical news for a date range
|
|
438
|
+
hfn.get_historical_news(
|
|
439
|
+
start_date='2026-05-01T00:00:00.000Z',
|
|
440
|
+
end_date='2026-05-01T23:59:59.999Z',
|
|
441
|
+
feed='economy',
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
# Available filter values
|
|
445
|
+
hfn.get_available_filters()
|
|
446
|
+
```
|
|
447
|
+
|
|
395
448
|
#### OPA
|
|
396
449
|
|
|
397
450
|
```python
|
|
@@ -484,6 +537,98 @@ company_data = btg.CompanyData(api_key='YOUR_API_KEY')
|
|
|
484
537
|
company_data.all_financial_tables(ticker='PETR4')
|
|
485
538
|
```
|
|
486
539
|
|
|
540
|
+
#### Alternative Data - Metadata
|
|
541
|
+
|
|
542
|
+
```python
|
|
543
|
+
import btgsolutions_dataservices as btg
|
|
544
|
+
meta = btg.AlternativeDataMetadata(api_key='YOUR_API_KEY')
|
|
545
|
+
meta.get_company_directory(query='PETROBRAS', jurisdiction='BR')
|
|
546
|
+
meta.get_company_sector(identifier='PETR4')
|
|
547
|
+
meta.get_taxonomy(system='b3')
|
|
548
|
+
meta.get_cnae(code='6422100')
|
|
549
|
+
meta.get_sector_companies(sector='Petróleo, Gás e Biocombustíveis')
|
|
550
|
+
meta.get_sectors_summary()
|
|
551
|
+
meta.get_financial_statement_types()
|
|
552
|
+
meta.get_datasets()
|
|
553
|
+
meta.get_available_assets(dataset='maximum_theoretical_margin', prefix='PETR')
|
|
554
|
+
meta.get_available_indicators()
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
#### Alternative Data - Companies
|
|
558
|
+
|
|
559
|
+
```python
|
|
560
|
+
import btgsolutions_dataservices as btg
|
|
561
|
+
companies = btg.AlternativeDataCompanies(api_key='YOUR_API_KEY')
|
|
562
|
+
companies.get_board(company_id='VALE3', body='board')
|
|
563
|
+
companies.get_governance_summary(company_id='ITUB4')
|
|
564
|
+
companies.get_governance_history(company_id='PETR4', start_date='2023-01-01', end_date='2024-12-31')
|
|
565
|
+
companies.get_governance_documents(company_id='PETR4', start_date='2024-01-01', end_date='2024-12-31')
|
|
566
|
+
companies.get_governance_compensation(company_id='VALE3', fiscal_year='2024')
|
|
567
|
+
companies.get_governance_related_party(company_id='ITUB4')
|
|
568
|
+
companies.get_governance_beneficial_ownership(company_id='VALE3')
|
|
569
|
+
companies.get_corporate_registry(company_id='PETR4', direction='partners')
|
|
570
|
+
companies.get_corporate_registry(company_id='PETR4', direction='investees')
|
|
571
|
+
companies.get_insider_trades(company_id='AAPL', start_date='2024-01-01', end_date='2024-12-31')
|
|
572
|
+
companies.get_board_changes(company_id='VALE3', event='appointed')
|
|
573
|
+
companies.get_financial_statements(company_id='PETR4', statement='income_statement', quarter='Q42024')
|
|
574
|
+
companies.get_financial_notes(company_id='VALE3', quarter='Q42024')
|
|
575
|
+
companies.get_disclosures(company_id='PETR4', document_type='repurchase')
|
|
576
|
+
companies.get_disclosures(company_id='PETR4', document_type='insider')
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
#### Alternative Data - People
|
|
580
|
+
|
|
581
|
+
```python
|
|
582
|
+
import btgsolutions_dataservices as btg
|
|
583
|
+
people = btg.AlternativeDataPeople(api_key='YOUR_API_KEY')
|
|
584
|
+
people.get_appointments(person_id='slug:Jean Paul Lemann', active_only=True)
|
|
585
|
+
people.get_appointments(person_id='slug:Jean Paul Lemann', group_by='company')
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
#### Alternative Data - Funds
|
|
589
|
+
|
|
590
|
+
```python
|
|
591
|
+
import btgsolutions_dataservices as btg
|
|
592
|
+
funds = btg.AlternativeDataFunds(api_key='YOUR_API_KEY')
|
|
593
|
+
funds.get_holdings(fund_id='73.232.530/0001-46', reference_date='2024-12-31')
|
|
594
|
+
funds.get_exposures(fund_id='73.232.530/0001-46', exposure_type='asset_class')
|
|
595
|
+
funds.get_history(fund_id='73.232.530/0001-46', start_date='2024-01-01', end_date='2024-12-31')
|
|
596
|
+
funds.get_lookthrough(fund_id='73.232.530/0001-46')
|
|
597
|
+
funds.get_manager_aggregate_holdings(manager_id='ITAÚ ASSET MANAGEMENT')
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
#### Alternative Data - Ownership
|
|
601
|
+
|
|
602
|
+
```python
|
|
603
|
+
import btgsolutions_dataservices as btg
|
|
604
|
+
ownership = btg.AlternativeDataOwnership(api_key='YOUR_API_KEY')
|
|
605
|
+
ownership.get_top_shareholders(company_id='VALE3', limit=10)
|
|
606
|
+
ownership.get_ownership_current(company_id='ITUB4')
|
|
607
|
+
ownership.get_ownership_history(company_id='PETR4', start_date='2023-01-01', end_date='2024-12-31')
|
|
608
|
+
ownership.get_ownership_change_events(company_id='VALE3', start_date='2024-01-01', end_date='2024-12-31')
|
|
609
|
+
ownership.get_ownership_official_notices(company_id='PETR4')
|
|
610
|
+
ownership.get_ownership_control_group(company_id='VALE3')
|
|
611
|
+
ownership.get_ownership_free_float(company_id='PETR4')
|
|
612
|
+
ownership.get_shareholder_holdings(shareholder_id='00.000.000/0001-91')
|
|
613
|
+
ownership.get_institutional_holders(identifier='VALE3')
|
|
614
|
+
ownership.get_fund_holders(identifier='PETR4', identifier_type='b3_ticker')
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
#### Alternative Data - Macro & Markets
|
|
618
|
+
|
|
619
|
+
```python
|
|
620
|
+
import btgsolutions_dataservices as btg
|
|
621
|
+
macro = btg.AlternativeDataMacroMarkets(api_key='YOUR_API_KEY')
|
|
622
|
+
macro.get_macro_indicators(indicator='selic')
|
|
623
|
+
macro.get_macro_indicators(indicator='ipca_contributions', start_date='2024-01', end_date='2024-12')
|
|
624
|
+
macro.get_macro_indicators(indicator='gdp', type='yoy')
|
|
625
|
+
macro.get_macro_indicators(indicator='comexstat', year='2024', state='SP')
|
|
626
|
+
macro.get_macro_indicators(indicator='rreo', year='2024', period='6')
|
|
627
|
+
macro.get_maximum_theoretical_margin(asset='PETR4', report_date='2024-12-31')
|
|
628
|
+
macro.get_dpmfi(start_date='2024-01', end_date='2024-12', status='dados_oficiais')
|
|
629
|
+
macro.get_dpmfi_composition(bond_type='IPCA')
|
|
630
|
+
```
|
|
631
|
+
|
|
487
632
|
### Reference Data
|
|
488
633
|
|
|
489
634
|
#### Corporate Events
|
|
@@ -510,23 +655,33 @@ import btgsolutions_dataservices as btg
|
|
|
510
655
|
book_scope = btg.BookScope(api_key='YOUR_API_KEY')
|
|
511
656
|
|
|
512
657
|
result = book_scope.get(
|
|
513
|
-
symbol='
|
|
514
|
-
market_type='
|
|
515
|
-
start_time='2026-05-
|
|
516
|
-
end_time='2026-05-
|
|
658
|
+
symbol='DOLM26',
|
|
659
|
+
market_type='derivatives',
|
|
660
|
+
start_time='2026-05-28T14:12:00Z',
|
|
661
|
+
end_time='2026-05-28T14:15:00Z',
|
|
517
662
|
select=['trades', 'book_snapshot', 'book_incremental'], # choose one, two, or all three
|
|
518
663
|
)
|
|
519
664
|
|
|
520
665
|
single_file_result = book_scope.get(
|
|
521
|
-
symbol='
|
|
522
|
-
market_type='
|
|
523
|
-
start_time='2026-05-
|
|
524
|
-
end_time='2026-05-
|
|
666
|
+
symbol='DOLM26',
|
|
667
|
+
market_type='derivatives',
|
|
668
|
+
start_time='2026-05-28T14:12:00Z',
|
|
669
|
+
end_time='2026-05-28T14:15:00Z',
|
|
525
670
|
select=['trades', 'book_snapshot', 'book_incremental'],
|
|
526
671
|
aggregate_info=True,
|
|
527
672
|
)
|
|
528
673
|
```
|
|
529
674
|
|
|
675
|
+
#### Broker Analytics
|
|
676
|
+
|
|
677
|
+
```python
|
|
678
|
+
import btgsolutions_dataservices as btg
|
|
679
|
+
broker_analytics = btg.BrokerAnalytics(api_key='YOUR_API_KEY', market_type='stocks')
|
|
680
|
+
summary = broker_analytics.get_summary(brokers=['85', '3'], tickers=['PETR4', 'ABCB4'])
|
|
681
|
+
top_brokers = broker_analytics.get_top_brokers(n=10)
|
|
682
|
+
top_tickers = broker_analytics.get_top_tickers(n=10, brokers=['85', '3'])
|
|
683
|
+
```
|
|
684
|
+
|
|
530
685
|
#### Ticker Reference Data
|
|
531
686
|
|
|
532
687
|
```python
|
|
@@ -257,6 +257,14 @@ hist_candles = btg.HistoricalCandles(api_key='YOUR_API_KEY')
|
|
|
257
257
|
hist_candles.get_intraday_history_candles(ticker='PETR4', market_type='stocks', corporate_events_adj=True, date='2023-10-06', candle='1m', rmv_after_market=True, timezone='UTC', raw_data=False, round=True)
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
+
##### Interday Batch
|
|
261
|
+
|
|
262
|
+
```python
|
|
263
|
+
import btgsolutions_dataservices as btg
|
|
264
|
+
hist_candles = btg.HistoricalCandles(api_key='YOUR_API_KEY')
|
|
265
|
+
hist_candles.get_interday_history_candles_batch(market_type='stocks', tickers=['PETR4', 'VALE3'], start_date='2023-10-01', end_date='2023-10-13', corporate_events_adj=True, rmv_after_market=True, timezone='UTC', raw_data=False, round=True)
|
|
266
|
+
```
|
|
267
|
+
|
|
260
268
|
##### Available Tickers
|
|
261
269
|
|
|
262
270
|
```python
|
|
@@ -369,6 +377,51 @@ hfn = btg.HighFrequencyNews(api_key='YOUR_API_KEY')
|
|
|
369
377
|
hfn.latest_news()
|
|
370
378
|
```
|
|
371
379
|
|
|
380
|
+
#### High Frequency News V3 Stream
|
|
381
|
+
|
|
382
|
+
```python
|
|
383
|
+
import btgsolutions_dataservices as btg
|
|
384
|
+
ws = btg.HFNV3WebSocketClient(api_key='YOUR_API_KEY')
|
|
385
|
+
ws.run(on_message=lambda message: print(message))
|
|
386
|
+
|
|
387
|
+
# Subscribe to live economy news in Portuguese
|
|
388
|
+
ws.subscribe(settings={'feed': 'economy', 'text_language': 'portuguese'})
|
|
389
|
+
|
|
390
|
+
# Request latest news on demand (without subscribing to the live stream)
|
|
391
|
+
ws.latest_news(settings={'feed': 'crypto', 'limit': '10'})
|
|
392
|
+
|
|
393
|
+
# Get available filter values
|
|
394
|
+
ws.available_filters(settings={})
|
|
395
|
+
|
|
396
|
+
# Stop receiving broadcasts (keeps connection open)
|
|
397
|
+
ws.unsubscribe()
|
|
398
|
+
|
|
399
|
+
ws.close()
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
#### High Frequency News V3
|
|
403
|
+
|
|
404
|
+
```python
|
|
405
|
+
import btgsolutions_dataservices as btg
|
|
406
|
+
hfn = btg.HighFrequencyNewsV3(api_key='YOUR_API_KEY')
|
|
407
|
+
|
|
408
|
+
# Latest news with filters
|
|
409
|
+
hfn.get_latest_news(feed='economy', text_language='portuguese', limit=10)
|
|
410
|
+
|
|
411
|
+
# Latest news by ticker tags
|
|
412
|
+
hfn.get_latest_news(tags=['PETR4', 'VALE3'])
|
|
413
|
+
|
|
414
|
+
# Historical news for a date range
|
|
415
|
+
hfn.get_historical_news(
|
|
416
|
+
start_date='2026-05-01T00:00:00.000Z',
|
|
417
|
+
end_date='2026-05-01T23:59:59.999Z',
|
|
418
|
+
feed='economy',
|
|
419
|
+
)
|
|
420
|
+
|
|
421
|
+
# Available filter values
|
|
422
|
+
hfn.get_available_filters()
|
|
423
|
+
```
|
|
424
|
+
|
|
372
425
|
#### OPA
|
|
373
426
|
|
|
374
427
|
```python
|
|
@@ -461,6 +514,98 @@ company_data = btg.CompanyData(api_key='YOUR_API_KEY')
|
|
|
461
514
|
company_data.all_financial_tables(ticker='PETR4')
|
|
462
515
|
```
|
|
463
516
|
|
|
517
|
+
#### Alternative Data - Metadata
|
|
518
|
+
|
|
519
|
+
```python
|
|
520
|
+
import btgsolutions_dataservices as btg
|
|
521
|
+
meta = btg.AlternativeDataMetadata(api_key='YOUR_API_KEY')
|
|
522
|
+
meta.get_company_directory(query='PETROBRAS', jurisdiction='BR')
|
|
523
|
+
meta.get_company_sector(identifier='PETR4')
|
|
524
|
+
meta.get_taxonomy(system='b3')
|
|
525
|
+
meta.get_cnae(code='6422100')
|
|
526
|
+
meta.get_sector_companies(sector='Petróleo, Gás e Biocombustíveis')
|
|
527
|
+
meta.get_sectors_summary()
|
|
528
|
+
meta.get_financial_statement_types()
|
|
529
|
+
meta.get_datasets()
|
|
530
|
+
meta.get_available_assets(dataset='maximum_theoretical_margin', prefix='PETR')
|
|
531
|
+
meta.get_available_indicators()
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
#### Alternative Data - Companies
|
|
535
|
+
|
|
536
|
+
```python
|
|
537
|
+
import btgsolutions_dataservices as btg
|
|
538
|
+
companies = btg.AlternativeDataCompanies(api_key='YOUR_API_KEY')
|
|
539
|
+
companies.get_board(company_id='VALE3', body='board')
|
|
540
|
+
companies.get_governance_summary(company_id='ITUB4')
|
|
541
|
+
companies.get_governance_history(company_id='PETR4', start_date='2023-01-01', end_date='2024-12-31')
|
|
542
|
+
companies.get_governance_documents(company_id='PETR4', start_date='2024-01-01', end_date='2024-12-31')
|
|
543
|
+
companies.get_governance_compensation(company_id='VALE3', fiscal_year='2024')
|
|
544
|
+
companies.get_governance_related_party(company_id='ITUB4')
|
|
545
|
+
companies.get_governance_beneficial_ownership(company_id='VALE3')
|
|
546
|
+
companies.get_corporate_registry(company_id='PETR4', direction='partners')
|
|
547
|
+
companies.get_corporate_registry(company_id='PETR4', direction='investees')
|
|
548
|
+
companies.get_insider_trades(company_id='AAPL', start_date='2024-01-01', end_date='2024-12-31')
|
|
549
|
+
companies.get_board_changes(company_id='VALE3', event='appointed')
|
|
550
|
+
companies.get_financial_statements(company_id='PETR4', statement='income_statement', quarter='Q42024')
|
|
551
|
+
companies.get_financial_notes(company_id='VALE3', quarter='Q42024')
|
|
552
|
+
companies.get_disclosures(company_id='PETR4', document_type='repurchase')
|
|
553
|
+
companies.get_disclosures(company_id='PETR4', document_type='insider')
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
#### Alternative Data - People
|
|
557
|
+
|
|
558
|
+
```python
|
|
559
|
+
import btgsolutions_dataservices as btg
|
|
560
|
+
people = btg.AlternativeDataPeople(api_key='YOUR_API_KEY')
|
|
561
|
+
people.get_appointments(person_id='slug:Jean Paul Lemann', active_only=True)
|
|
562
|
+
people.get_appointments(person_id='slug:Jean Paul Lemann', group_by='company')
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
#### Alternative Data - Funds
|
|
566
|
+
|
|
567
|
+
```python
|
|
568
|
+
import btgsolutions_dataservices as btg
|
|
569
|
+
funds = btg.AlternativeDataFunds(api_key='YOUR_API_KEY')
|
|
570
|
+
funds.get_holdings(fund_id='73.232.530/0001-46', reference_date='2024-12-31')
|
|
571
|
+
funds.get_exposures(fund_id='73.232.530/0001-46', exposure_type='asset_class')
|
|
572
|
+
funds.get_history(fund_id='73.232.530/0001-46', start_date='2024-01-01', end_date='2024-12-31')
|
|
573
|
+
funds.get_lookthrough(fund_id='73.232.530/0001-46')
|
|
574
|
+
funds.get_manager_aggregate_holdings(manager_id='ITAÚ ASSET MANAGEMENT')
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
#### Alternative Data - Ownership
|
|
578
|
+
|
|
579
|
+
```python
|
|
580
|
+
import btgsolutions_dataservices as btg
|
|
581
|
+
ownership = btg.AlternativeDataOwnership(api_key='YOUR_API_KEY')
|
|
582
|
+
ownership.get_top_shareholders(company_id='VALE3', limit=10)
|
|
583
|
+
ownership.get_ownership_current(company_id='ITUB4')
|
|
584
|
+
ownership.get_ownership_history(company_id='PETR4', start_date='2023-01-01', end_date='2024-12-31')
|
|
585
|
+
ownership.get_ownership_change_events(company_id='VALE3', start_date='2024-01-01', end_date='2024-12-31')
|
|
586
|
+
ownership.get_ownership_official_notices(company_id='PETR4')
|
|
587
|
+
ownership.get_ownership_control_group(company_id='VALE3')
|
|
588
|
+
ownership.get_ownership_free_float(company_id='PETR4')
|
|
589
|
+
ownership.get_shareholder_holdings(shareholder_id='00.000.000/0001-91')
|
|
590
|
+
ownership.get_institutional_holders(identifier='VALE3')
|
|
591
|
+
ownership.get_fund_holders(identifier='PETR4', identifier_type='b3_ticker')
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
#### Alternative Data - Macro & Markets
|
|
595
|
+
|
|
596
|
+
```python
|
|
597
|
+
import btgsolutions_dataservices as btg
|
|
598
|
+
macro = btg.AlternativeDataMacroMarkets(api_key='YOUR_API_KEY')
|
|
599
|
+
macro.get_macro_indicators(indicator='selic')
|
|
600
|
+
macro.get_macro_indicators(indicator='ipca_contributions', start_date='2024-01', end_date='2024-12')
|
|
601
|
+
macro.get_macro_indicators(indicator='gdp', type='yoy')
|
|
602
|
+
macro.get_macro_indicators(indicator='comexstat', year='2024', state='SP')
|
|
603
|
+
macro.get_macro_indicators(indicator='rreo', year='2024', period='6')
|
|
604
|
+
macro.get_maximum_theoretical_margin(asset='PETR4', report_date='2024-12-31')
|
|
605
|
+
macro.get_dpmfi(start_date='2024-01', end_date='2024-12', status='dados_oficiais')
|
|
606
|
+
macro.get_dpmfi_composition(bond_type='IPCA')
|
|
607
|
+
```
|
|
608
|
+
|
|
464
609
|
### Reference Data
|
|
465
610
|
|
|
466
611
|
#### Corporate Events
|
|
@@ -487,23 +632,33 @@ import btgsolutions_dataservices as btg
|
|
|
487
632
|
book_scope = btg.BookScope(api_key='YOUR_API_KEY')
|
|
488
633
|
|
|
489
634
|
result = book_scope.get(
|
|
490
|
-
symbol='
|
|
491
|
-
market_type='
|
|
492
|
-
start_time='2026-05-
|
|
493
|
-
end_time='2026-05-
|
|
635
|
+
symbol='DOLM26',
|
|
636
|
+
market_type='derivatives',
|
|
637
|
+
start_time='2026-05-28T14:12:00Z',
|
|
638
|
+
end_time='2026-05-28T14:15:00Z',
|
|
494
639
|
select=['trades', 'book_snapshot', 'book_incremental'], # choose one, two, or all three
|
|
495
640
|
)
|
|
496
641
|
|
|
497
642
|
single_file_result = book_scope.get(
|
|
498
|
-
symbol='
|
|
499
|
-
market_type='
|
|
500
|
-
start_time='2026-05-
|
|
501
|
-
end_time='2026-05-
|
|
643
|
+
symbol='DOLM26',
|
|
644
|
+
market_type='derivatives',
|
|
645
|
+
start_time='2026-05-28T14:12:00Z',
|
|
646
|
+
end_time='2026-05-28T14:15:00Z',
|
|
502
647
|
select=['trades', 'book_snapshot', 'book_incremental'],
|
|
503
648
|
aggregate_info=True,
|
|
504
649
|
)
|
|
505
650
|
```
|
|
506
651
|
|
|
652
|
+
#### Broker Analytics
|
|
653
|
+
|
|
654
|
+
```python
|
|
655
|
+
import btgsolutions_dataservices as btg
|
|
656
|
+
broker_analytics = btg.BrokerAnalytics(api_key='YOUR_API_KEY', market_type='stocks')
|
|
657
|
+
summary = broker_analytics.get_summary(brokers=['85', '3'], tickers=['PETR4', 'ABCB4'])
|
|
658
|
+
top_brokers = broker_analytics.get_top_brokers(n=10)
|
|
659
|
+
top_tickers = broker_analytics.get_top_tickers(n=10, brokers=['85', '3'])
|
|
660
|
+
```
|
|
661
|
+
|
|
507
662
|
#### Ticker Reference Data
|
|
508
663
|
|
|
509
664
|
```python
|
|
@@ -4,6 +4,7 @@ from .historical_candles_crypto import HistoricalCandlesCrypto
|
|
|
4
4
|
from .authenticator import Authenticator
|
|
5
5
|
from .bulk_data import BulkData
|
|
6
6
|
from .hfn import HighFrequencyNews
|
|
7
|
+
from .hfn_v3 import HighFrequencyNewsV3
|
|
7
8
|
from .quotes import Quotes
|
|
8
9
|
from .intraday_tick_data import IntradayTickData
|
|
9
10
|
from .ticker_last_event import TickerLastEvent
|
|
@@ -15,3 +16,10 @@ from .stock_loan import StockLoan
|
|
|
15
16
|
from .ticker_last_event_polling import TickerLastEventPolling
|
|
16
17
|
from .broker_reference import BrokerReference
|
|
17
18
|
from .book_scope import BookScope
|
|
19
|
+
from .broker_analytics import BrokerAnalytics
|
|
20
|
+
from .alternative_data_metadata import AlternativeDataMetadata
|
|
21
|
+
from .alternative_data_companies import AlternativeDataCompanies
|
|
22
|
+
from .alternative_data_people import AlternativeDataPeople
|
|
23
|
+
from .alternative_data_funds import AlternativeDataFunds
|
|
24
|
+
from .alternative_data_ownership import AlternativeDataOwnership
|
|
25
|
+
from .alternative_data_macro_markets import AlternativeDataMacroMarkets
|