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.0.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

Historic_Crypto-0.0.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file Historic_Crypto-0.0.3.tar.gz.

File metadata

  • Download URL: Historic_Crypto-0.0.3.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

Hashes for Historic_Crypto-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3bbd036ebc95ef8a7ea96d7792126563003d5370538688e8602d42b256c09b4d
MD5 0d2434b5ee45fd143dd609d7126b4db9
BLAKE2b-256 c29700e36d4b1ce61f75fe6c28db8873a861a9e03c8e14c83d3632b01071f491

See more details on using hashes here.

File details

Details for the file Historic_Crypto-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: Historic_Crypto-0.0.3-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

Hashes for Historic_Crypto-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d18efbe03f41ea1c1b18aa350b15f4f33de9332d0d9c246068de673625c7b646
MD5 dcbd6bcf1ce7e61b213753f734c24a20
BLAKE2b-256 58e15d0fe2e08a7f57cf3c2bbda358105fe2bdeee4411aac317411aaf79de05b

See more details on using hashes here.

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