Registry / serialization / iso4217

iso4217

JSON →
library1.16.20260101pypypi✓ verified 84d ago

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.

pip install iso4217
INSTALL
IMPORT
SIG · ISO4217
I
iso4217
serializationpythonv1.16.20260101
Install
1.6s avg
Import
126ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.16.20260101 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.133s · 17.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.118s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Currency
from iso4217 import Currency
from iso4217 import find_currency
The `iso4217` package by dahlia exposes currencies as an `Enum`. Functions like `find_currency` or `iter_currency` belong to other, similarly named libraries (e.g., `python-iso4217`) with different APIs.

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}")
Debug
Known issues
gotchaThere are several Python packages with similar names (e.g., `python-iso4217`, `iso_4217`, `iso4217parse`) that provide ISO 4217 data but have distinct APIs and features. Ensure you are using the `iso4217` package by `dahlia` to avoid unexpected behavior or import errors.
fix
Always verify the import paths and API calls against the specific package's documentation or by inspecting the package content. For `dahlia/iso4217`, currencies are typically accessed as members of an `Enum`.
affects: All versions
gotchaISO 4217 currency data is subject to periodic amendments (e.g., currency adoptions, withdrawals). Relying on an outdated version of the `iso4217` package can lead to incorrect or incomplete currency information.
fix
Regularly update the package to its latest version (`pip install --upgrade iso4217`) to ensure you have the most current ISO 4217 data. The package's versioning (e.g., `1.16.YYYYMMDD`) often indicates the date of the data snapshot.
affects: < 1.16.20260101
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'iso4217'
The `iso4217` library is not installed in the Python environment, or the environment where the code is run does not have access to the installed package.
fix
Install the library using pip: `pip install iso4217`
ValueError: 'XYZ' is not a valid Currency
This error occurs when attempting to create a `Currency` enum member or look up a currency by a code ('XYZ' in this example) that is not a recognized, valid ISO 4217 currency code within the library's dataset. This includes codes that are misspelled, do not exist, or are not in the expected three-letter uppercase format.
fix
Ensure the currency code is a correct, three-letter uppercase ISO 4217 code. For example, to access the US Dollar, use `iso4217.Currency('USD')` or `iso4217.Currency.USD`.
AttributeError: 'Currency' object has no attribute 'some_invalid_attribute'
You are trying to access an attribute on a `Currency` enum member that does not exist. Users often guess attribute names or use incorrect casing (e.g., `iso4217.USD.code` instead of `iso4217.USD.alpha3`).
fix
Refer to the library's documentation to use the correct attribute names. Common attributes are `alpha3`, `currency_name`, `numeric_code`, `minor_unit`, and `country_name` (if applicable).
AttributeError: type object 'Currency' has no attribute 'LTL'
This error specifically occurs when trying to access an obsolete currency code (like 'LTL' for Lithuanian Litas, which was replaced by EUR) directly as an attribute on the `iso4217.Currency` enum, assuming it should still be a direct member. By default, the `iso4217.Currency` enum primarily exposes *current* currency codes.
fix
To access historical or obsolete currencies, you might need to use a specific method or a separate collection provided by the library for historical data, if available. For current currencies, ensure you are using an up-to-date, active ISO 4217 code. The library's enum typically only includes currently active currencies directly.
Upgrade
Version history
1.16.20260101latest on PyPI · released Mar 3, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
iso4217 — pip install iso4217 · libregistry