Project Description
Historic Crypto is an open-source Python library designed for collecting historical cryptocurrency data. It interacts seamlessly with the CoinBase Pro API to provide:
- A list of available cryptocurrency pairs
- Real-time market data
- Historical data in Pandas DataFrame format
Key Features:
- HistoricalData Class: Retrieves OHLCV (Open, High, Low, Close, Volume) data for any supported cryptocurrency.
- Cryptocurrencies Class: Lists all available cryptocurrencies via the API, with a
coin_searchparameter for quick validation. - LiveCryptoData Class: Fetches real-time bid/ask prices and trade volumes.
Installation
Install via pip:
pip install Historic-CryptoImporting Modules:
from Historic_Crypto import HistoricalData
from Historic_Crypto import Cryptocurrencies
from Historic_Crypto import LiveCryptoDataUsage
1. Cryptocurrencies Class
Purpose: Identify valid cryptocurrency tickers before querying historical/live data.
Basic Usage:
Cryptocurrencies().find_crypto_pairs()Output:
- Returns a Pandas DataFrame with columns:
id,display_name, andstatus.
Optional Arguments:
| Argument | Description |
|---|---|
coin_search | Filters results for a specific cryptocurrency (e.g., 'XLM') (str). |
extended_output | Expands output with additional API fields (bool). Default: False. |
verbose | Prints extraction progress (bool). Default: True. |
Example:
data = Cryptocurrencies(coin_search='XLM', extended_output=False).find_crypto_pairs()2. HistoricalData Class
Purpose: Fetch historical price data.
Basic Usage:
new = HistoricalData('ETH-USD', 300, '2020-06-01-00-00').retrieve_data()Arguments:
| Argument | Description |
|---|---|
ticker | Cryptocurrency pair (e.g., 'BTC-USD') (str). |
granularity | Time interval in seconds (60, 300, 900, 3600, etc.) (int). |
start_date | Start date in YYYY-MM-DD-HH-MM format (str). |
end_date | Optional end date (str). Default: Current time. |
verbose | Prints extraction status (bool). Default: True. |
👉 Explore advanced trading strategies
3. LiveCryptoData Class
Purpose: Retrieve real-time bid/ask prices and trade metrics.
Basic Usage:
new = LiveCryptoData('ATOM-USD').return_data()Output:
- Pandas DataFrame with:
trade_id,price,size,bid,ask,volume.
Arguments:
| Argument | Description |
|---|---|
ticker | Cryptocurrency pair (str). |
verbose | Prints extraction progress (bool). Default: True. |
FAQ
1. How do I validate a cryptocurrency ticker?
Use the Cryptocurrencies class:
Cryptocurrencies(coin_search='BTC').find_crypto_pairs()2. What time intervals are supported for historical data?
Supported granularities: 60, 300, 900, 3600, 21600, 86400 seconds.
3. Can I fetch data for a custom date range?
Yes! Specify start_date and optional end_date in YYYY-MM-DD-HH-MM format.
4. Is real-time data available?
Absolutely. Use LiveCryptoData('TICKER').return_data().
5. How do I install the library?
Run:
pip install Historic-Crypto👉 Master crypto trading with expert insights
Conclusion
Historic Crypto simplifies cryptocurrency data collection—whether for backtesting trading strategies, academic research, or real-time analysis. With its intuitive classes and Pandas integration, it’s a must-have tool for crypto enthusiasts and developers.
Install today and unlock the power of historical and live crypto data! 🚀