A package to fetch and export large amounts of CoinGecko cryptocurrency data.
Project description
CoinGecko Exporter
CoinGecko Exporter is a Python package that allows you to fetch and export cryptocurrency data from the CoinGecko API. The data can be exported in various formats including Pandas DataFrame, SQLite, and DuckDB.
Features
- Fetch cryptocurrency market data asynchronously.
- Retrieve historical timeseries data for multiple cryptocurrencies.
- Export data in Pandas DataFrame, SQLite, or DuckDB format.
Installation
You can install the package using pip:
pip install coingecko-exporter
Usage
Below is an example of how to use the CoinGecko Exporter package:
import asyncio
from coingecko_exporter import CoinGeckoExporter
api_key = "YOUR_API_KEY"
cg = CoinGeckoExporter(api_key=api_key)
# Number of coins to fetch
coins = 3000
# Fetch data and export as DataFrame
coins_df, historical_data_df = cg.export_data(coins=coins, export_format='df')
# Export data to SQLite
cg.export_data(coins=coins, export_format='sqlite')
# Export data to DuckDB
cg.export_data(coins=coins, export_format='duckdb')
API Reference
CoinGeckoExporter
__init__(self, api_key)
Initializes the CoinGeckoExporter with the provided API key.
api_key
: Your CoinGecko API key.
export_data(self, coins, export_format='df')
Fetches and exports CoinGecko data.
coins
: Number of coins to fetch.export_format
: Export format. Options are 'df', 'sqlite', or 'duckdb'. Default is 'df'.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
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 coingecko_exporter-0.1.0.tar.gz
.
File metadata
- Download URL: coingecko_exporter-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8af5109fb7b4a5b9ce7ea05d192276295652a3ec0d1d6d35be34d82efe486223 |
|
MD5 | 14e560d0f6c68215df9e8e3206c9129f |
|
BLAKE2b-256 | ecb06095d349c461f5313f414410c41aca93e8e0881acd588fb36b36767f9387 |
File details
Details for the file coingecko_exporter-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: coingecko_exporter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 019a8a874fea3548b47546255d89f059e6443f40c48a25961279fd4402cde8ec |
|
MD5 | 1a87760aa57865443e4b908655bc402e |
|
BLAKE2b-256 | 3d8f3baeffbbed9e826912073a7c59a0c5922e314a38829f7629797a786de7c2 |