Overview
binance_pandas_dataframe collects the historical data from https://data.binance.vision and builds Pandas dataframes from them for use in Python.
The code was forked from https://github.com/binance/binance-public-data, and the logic to build the Pandas dataframe was added.
If you want to process data in a tool other than Python, such as R, Julia, or excel, you can use pandas_dataframe_convert to convert the dataframes produced by binance_pandas_dataframe to 'pkl', 'ftr', 'json', 'xlsx', 'csv', 'md', 'latex', or 'parquet'.
Status
Currently only klines work.
Installing
Installing from PyPi
pip install binance_pandas_dataframes
Installing from your git clone.
Flit is used to build the python package for installation with pip. Flit will call pip as required.
This is the best way to do it. In windows, do this from an adminstrator powershell for the symlink permissions.
flit install --symlink
or you can install it this way, you will have to uninstall with pip and reinstall with flit for every change in a source file.
flit install
Running the scripts
The scripts are installed in your python Scripts folder which should be in your path.
export STORE_DIRECTORY=<your desired path>
This will configure the default storing directory of the downloaded data. This can be
overwritten
by setting an argument(example given below).
download_kline
download_trade
download_aggTrade
Downloads all monthly and daily(for past 35 days) klines/trades/aggTrades of all intervals(applicable to klines only) and symbols.
download_kline --help
This will show the arguments that can be parsed to the scripts which can be used to configure download options.
usage: download_kline [-h] [-s SYMBOLS [SYMBOLS ...]] [-a ALL_SYMBOLS [ALL_SYMBOLS ...]] [-y {2017,2018,2019,2020,2021,2022}] [-folder FOLDER] [-c {0,1}] [-t {spot,um,cm}] [-o OFILE] [--stdout] -i {1m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1mo} [{1m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1mo} ...]
This is a script to download historical klines data
optional arguments: -h, --help show this help message and exit -s SYMBOLS [SYMBOLS ...] Single symbol or multiple symbols separated by space -a ALL_SYMBOLS [ALL_SYMBOLS ...] download all symbols. because you can. -y {2017,2018,2019,2020,2021,2022} Single year to start, read all klines data until today -folder FOLDER Directory to store the downloaded data -c {0,1} 1 to download checksum file, default 0 -t {spot,um,cm} Valid trading types: ['spot', 'um', 'cm'] -o OFILE file for pandas dataframe. Recommend using the .pkl extension. if you want another format for analyzing in R, excel, etc use dataframe_convert.
--stdout write the dataframe to stdandard output. usueful if using a shell pipeline. you can pipe output to dataframe_convert if you want a format for use in excel, R, etc.
-i {1m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1mo} [{1m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1mo} ...] single kline interval or multiple intervals separated by space -i 1m 1w means to download klines interval of 1minute and 1week
e.g.
download_kline.cmd -y 2021 -s ETHUSDT -o test.pkl
dataframe_convert -i test.pkl -o test.csv
to download to test.pkl and to create a csv as well
Metadata
Release files for binance_pandas_dataframe 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| binance_pandas_dataframe-0.5.tar.gz | 18.7 kB | Without provenance | Details for binance_pandas_dataframe-0.5.tar.gz |
Release files / binance_pandas_dataframe-0.5.tar.gz
| Download URL | binance_pandas_dataframe-0.5.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be92e1e16f373f68c4ad1f2801ce2f9d444a70a9b59309e12716abc028c425ee
|
|
BLAKE2b-256 checksum How to use checksums |
00aa7c8d08868806367ea3fc79ed5693775927f33dcfd49007e0b1ae9b7fd219
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.26.0
|
Security for binance_pandas_dataframe 0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.