Numista API wrapper
Project description
numistalib
Python wrapper for the Numista API with caching, rate limiting, and retry logic.
📖 Documentation
Read the Docs — Complete documentation with search, versioning, and offline formats.
Quick Links:
Features
- Complete API Coverage: Search types, get details, catalogues, issuers, and more
- HTTP Caching: RFC 9111-compliant persistent caching with hishel
- Rate Limiting: Configurable rate limits to respect API quotas
- Retry Logic: Exponential backoff with jitter for resilient requests
- Rich CLI: Beautiful command-line interface with tables and colors
- Type Safety: Full Pydantic models with strict validation
Installation
uv pip install -e .
Configuration
-
Get your API key from Numista API
-
Copy
.env.exampleto.env:cp .env.example .env
-
Add your API key to
.env:NUMISTA_API_KEY=your_api_key_here
CLI Usage
Search for types
numistalib types search -q "dollar"
numistalib types search --issuer united-states --year 2020
Get type details
numistalib types get 95420
List catalogues
numistalib catalogues
List issuers
numistalib issuers
numistalib issuers --lang es
Configuration management
numistalib config list
numistalib config get cache_dir
Python Usage
from numistalib.client import NumistaApiClient
from numistalib.config import Settings, logger
from numistalib.services import TypeService
settings = Settings()
with NumistaApiClient(settings, logger) as client:
service = TypeService(client, logger)
# Search for types
results = service.search_types(query="dollar", page=1, count=10)
for coin_type in results:
print(f"{coin_type.numista_id}: {coin_type.title}")
# Get full details
full_type = service.get_type(95420)
print(f"Weight: {full_type.weight}g")
print(f"Composition: {full_type.composition}")
Development
Install dependencies
uv sync
Run tests
uv run pytest tests/ -v
Check code quality
uv run ruff check src/
uv run ruff format src/
uv run pyright src/
Check complexity
uv run radon cc src/numistalib/ -a -nb
uv run xenon --max-absolute B src/numistalib/
Architecture
- models/: Pydantic models for API entities
- client.py: HTTP client with caching, rate limiting, retry
- services/: Business logic for each API endpoint
- config.py: Settings management with Pydantic BaseSettings
- cli/: Click-based command-line interface
License
MIT License - see license.txt
Contributing
Legal & Attribution
- Unofficial: This library is an independent, community project and is not affiliated with Numista.
- Attribution: Numista is a trademark/service of Numista. Please attribute Numista when data from their API is displayed.
- Terms: Users of this library must comply with Numista’s published terms. Review:
- Conditions of use: https://en.numista.com/conditions.php
- Legal information: https://en.numista.com/legal.php
- Pricing API terms: https://en.numista.com/api/pricing.php
- Data usage: Follow Numista’s guidelines for caching, rate limits, and redistribution. If Numista’s terms restrict retention or republication (especially for pricing), configure your deployments accordingly.
- Rate limiting: This project implements conservative rate limiting by default; always respect Numista’s limits and guidance.
See AGENTS.md for coding standards and guidelines.
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 numistalib-0.1.1.tar.gz.
File metadata
- Download URL: numistalib-0.1.1.tar.gz
- Upload date:
- Size: 161.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0905d31df236a2b016ab1e8b554abd843e65a693ae411e0b6d857b3ad066d1c0
|
|
| MD5 |
cf196f8d907ce1d0a9d00a56733855ff
|
|
| BLAKE2b-256 |
3b0ffe2f18c0fe16588818b747cc78fba9b6b96d5b84dfd7a4a6a8a754528385
|
Provenance
The following attestation bundles were made for numistalib-0.1.1.tar.gz:
Publisher:
release.yml on wells01440/numistalib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
numistalib-0.1.1.tar.gz -
Subject digest:
0905d31df236a2b016ab1e8b554abd843e65a693ae411e0b6d857b3ad066d1c0 - Sigstore transparency entry: 780826636
- Sigstore integration time:
-
Permalink:
wells01440/numistalib@2012d98f6260626239039a46647fd308d8c25ddb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/wells01440
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2012d98f6260626239039a46647fd308d8c25ddb -
Trigger Event:
push
-
Statement type:
File details
Details for the file numistalib-0.1.1-py3-none-any.whl.
File metadata
- Download URL: numistalib-0.1.1-py3-none-any.whl
- Upload date:
- Size: 89.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c93637acf414514318e88b55762e98ecca5f33c0cf9bfce57603ea2fde7c1f2
|
|
| MD5 |
79de3447b6192394097e1675fbcab132
|
|
| BLAKE2b-256 |
5ddad4246dff74e14300b6a95ed48c94a0166288063d9f239d6336a678fdd991
|
Provenance
The following attestation bundles were made for numistalib-0.1.1-py3-none-any.whl:
Publisher:
release.yml on wells01440/numistalib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
numistalib-0.1.1-py3-none-any.whl -
Subject digest:
3c93637acf414514318e88b55762e98ecca5f33c0cf9bfce57603ea2fde7c1f2 - Sigstore transparency entry: 780826640
- Sigstore integration time:
-
Permalink:
wells01440/numistalib@2012d98f6260626239039a46647fd308d8c25ddb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/wells01440
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2012d98f6260626239039a46647fd308d8c25ddb -
Trigger Event:
push
-
Statement type: