crypto_currency
Some crypto currency SDKs
Installation
pip install crypto_currency
Usage
CoinMarketCap
Python SDk for CoinMarketCap API.
from crypto_currency.coin_market_cap import CoinMarketCap
cmc = CoinMarketCap()
# Basic usage
cmc.get_global()
cmc.get_ticker_by_id(1)
cmc.get_listings()
cmc.get_ticker()
# more get history data, this will return a pandas.DataFrame
cmc.history_data(symbol='BTC', start='20180101', end='20180630')
CryptoCompare
Python SDk for CryptoCompare API
from crypto_currency.crypto_compare import CryptoCompare
ccp = CryptoCompare()
# Price
ccp.price_single_symbol(fsym='BTC', tsyms='USDT')
Exchange
It's sdk for most of exchanges, use ccxt.
For API methods, please see https://github.com/ccxt/ccxt/wiki
from crypto_currency.exchange import Exchange
# If do not have API_KEY and SECRET_KEY, only can get public market data like ticker, ohlcv data
API_KEY = ''
SECRET_KEY = ''
cli = Exchange('binance', API_KEY, SECRET_KEY)
# get ticker
cli.cli.fetch_ticker('BTC/USDT')
# get orders
cli.cli.fetch_order('BTC/USDT')
# get kline data and return pandas.DataFrame
cli.get_kline_data(symbol='BTC/USDT', period='1d', since=None, limit=None)