Minimal CoinGecko-backed token metadata cache for Python.
Project description
GeckoRS
geckors is a small Python wrapper around CoinGecko's public API for token metadata.
It is designed for:
- resolving a ticker or CoinGecko ID into a token
- caching token metadata locally in SQLite
- keeping dependencies minimal
- exposing a simple object API for common fields such as contract addresses, decimals, and supply
The project is intentionally metadata-focused. It does not try to be a full market-data client.
Features
- CoinGecko-backed token lookup
- local SQLite cache
- normalized contract storage in
token_contracts - alias resolution in
token_aliasesso repeated lookups are deterministic - high-level
Tokenobject with useful properties - bulk population helpers
- rate-limit-safe bulk fetch behavior
Installation
Using uv:
uv sync
Or install the package in editable mode:
uv pip install -e .
Quick Start
from geckors import Token
token = Token("ETH")
print(token.id)
print(token.name)
print(token.contract_addresses)
print(token.decimals)
print(token.max_supply)
Useful properties on Token include:
idsymbolnamemarket_cap_rankasset_platform_idcontract_addressesplatform_detailsdecimalscirculating_supplytotal_supplymax_supplycategorieslinkshomepagedescriptiondeveloper_datacommunity_datapublic_interest_statsraw
Example:
from geckors import Token
token = Token("DAI")
print(token.get_address("ethereum"))
print(token.contract_addresses)
Bulk Population
Populate from symbols:
from geckors import populate_tokens
result = populate_tokens(["BTC", "ETH", "DAI", "WETH"])
print(result)
Populate from explicit CoinGecko IDs:
from geckors import populate_token_ids
result = populate_token_ids(["bitcoin", "ethereum", "dai"])
print(result)
populate_tokens() returns structured results for:
- resolved queries
- inserted IDs
- skipped rows already in cache
- unresolved queries
- ambiguous symbols
- failed requests
- rate-limit state
Storage
By default the SQLite database is stored in the platform data directory:
- Linux/BSD:
~/.local/share/geckors/gecko_rs.dbor$XDG_DATA_HOME/geckors/gecko_rs.db - macOS:
~/Library/Application Support/geckors/gecko_rs.db - Windows:
%LOCALAPPDATA%/geckors/gecko_rs.db
Override order:
GECKO_RS_DBconfig.jsonin the config directory- platform data directory default
Current tables:
tokens: canonical token metadata keyed by CoinGecko IDtoken_contracts: normalized chain/address/decimals rowstoken_aliases: query-to-token resolution cache
CoinGecko Notes
- CoinGecko ID is the stable internal identity in this project. Symbols are only lookup hints.
- Native assets like
ETHmay not have token contract addresses. CoinGecko often returns an empty placeholder for those;geckorsfilters that out. - Contract coverage is limited to what CoinGecko currently lists for that specific asset ID.
- A successful response is not partially truncated by rate limiting. If CoinGecko rate-limits a request, the request fails.
Rate Limits
This project uses CoinGecko public endpoints. Public usage is rate-limited.
Bulk helpers are defensive:
- they stop cleanly on HTTP 429 by default
- they return a structured summary instead of crashing the whole run
You can also provide:
COINGECKO_DEMO_API_KEYCOINGECKO_PRO_API_KEY
if you have one.
Development
Run tests:
uv run python -m unittest discover -s tests -v
Run the example entrypoint:
uv run python main.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geckors-0.1.0.tar.gz.
File metadata
- Download URL: geckors-0.1.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf2cc416eb87b88fbb1c19545a44e85e852abe066c892bebc4877e7ae8cc95b1
|
|
| MD5 |
be81b81b71a6edad232f4beedb598328
|
|
| BLAKE2b-256 |
40a261c994a297b55a07d55ddf4a5cff8d7046daf2f48c95c440af9e52c2e582
|
File details
Details for the file geckors-0.1.0-py3-none-any.whl.
File metadata
- Download URL: geckors-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26b18d6ad58d829da8e420ce1f90372672f082ec2e02fe6cd7c77dc0f73d8c96
|
|
| MD5 |
94c54872b45b96cbabd898fcb97437dc
|
|
| BLAKE2b-256 |
aeac594c84b0542a2952f6399b178f313f5ed658bb87f1c3efdc8dc0c624ac88
|