Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

avhn/coindata-cmc

Repository files navigation

This project is no longer maintainted since Yahoo Finance started to offer historical data of all cryptocurrency markets from CoinMarketCap in csv format.

Coindata

PyPI version Build Status Python Version License

Historical data of all cryptos from CoinMarketCap.

Examples:

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"

Give this a star if you feel this helped you. Contributions are always welcome.