coindata-cmc
coindata-cmc copied to clipboard
Historical data parser for cryptos
This project is no longer maintainted since Yahoo Finance started to offer historical data of all cryptocurrency markets from CoinMarketCap in csv format.
Coindata
Historical data of all cryptos from CoinMarketCap.
Examples:
-
CSV
-
BTC.csv
-
XRP.csv
-
ETH.csv
-
-
JSON
-
BTC.json
-
XRP.json
-
ETH.json
-
Install
Pip:
$ pip install coindata
Clone repository:
$ git clone https://github.com/Anaxilaus/coindata
$ python coindata/setup.py install
Requirements:
beautifulsoup4 and requests. Setup installs requirements itself.
Usage
Cache and get
>>> coindata.cache('xrp')
XRP written at $PROJECT_DIR/coindata/cache/XRP.csv
>>> coindata.get('xrp')
[
{Beginning of the time}
.
.
.
{'Date': string,
'Open*': float,
'High': float,
'Low': float,
'Close**': float,
'Volume': float,
'Market Cap': float,
# additional calculated info below #
'circulation': decimal,
'change': float,
'date': datetime.object
}
.
.
.
{Today}
]
Dump as JSON to use elsewhere.
Example JSON dump.
File structure
You can use cache files:
source-code
├── coindata
│ ├── cache
│ │ ├── CSV files
│ ├── tickers
│ │ ├── JSON files
Example cache files.
Read documentation at code for a lot more functionality.
Notes
- Symbol, name and case-insensitive.
btc = BTC = bitcoin = BITCOIN
-
Based on USD.
-
Date notation is ISO8601 in CSV files.
>>> coindata.ISO8601
"%Y-%m-%d"