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

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

Just pass how much data you want. It will return the amount in most recent 1h data. Currently only 1h data is supported. 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 and don't want to guess how much data avaliable on each exchange, just run .get_history() and get everything.

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_csv('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.5.3.tar.gz (12.2 kB view hashes)

Uploaded Source

Built Distribution

tradingfeatures-0.5.3-py3-none-any.whl (21.8 kB view hashes)

Uploaded Python 3

Supported by

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