Python package containing several classes and data for extracting and manipulating market and trading data.
Project description
BTG Solutions - Data Service
It's a Python library to get Brazilian Financial Market Data.
Installation
pip3 install btgsolutions-dataservices-python-client
Example - WebSocket Books
import btgsolutions_dataservices as btg
ws = btg.WebSocketClient(api_key='YOUR_API_KEY', ws_type='books', instruments=['PETR4', 'VALE3'])
ws.run(on_message=lambda message: print(message))
Example - WebSocket Trades Delayed
import btgsolutions_dataservices as btg
ws = btg.WebSocketClient(api_key='YOUR_API_KEY', ws_type='trades', target='delayed', instruments=['PETR4', 'VALE3'])
ws.run(on_message=lambda message: print(message))
Example - IntradayCandles
import btgsolutions_dataservices as btg
int_candles = btg.IntradayCandles(api_key='YOUR_API_KEY')
int_candles.get_intraday_candles(market_type='stocks', tickers=['PETR4', 'VALE3'], candle_period='1m', mode='relative', raw_data=True)
Example - Plot HistoricalCandles
import btgsolutions_dataservices as btg
hist_candles = btg.HistoricalCandles(api_key='YOUR_API_KEY')
hist_candles.get_historical_candles(ticker='PETR4', lookback='5D', mode='absolute').plot(x='date', y='close_price', kind='scatter')
Documentation
The official documentation is hosted at https://python-client-docs.dataservices.btgpactualsolutions.com/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for btgsolutions-dataservices-python-client-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4a13954ccd514a06f422c481a7d3ec41a66553764c7c0be52a5eedb8fbffb5d |
|
MD5 | 2610a34905c4b1a378faf1852edfaa1b |
|
BLAKE2b-256 | 54f65f6aafdb3133cd72752957c5647431a1e2d4f8046c2b844e2435809a769f |