Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coingecko_exporter-0.1.6.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

coingecko_exporter-0.1.6-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file coingecko_exporter-0.1.6.tar.gz.

File metadata

  • Download URL: coingecko_exporter-0.1.6.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for coingecko_exporter-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a7fcc797c81879b76213e05595a519e74014fb017ef3cf9eeecc54ba49878988
MD5 e72201d059882c62431e21ceb9769bab
BLAKE2b-256 9ed917d7484652d9194379e6b5d36cf04b7823171223faa5cdd0613f725b8273

See more details on using hashes here.

File details

Details for the file coingecko_exporter-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for coingecko_exporter-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bd672bf266603f60ce3141726f662c984f61bb8504fa00e2748dda60d0cd3ce9
MD5 87bfa55b156e0483376dbac203b47447
BLAKE2b-256 c63021f3547e39a15e9b7d4affb2f1ca214e9cbaa1e49af8b59a86298b56a9e4

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