Currency data¶
Source¶
currencies.yml is generated from two XML lists published by SIX, the ISO 4217 maintenance agency:
- List One: current currencies and funds, one entry per entity that uses each currency.
- List Three: historic denominations, with their withdrawal dates.
The file's header records the publication date of each list. The current file uses List One published 2026-09-17 and List Three published 2026-01-01.
Entities with no universal currency, such as Antarctica, have no code and are left out.
Updating¶
Do not edit currencies.yml by hand. From the module root:
The script downloads both lists from SIX and rewrites the file. To use files you have already downloaded:
Then:
- Read the diff. Note codes that were added, codes that moved from List One to List Three, and renamed currencies.
- Run the tests (
ddev phpunitorvendor/bin/phpunitin a Drupal codebase). Some test fixtures name specific currencies. - Commit the file with the added and withdrawn codes in the commit message, and list them in the changelog.
ISO publishes amendments several times a year. Check for a new list before each release.
What an update changes on a site¶
- A newly withdrawn currency drops out of the widget for new values. Items that store it keep it, and it stays valid.
- A new currency appears in the widget.
- A renamed currency changes its label in the widget and formatter. Stored codes do not change.
- No code is ever removed from the file, since List Three keeps withdrawn codes, so stored values keep validating.
The decoded list is cached under a key that includes the file's modification time, so a deployed file is read without a cache rebuild. Pages already in the render cache keep their old labels until it is cleared.
Changes since 2.0.0¶
The 2.0.0 file was a 2018 copy of the datasets/currency-codes CSV. Regenerating it from the 2026 lists:
| Change | Codes |
|---|---|
| Added | SLE (Sierra Leone), VED (Venezuela, BolĂvar Soberano), XAD (Arab Accounting Dinar), XCG (Caribbean Guilder), ZWG (Zimbabwe Gold) |
| Withdrawn | ANG (2025-03), BGN (2026-01), CUC (2021-06), HRK (2023-01), SLL (2023-12), ZWL (2024-09) |
| Euro adopted | Croatia (2023), Bulgaria (2026) |