Skip to main content

Type-safe Python package for currency data with 250+ entries covering currency codes, symbols, and country associations.

Project description

countrystatecity-currencies

PyPI version Python versions

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

countrystatecity_currencies-1.0.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

countrystatecity_currencies-1.0.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file countrystatecity_currencies-1.0.0.tar.gz.

File metadata

File hashes

Hashes for countrystatecity_currencies-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b79dbe8167046039666bcf8953354b8dce8e5f043d5d8633b19bb81cea98cea3
MD5 68ae5b5f1e015b886e2a205fd76d0c60
BLAKE2b-256 04c81e199f0ccebc72bcefa8ab1057039626b3c48bc7338044125334a0cac9b8

See more details on using hashes here.

File details

Details for the file countrystatecity_currencies-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for countrystatecity_currencies-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01112e1b9e763c88b0134ecbc5ab190d31fd72ed9f66a4e8c5ace686ee5509f8
MD5 c7e1c380d4af3a03e51b803f65321480
BLAKE2b-256 4335275b18eb4ffb1f946685d8b03c199b879ceb4a58d18963a76fbe319de656

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page