Skip to main content

A useful tool to download market history from popular exchanges.

Project description

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:

  • bitfinex
  • bitstamp
  • binance
    • binance.funding
  • bitmex
    • bitmex.funding
    • bitmex.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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tradingfeatures-0.6.4.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tradingfeatures-0.6.4-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file tradingfeatures-0.6.4.tar.gz.

File metadata

  • Download URL: tradingfeatures-0.6.4.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for tradingfeatures-0.6.4.tar.gz
Algorithm Hash digest
SHA256 effda5c248e68914129372f4b16c449171bc75e7f0ba3d3dd6fbb7feb5d7df51
MD5 35d5b89a1f7b2c5c1a5cf7fb3a7f882f
BLAKE2b-256 b584de909079a8acd38b4982aafa7c9981b6ee4cd0b0a7e6f899f86647bc4d35

See more details on using hashes here.

File details

Details for the file tradingfeatures-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: tradingfeatures-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for tradingfeatures-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 31ed07643799128d865bb5a52309795a961909de87e06d87f3b25e01b3fac584
MD5 c05563a5e13eced39a0e64a810dcf343
BLAKE2b-256 ca37369aa9e8b69ca6f2cd56d0f4c504fce43ac0a195e2669acd0beab7b9856f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page