cryptoprice
A tiny Python SDK to get crypto prices in one line – with retries and a TTL cache. Wraps Alpha Vantage’s free API.
from cryptoprice import CryptoPrice
cp = CryptoPrice(api_key="YOUR_ALPHA_VANTAGE_KEY") # or set env ALPHAVANTAGE_API_KEY
print(cp.get_price("BTC")) # -> 61234.56 (USD by default)
Install
pip install cryptoprice-blockxai
Configure API key
Get a free API key from Alpha Vantage and either:
- Pass directly:
CryptoPrice(api_key="...") - Or set environment variable:
export ALPHAVANTAGE_API_KEY=...
Docs: https://www.alphavantage.co/documentation/
Why this exists
- Built-in retry-on-failure (including 429/503)
- Fast repeated calls via TTL cache (default 15s)
- Simple, production-ready interface
API
CryptoPrice(vs_currency="usd", ttl_seconds=15.0, api_key=None): sync clientget_price("BTC") -> float
CryptoPriceAsync(...).get_price("ETH") -> float: async variant
Notes
- Default
vs_currencyis USD. Override withvs_currency="EUR", etc. - Alpha Vantage endpoint used:
CURRENCY_EXCHANGE_RATE. - Respect free API rate limits. Keep a reasonable TTL in production.
Development
python -m venv .venv && . .venv/bin/activate
pip install -e .
pip install pytest respx
pytest
License
MIT
Metadata
Release files for cryptoprice-blockxai 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cryptoprice_blockxai-0.1.1.tar.gz | 5.0 kB | Without provenance | Details for cryptoprice_blockxai-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cryptoprice_blockxai-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for cryptoprice_blockxai-0.1.1-py3-none-any.whl |
Total release size: 10.1 kB
Release files / cryptoprice_blockxai-0.1.1.tar.gz
| Download URL | cryptoprice_blockxai-0.1.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cebc32910b8f0fb649c71b593cc6cb973fb6d8668ae9870a309bb863c7948c25
|
|
BLAKE2b-256 checksum How to use checksums |
5a91f5e43bda1c559c5b8482fc4b05ea87e568ffc4a68af38fba82e7b5aec85c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / cryptoprice_blockxai-0.1.1-py3-none-any.whl
| Download URL | cryptoprice_blockxai-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e81af4ef77d64101835d89b6ba04c1cda65d71dc027aa59cb71c9bf1f4cead57
|
|
BLAKE2b-256 checksum How to use checksums |
6cc45369b92a12bffb6e1f3c54dd2b55bd603e0328d63a00600b1e044ffc3470
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for cryptoprice-blockxai 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.