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

Uploaded Source

Built Distribution

coingecko_exporter-0.2.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coingecko_exporter-0.2.1.tar.gz
  • Upload date:
  • Size: 5.0 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.2.1.tar.gz
Algorithm Hash digest
SHA256 7f19182add7af1ed8f25833f09e0c7e74a92d4a738a4674ebd802a12ee7110aa
MD5 6c1552202047142ea900d75b2b7be52e
BLAKE2b-256 63d2010e3f0f40615ae382be6bc875666c22df0f9ade3e75fc5d165f0f7a39b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coingecko_exporter-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a02a091b4dfd03348eeae012761e15b380e3904870b5ceb47618acdc4ed9b528
MD5 3c7beeba8ede91f9e5dc154d917d2dd5
BLAKE2b-256 fce0ba73f8c52095a8703895bcfae7c07aea9ab498fed73ba320d3242ca03f0a

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