ISO 4217 Currency Data

1.16.20260101 · active · verified Tue Apr 14

The `iso4217` library provides ISO 4217 currency data for Python, represented as an `enum` module. It offers access to current and historical currency codes, names, and numerical values. The library is actively maintained with version `1.16.20260101` and releases new versions regularly to reflect updates to the ISO 4217 standard, typically indicated by a date-based versioning scheme.

Warnings

Install

Imports

Quickstart

The quickstart demonstrates how to import the `Currency` Enum, access specific currencies by their alpha-3 code (e.g., `Currency.USD`), and iterate through all available currencies. Each currency object provides attributes like `currency_name`, `alpha_code`, and `numeric_code`.

from iso4217 import Currency

# Access a currency by its alpha-3 code
usd = Currency.USD
print(f"USD: {usd.currency_name} ({usd.numeric_code})")

# Access a currency by its numeric code (if enum supports it, or by value)
try:
    eur = Currency(978) # Access by numeric value
    print(f"EUR: {eur.currency_name} ({eur.alpha_code})")
except ValueError:
    # If direct numeric access isn't supported, iterate or use a helper (not in this library)
    eur = next((c for c in Currency if c.numeric_code == 978), None)
    if eur:
        print(f"EUR (found by numeric code): {eur.currency_name} ({eur.alpha_code})")

# Iterate through all active currencies
print("\nAll active currencies:")
for currency in Currency:
    print(f"- {currency.alpha_code}: {currency.currency_name}")

view raw JSON →