Skip to main content

Python wrapper for coingecko.com v3 api

Project description

python-coingecko

GitHub Actions status Coverage PyPi Shield Style Badge License Shield

⚠️ This package is actively being developed and accepting PRs (see TODO section)!

A Python wrapper for coingecko.com V3 api. Other notable api wrappers that didn't satisfy my need:

  • pycoingecko has not been active in over two years and does not support the newer endpoints

Features

  • 🪙 CoinGecko api routes, including current beta
  • ✏️ MyPy Fully typed using most recent versions
  • ⚒️ Modern tooling like uv, ruff, and pre-commit
  • 📥 GitHub Actions CI/CD to automate everything
  • ↩️ Code Coverage Fully tested using tools like Codecov

Installation

$ pip install python-coingecko

Usage

Demo (free)

>>> from pycoingecko import CoinGecko
>>> coingecko = CoinGecko(api_key=<YOUR_API_KEY>)
>>> coingecko.simple.coin_price_by_id(ids="bitcoin")
{
  "bitcoin": {
    "usd": 67187.3358936566,
    "usd_market_cap": 1317802988326.25,
    "usd_24h_vol": 31260929299.5248,
    "usd_24h_change": 3.63727894677354,
    "last_updated_at": 1711356300
  }
}

Pro

>>> from pycoingecko import CoinGecko
>>> coingecko = CoinGecko(api_key=<YOUR_API_KEY>, is_pro=True)
>>> coingecko.coins.recently_added()
[
  {
    "id": "long-johnson",
    "symbol": "olong",
    "name": "Long Johnson",
    "activated_at": 1712562430
  },
  {
    "id": "dogita",
    "symbol": "doga",
    "name": "DOGITA",
    "activated_at": 1712562282
  },
  {
    "id": "bebe-on-base",
    "symbol": "bebe",
    "name": "Bebe on Base",
    "activated_at": 1712561709
  }
]

Development

To develop on this project, you'll need uv installed.

Install dev dependencies

$ uv sync

Run linters black/ruff/isort/mypy

$ make lint-all

Run pytest

$ make test

TODO

APIs

  • Ping ✅
    • Check API server status
  • Simple ✅
    • Coin Price
    • Token Address Price
    • Supported Currencies
  • Coins ✅
    • Coins List
    • Coins List With Market Data
    • Coin Data
    • Coin Tickers
    • Coin Historical Data
    • Coin Historical Chart Data
    • Coin Historical Chart Data Within Time Range
    • Coin OHLC Chart
  • Contract ✅
    • Coin Data
    • Coin Historical Chart Data
    • Coin Historical Chart Data Within Time Range
  • Asset Platforms ✅
    • Asset List
  • Categories ✅
    • List Categories
    • Market Data by Category
  • Exchanges ✅
    • List Exchanges
    • Exchange Data
    • Tickers
    • Volume Chart
  • Derivatives ✅
    • Tickers
    • Derivative Exchanges
    • Derivative Data
  • NFTs (Beta)
    • List NFTs
    • Collection Data
  • Exchange Rates ✅
    • BTC to Currency Rates
  • Search ✅
    • General Search
  • Trending ✅
    • Trending Search
  • Global ✅
    • Global Market Data
    • DeFi Market Data
  • Companies (Beta)
    • Public Companies Holdings
  • Pro
  • Enterprise
  • On Chain

Ops

  • CI for coverage and codecov

Docs

  • Update README
  • Add sphinx

Package

  • Add polrs
  • 100% coverage

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

python_coingecko-0.0.3.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

python_coingecko-0.0.3-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file python_coingecko-0.0.3.tar.gz.

File metadata

  • Download URL: python_coingecko-0.0.3.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for python_coingecko-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4cf1345d8e7175e870b9975b295a34fef6da7f732c95e7656f628e2b44855ac1
MD5 c649090b4d8c847244e755b5f855505c
BLAKE2b-256 b3cdd0ca5df5b78f611925e21e0828014f426e5de562cf9a07280242798a29ad

See more details on using hashes here.

File details

Details for the file python_coingecko-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for python_coingecko-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 14d364e1de0530eeb7c4b45ddd8555e2d91b70e81d54a30b97ce82e18f3128b3
MD5 f94e86f0a9aa09f72d9c6659b3124be1
BLAKE2b-256 5eb951ff808c6e3aac3f3e7030e7e95d6a308b0bfff525d70973bd0c3663a8ac

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