No project description provided
Project description
Short Overview.
binance_historical_data is a python package (py>=3.7) which makes dumping of historical crypto data from binance server as simple as possible. You don’t even need to have an account at binance.com to dump all history of crypto data
Using this package you will be able to have full binance historical data with only 3 lines of python code
And if you need to update already dumped data then once again 3 lines of python code will do the job
Limitations: The previous day data appear on binance server a few minutes after 0 a.m. UTC
So there is a delay in which you can get the data.
Installation via pip:
pip install binance_historical_data
How to use it
Init main object: data_dumper
from binance_historical_data import CandleDataDumper
data_dumper = CandleDataDumper(
path_dir_where_to_dump=".",
str_data_frequency="1m",
)
Arguments:
- path_dir_where_to_dump:
- (string) Path to folder where to dump the historical data
- str_data_frequency:
- (string) One of [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h]
The main method to dump data
data_dumper.dump_data(
list_tickers=None,
date_start=None,
date_end=None,
is_to_update_existing=False,
)
Arguments:
- list_tickers=None:
- listTrading pairs for which to dump dataif equals to None all USDT pairs will be used
- date_start=None:
- datetime.dateThe date from which to start dump
- date_end=True=None:
- datetime.dateThe last date for which to dump data
- is_to_update_existing=False:
- boolFlag if you want to update data if it’s already exists
Examples
How to dump all data for all USDT trading pairs
Please be advised that the first data dump for all trading pairs might take some time (~40 minutes)
data_dumper.dump_data()
How to update data dump and get all new data
data_dumper.dump_data()
How to update (reload) all data for the asked time period
data_dumper.dump_data(
date_start=datetime.date(year=2021, month=1, day=1),
date_end=datetime.date(year=2022, month=1, day=1),
is_to_update_existing=True
)
How to get all trading pairs (tickers) from binance
print(data_dumper.get_list_all_trading_pairs())
Links
Project local Links
Contacts
License
This project is licensed under the MIT License.
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
Built Distribution
Close
Hashes for binance_historical_data-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31ca61a41d48ba027ff36a30df959ac66036c28b4acaa439975afe6e82b46fe7 |
|
MD5 | 831b6f7fd40d47aa52f9e368dce6cce9 |
|
BLAKE2b-256 | 203a29b94cf1c66c8fc2094418dfb3b0b6b6a2acc00aa618cb557da5322e7eac |
Close
Hashes for binance_historical_data-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4df315bdb1a8811b400bf343e50dfbb280acaa2fe185def628e030396640e1db |
|
MD5 | fbd157e7515d6abeb7d30439a93c15a4 |
|
BLAKE2b-256 | e9d55d8784666be723a393755ce1776f2bb9543cbf839409c92e502bfa3d0f4a |