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

Uploaded Source

Built Distribution

coingecko_exporter-0.1.8-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coingecko_exporter-0.1.8.tar.gz
  • Upload date:
  • Size: 4.8 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.8.tar.gz
Algorithm Hash digest
SHA256 e61cffe99ec6a35e4ab7aca82f46abe5b0e67fe698f99063e1ecc2a0faea8e47
MD5 33aa38fc7b2cd14cbab6c52eaa876502
BLAKE2b-256 e04535ba76d9061e5a7cabe74c3be0e8ddbf0393fa4261fe9713b6d89e99b0bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coingecko_exporter-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8a39d11c550a15b92a41336053e929e512dced522dd5c50abe8980c15561cecb
MD5 e994adc89ef3660430ff58b2471f39ac
BLAKE2b-256 2c3c75db4c86fa83ae31cbf8e585165e340910fc361c8474201bea704da015db

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