Type-safe Python package for currency data with 250+ entries covering currency codes, symbols, and country associations.
Project description
countrystatecity-currencies
Official Python package for currency data — 250+ entries covering currency codes, symbols, and country associations. Part of the countrystatecity ecosystem.
Installation
pip install countrystatecity-currencies
Quick Start
from countrystatecity_currencies import (
get_all_currencies,
get_currency_by_country,
get_countries_by_currency,
search_currencies,
)
# Get all currency entries
currencies = get_all_currencies()
# [Currency(code="AFN", name="Afghan afghani", symbol="؋", countryCode="AF", ...), ...]
# Get the currency for a country
usd = get_currency_by_country("US")
# Currency(code="USD", name="United States dollar", symbol="$", countryCode="US", ...)
# Get all countries using a currency
euro_countries = get_countries_by_currency("EUR")
# [Currency(code="EUR", countryCode="DE", ...), Currency(code="EUR", countryCode="FR", ...), ...]
# Search by code, name, or symbol
results = search_currencies("dollar")
# [Currency(code="USD", ...), Currency(code="CAD", ...), ...]
Data Model
class Currency(BaseModel):
code: str # ISO 4217 currency code (e.g., "USD")
name: str # Full currency name (e.g., "United States dollar")
symbol: str # Currency symbol (e.g., "$")
countryCode: str # ISO2 country code (e.g., "US")
countryName: str # Country name (e.g., "United States")
API Reference
| Function | Description |
|---|---|
get_all_currencies() |
Get all currency entries (one per country) |
get_currency_by_country(code) |
Get the currency for an ISO2 country code |
get_countries_by_currency(code) |
Get all countries using an ISO 4217 currency code |
search_currencies(query) |
Search by currency code, name, or symbol |
License
ODbL-1.0 — see LICENSE.
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 countrystatecity_currencies-1.0.3.tar.gz.
File metadata
- Download URL: countrystatecity_currencies-1.0.3.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0c1d30fbc3c92ad120e4bbdaa86e077c563de35a0b21b9c60955cd59aaf9669
|
|
| MD5 |
d8bccac092c04849a556e959a6fcabfa
|
|
| BLAKE2b-256 |
41cfffdaef7621f3f1161672f6faf4aeff85fc3e753e1a3de3a0e044e3c826ae
|
File details
Details for the file countrystatecity_currencies-1.0.3-py3-none-any.whl.
File metadata
- Download URL: countrystatecity_currencies-1.0.3-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e14635d6e3ceb141fd04b4d5066b20b5db19c9dd4161fe95ed19290bdbcf9379
|
|
| MD5 |
44821f0ab40dcf7563ca9fe8e66d1dc6
|
|
| BLAKE2b-256 |
39e5f49863085eae7a3f08ac1e48869869082cc1be92ae409432b034a7ab516b
|