Skip to main content

An open source Python library for scraping Historical Cryptocurrency data.

Project description

Historic Crypto

An open source Python library for the collection of Historical Cryptocurrency data.

This library interacts with the CoinBase Pro API to:

  • List the Cyptocurrency Pairs available through the API.
  • Return Live Data from the API
  • Return historical data from the API in a Pandas DataFrame.

The HistoricalData class returns all attributes (Open, Close, High, Low, Volume) of the selected Cryptocurrency, whilst the Cryptocurrencies class returns all Cryptocurrencies available through the API, with a 'coin_search' parameter if the user wishes to check if that Coin ID is available.

Installation

From Python:

pip install Historic-Crypto
from Historic_Crypto import HistoricalData
from Historic_Crypto import Cryptocurrencies
from Historic_Crypto import LiveCryptoData

Usage

Cryptocurrencies

If you are unsure of the correct 'ticker' to search for:

pip install Historic-Crypto
from Historic_Crypto import Cryptocurrencies

Cryptocurrencies().find_crypto_pairs()

Returns a Pandas DataFrame containing the columns "id" and "display_name" and "status", with the "id" column indicating the search term which should be queried by the other classes within the package.

Additionally, a number of optional arguments can be added:

Argument Description
coin_search search for a specific cryptocurrency string (str) Default = None.
extended_output displays either a condensed or extended output (Bool) Default = False.
verbose prints status messages (Bool) Default = True.
pip install Historic-Crypto
from Historic_Crypto import Cryptocurrencies

data = Cryptocurrencies(coin_search = 'XLM', extended_output=False).find_crypto_pairs()

HistoricalData

Once you know the ticker which you would like to search for, you can search for it using the HistoricalData class.

pip install Historic-Crypto
from Historic_Crypto import HistoricalData

new = HistoricalData('ETH-USD',300,'2020-06-01-00-00').retrieve_data()

The arguments for the class are listed below:

Argument Description
ticker supply the ticker information which you want to return (str).
granularity please supply a granularity in seconds (60, 300, 900, 3600, 21600, 86400) (int).
start_date a string in the format YYYY-MM-DD-HH-MM (str).
end_date a string in the format YYYY-MM-DD-HH-MM (str). Optional, Default: Now
verbose printing during extraction. Default: Now

LiveCryptoData

If you want to see the current Bid/Ask of a specific Cryptocurrency:

pip install Historic-Crypto
from Historic_Crypto import LiveCryptoData

new =  LiveCryptoData('ATOM-USD').return_data()

Returns a Pandas DataFrame 'data', which contains the trade_id, price, size, bid, ask and volume of the previous transaction, indexed by timestamp.

The arguments for the class are listed below:

Argument Description
ticker information for which the user would like to return (str).
verbose print progress during extraction (bool). Default:True

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

Uploaded Source

Built Distribution

Historic_Crypto-0.1.4-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Historic_Crypto-0.1.4.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for Historic_Crypto-0.1.4.tar.gz
Algorithm Hash digest
SHA256 faea4bebb3ec279c90730410f59a8d8c5623181ba017eeb7bdc3bec4bfb2e449
MD5 da7af07e96957922aba2b2e9fca42147
BLAKE2b-256 78627f3fb29bc62f2fdc16a0b1975f6aab046ab8cda75dd4cb5cb9cf716f0001

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Historic_Crypto-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for Historic_Crypto-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ec5e2ce84a444f08e02177675c40f565940843052e90162c1a5b94006e605419
MD5 8b08f37731383a9fe77145cd05c0fdaf
BLAKE2b-256 5d6eac069f1f8585d5dac3b01f108e8c7c95f7aad5c036c97736a597e20d9403

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