A package for archiving Binance data
Project description
Real-time market data listener and archiver in python.
Saves raw binance data in zipped jsons on azure blob
Handles:
spot, futures usd-m, futures coin-m Level 2 orderbook deltas stream trade stream orderbook snapshots with configured trigger interval 24-hour WebSocket lifecycle. At the end of the WebSocket's lifespan, it initiates a new WebSocket to ensure the continuity of data flow is maintained seamlessly.
Configured to use contenerised on Azure with Azure blob and keyvault
Installation
# to be announced
Usage
import the run_stonks_analysis
function from the stonks
module and run the script:
from binance_archiver import launch_data_sink
if __name__ == '__main__':
config = {
"instruments": {
"spot": ["BTCUSDT", "ETHUSDT", "BNBUSDT", "SOLUSDT", "XRPUSDT", "DOTUSDT"],
"usd_mfutures": ["BTCUSDT", "ETHUSDT", "BNBUSDT", "SOLUSDT", "XRPUSDT", "DOTUSDT"],
"coin_m_futures": ["BTCUSD_PERP", "ETHUSD_PERP", "BNBUSD_PERP", "SOLUSD_PERP", "XRPUSD_PERP", "DOTUSD_PERP"]
},
"file_duration_seconds": 300,
"snapshot_fetcher_interval_seconds": 300,
"websocket_life_time_seconds": 600,
"save_to_json": False,
"save_to_zip": False,
"send_zip_to_blob": False
}
azure_blob_parameters_with_key = 'some azure blob parameters with key'
container_name = 'some-azure-container-name'
data_sink = launch_data_sink(
config,
azure_blob_parameters_with_key=azure_blob_parameters_with_key,
container_name=container_name
)
time.sleep(2115)
data_sink.shutdown()
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
binance-archiver-0.0.2.tar.gz
(50.6 kB
view hashes)
Built Distribution
Close
Hashes for binance_archiver-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ae73e33598c57d2d9b2c67dbe80181516365c0e9a43b91324251c7c57ce57c0 |
|
MD5 | f84849cfc9520bb489f33af1a8f4a340 |
|
BLAKE2b-256 | 04300abd2dd57899093fb94356fa296f596c082f543f469eea2fe30fe2057c7b |