An open source Python library for scraping Historical Cryptocurrency data.
Project description
Historic Crypto
An open source Python library for scraping Historical Cryptocurrency data.
This library scrapes coinmarketcap.com to collect historical Cryptocurrency data, returning a Pandas DataFrame. The HistoricalData class returns all attributes (Open, Close, High, Low, Volume, Market_Cap) of the selected cryptocurrency, whilst the MultipleHistoricalData accepts a list of cryptocurrencies and returns a single attribute of the corresponding cryptocurrencies.
Installation
From Python:
pip install Historic-Crypto
from Historic_Crypto import HistoricalData
from Historic_Crypto import MultipleHistoricalData
Usage
If you are unsure of the correct 'ticker' to scrape:
pip install Historic-Crypto
from Historic_Crypto import HistoricalData
HistoricalData(start_date = '', ticker = '').find_all_tickers()
Returns a Pandas DataFrame containing the columns "Name" and "Symbol", which indicate the Name - Symbol pairs of available cryptocurrencies. The "Symbol" is required as the corresponding 'ticker' input argument of other class methods:
pip install Historic-Crypto
from Historic_Crypto import HistoricalData
dataset = HistoricalData(start_date = '2013-06-06',
end_date = '2015-01-01',
ticker = 'BTC').retrieve_data()
Returns a Pandas DataFrame 'dataset', which contains the Open, Close, High, Low, Volume and Market Capitalisation of Bitcoin between 2013-06-06 and 2015-01-01, indexed by Date.
pip install Historic-Crypto
from Historic_Crypto import HistoricalData
dataset = HistoricalData(start_date = '2013-06-06',
ticker = 'BTC').retrieve_data()
Returns a Pandas DataFrame 'dataset', which contains the Open, Close, High, Low, Volume and Market Capitalisation of Bitcoin between 2013-06-06 and today, indexed by Date.
pip install Historic-Crypto
from Historic_Crypto import MultipleHistoricalData
dataset = MultipleHistoricalData(tickers = ['BTC','ETH'],
attribute = 'Open',
start_date = '2015-01-01',
end_date = '2019-01-01').retrieve_data()
Returns a Pandas DataFrame 'dataset', which contains the Open 'attribute' of Bitcoin and Etherium between 2015-01-01 and today, indexed by Date. Please note that 'NaN' rows are present in the output, which can be subsequently processed.
Input Arguments
Argument | Description |
---|---|
ticker | information for cryptocurrencies which the user would like to return (str). |
tickers | information for which cryptocurrencies the user would like to return (list). |
attribute | a string representing the attribute to be returned (From: 'Open','Close','High','Low','Volume','Market_Cap' (str). |
start_date | a string in the format YYYY-MM-DD (str). [optional] |
end_date | a string in the format YYYY-MM-DD (str). [optional] |
Project details
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 Historic_Crypto-0.1.1.tar.gz
.
File metadata
- Download URL: Historic_Crypto-0.1.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d164f4f37009eef956d37cda4d9c903406d37a616a8e8131562e69f77b50ef01 |
|
MD5 | 41388f00c295c48ec88b53fc8238d3ad |
|
BLAKE2b-256 | bc2063047789a5838ef52d64c41071d310ca193a53452019dfa5938e79b36aa4 |
File details
Details for the file Historic_Crypto-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: Historic_Crypto-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1de9a185fbb23255fec8f1fe6b0dd3055b1c557a359ca2732d4be8f85539a728 |
|
MD5 | 93b06dc4049fd534ea470f9f97108eff |
|
BLAKE2b-256 | d09c948c0b50cdb72e67d5dd265ceae807ef697f271d9db6864a235f7d6d0a8c |