Skip to main content

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

Historic_Crypto-0.1.1.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

Historic_Crypto-0.1.1-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page