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, Time Open, Time High, Time Low, Time Close
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
Built Distribution
File details
Details for the file cryptocmd-0.6.4.tar.gz
.
File metadata
- Download URL: cryptocmd-0.6.4.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c3e91914a40b8f654d7e3c2f7ca2ec187f2678689d57696b93fad3c5382ba87 |
|
MD5 | 3a7cde09cc9a5377811d55bb11d0d07a |
|
BLAKE2b-256 | 94039ec9c6184920626060ea91f75fd88e60946d25c6eb6968443d70905a48ff |
File details
Details for the file cryptocmd-0.6.4-py3-none-any.whl
.
File metadata
- Download URL: cryptocmd-0.6.4-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0608b3404f49de91a3b0f78e57d0f603102acc77ef12d8e6bb298948eabda60 |
|
MD5 | 6f917658b6d80864112d66c0015fdc89 |
|
BLAKE2b-256 | d660ecf5636cd124e089033cede8d39d4ef842f5445ddf4ead19d49f5757be74 |