A package to export bulk data from the CoinGecko API.
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 CoinGecko
api_key = "YOUR_API_KEY"
cg = CoinGecko(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')
cg.get_historical_data("ethereum")
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'.
get_historical_data(self, coingecko_id: str, type: str = '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.7.tar.gz
.
File metadata
- Download URL: coingecko_exporter-0.1.7.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8af05c3e7383f82144fcbb300bc9e84199ce35118ee9e2f4b8a8c0a720001eee |
|
MD5 | 5df82d58c5781d211c221777249bc3bd |
|
BLAKE2b-256 | d47943a0b24f23da2b0724350f6a5f3456176728b3ad176dc6882899d8a41348 |
File details
Details for the file coingecko_exporter-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: coingecko_exporter-0.1.7-py3-none-any.whl
- Upload date:
- Size: 5.1 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 | cc27c3d36deaf61df090eec27f014afc759fb5d7f48380b5989ccf7a4aee2db9 |
|
MD5 | b39055f5cb633dbfb34c44a291290ec4 |
|
BLAKE2b-256 | 7bce3bc726f790aec04fa8804f453ff43aa6463dfd7cce709e92adb3d7ba7391 |