tradingfeatures
A useful tool to download market history from popular exchanges.
Installation
pip install tradingfeatures
or
pip install git+https://github.com/realiti4/tradingfeatures.git@master --upgrade
Example
.get(): Returns most recent history amount you pass..get_history(): Downloads all avaliable history for that api..update(): Takes a csv file path and updates it.
You can use .get(), .get_history() and .update() with all avaliable apis. Currently supported:
bitfinexbitstampbinancebinance.funding
bitmexbitmex.fundingbitmex.quote
Supported symbols: btcusd, ethusd, ltcusd. These are guaranteed to work with every module. You can stil use any symbol that an exchange supports. But same pair is different for each exchange of course. Using an unsupported symbol will give you a warning, but it should work just fine as long as you are using a correct symbol for that api.
Get history with .get()
import pandas as pd
from tradingfeatures import bitfinex, bitstamp, binance, bitmex
bitfinex = bitfinex()
df = bitfinex.get(2000)
df2 = bitfinex.get(2000, symbol='ethusd') # Default is btcusd, you can pass others in symbol parameter
df3 = bitfinex.get(20000, interval='1m') # You can pass any interval that exchange api supports
Just pass how much data you want. It will return the amount in most recent 1h data. If history amount is above api limit, .get() will run .get_history() under the hood, so you don't need to worry about it. But if you want everything avaliable on an exchange, just run .get_history().
Download all available history with .get_history()
The tool will download all avaliable history while respecting request per minute limits. Using it easy, and it takes couple of minutes for 1h data.
import pandas as pd
from tradingfeatures import bitfinex, bitstamp, binance, bitmex
bitstamp = bitstamp()
df = bitstamp.get_hist()
df.to_csv('bitstamp_1h.csv')
Updating a csv file with .update()
import pandas as pd
from tradingfeatures import bitfinex, bitstamp, binance, bitmex
bitstamp = bitstamp()
bitstamp.update('bitstamp.csv')
Update takes a path variable to csv file and updates it.
Metadata
Release files for tradingfeatures 0.8.0
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 | |
|---|---|---|---|---|
| tradingfeatures-0.8.0.tar.gz | 14.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tradingfeatures-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.6 kB
Release files / tradingfeatures-0.8.0.tar.gz
| Download URL | tradingfeatures-0.8.0.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d3195897d2a15b1be8ff3394a126e748ec8debc8a27f07f645daa7c0f33c12d
|
|
BLAKE2b-256 checksum How to use checksums |
46d9eaadf4de000f19387a68d97f3e4b2ee422c2def10c80a055c57a5bc01d67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / tradingfeatures-0.8.0-py3-none-any.whl
| Download URL | tradingfeatures-0.8.0-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebdd3f7c5085841d28dd34597ec2267b7d4f79c30268bdb9f8281c77b6731b6a
|
|
BLAKE2b-256 checksum How to use checksums |
b9968e464f9dd60e58917ca1f1223e7da8f3d2970105ed78099f85ebb2dc9f15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Security for tradingfeatures 0.8.0
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.