countrystatecity-currencies
Official Python package for 249 country/currency associations, including currency codes, names, and symbols. Part of the countrystatecity ecosystem.
From offline prototype to production
This package provides a versioned offline snapshot. For regularly updated data, server-side search and filtering, field-selected responses, or managed availability and support, use the Country State City API.
Get a free API key · API docs · Pricing · Migration guide
Keep API keys in server-side environment variables, never in client-side code or source control.
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.
Other Packages in this Ecosystem
| Package | Description |
|---|---|
| countrystatecity-countries | 250 countries, 5,308 states, 171,938 cities |
| countrystatecity-timezones | 432 IANA timezones with country associations and time conversion |
| countrystatecity-translations | 4,724 translations in 19 languages |
| countrystatecity-phonecodes | International phone/dialing codes for 250 countries |
| countrystatecity-regions | Region and subregion associations for 250 countries |
| countrystatecity-postal-codes | Postal/ZIP records for 125 countries |
Data sourced from countries-states-cities-database.
Made with ❤️ by dr5hn
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.5.tar.gz.
File metadata
- Download URL: countrystatecity_currencies-1.0.5.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8913740a5e06ef614333a41c613156dce96e069f7af592477e461bc7fa5914a6
|
|
| MD5 |
fa83855584cbde31ad69e2ef2bf9875a
|
|
| BLAKE2b-256 |
7387ddb1eada3b0aad42d03d04b99316958e02d7cc5aca79aeddf73189081225
|
File details
Details for the file countrystatecity_currencies-1.0.5-py3-none-any.whl.
File metadata
- Download URL: countrystatecity_currencies-1.0.5-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
298afa51058f2b4d881820cfbeb42d2fbb551a07176965cb261bb9c5f9fcc387
|
|
| MD5 |
654863c27bcfbdf44ccd65fb6ca4162d
|
|
| BLAKE2b-256 |
433bb615f8e6ceb212d2f7f7b7f0ff223eadf8476290a620ce62c4ad96c1bec0
|