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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: coingecko_exporter-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 5645265489abf4e70139ba510173ac0d9d038af0cc2f63d9f1a73d028761b3fa
MD5 102c9cad97ac42d500000f6ef74c3cac
BLAKE2b-256 956147c35e805e4834e8ad64de13b7f87b54a1ed7585ea14475a63ce0e4c2ae7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coingecko_exporter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1a5eb5b47f66fd624bd8adebaa934648c36f6fa02bd8ce2f3be5b06c2457f7e
MD5 836ed42d15d45a28c821563d9294282d
BLAKE2b-256 afa92fad6647e3e64cdb1e01eec845b19b5df86a0be9316f2429cba6becba7c7

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