Cryptocurrency historical market price data scrapper.
Project description
Cryptocurrency historical market price data scraper written in Python.
Installation
$ pip install cryptocmd
to install from the latest source use following command
$ pip install git+git://github.com/guptarohit/cryptoCMD.git
Usage
CoinMarketCap Scraper
Following methods are available to get data in multiple formats from https://coinmarketcap.com
To get all time historical data of a cryptocurrency
from cryptocmd import CmcScraper
# initialise scraper without time interval
scraper = CmcScraper("XRP")
# get raw data as list of list
headers, data = scraper.get_data()
# get data in a json format
xrp_json_data = scraper.get_data("json")
# export the data as csv file, you can also pass optional `name` parameter
scraper.export("csv", name="xrp_all_time")
# Pandas dataFrame for the same data
df = scraper.get_dataframe()
To get data of a cryptocurrency which have same coin code as others
from cryptocmd import CmcScraper
# initialise scraper with coin name as well
scraper = CmcScraper(coin_code="sol", coin_name="solana")
# get raw data as list of list
headers, data = scraper.get_data()
# get data in a json format
solana_json_data = scraper.get_data("json")
# export the data as csv file, you can also pass optional `name` parameter
scraper.export("csv", name="solana_all_time")
# Pandas dataFrame for the same data
df = scraper.get_dataframe()
To get data of a cryptocurrency for some days
from cryptocmd import CmcScraper
# initialise scraper with time interval
scraper = CmcScraper("XRP", "15-10-2017", "25-10-2017")
# get raw data as list of list
headers, data = scraper.get_data()
# get data in a json format
json_data = scraper.get_data("json")
# export the data to csv
scraper.export("csv")
# get dataframe for the data
df = scraper.get_dataframe()
Following are the columns of the data
Date, Open, High, Low, Close, Volume, Market Cap
Acknowledgements
The data is being scrapped from coinmarketcap :v: and it’s free to use. :tada:
Contributing
Feel free to make a pull request! :octocat:
If you found this useful, I’d appreciate your consideration in the below. ✨☕
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cryptocmd-0.6.3.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for cryptocmd-0.6.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a39229df45c1911794bd67e48bcd06be94e3d13b748f082dce9ba14c4455a98d |
|
MD5 | cd87ff07a1afd2bbda3e90d8ad9645d7 |
|
BLAKE2b-256 | 2192f5b995f0a22f56cfd7042534fc4b6815752616b99ca29bd73a6e4f1861d3 |