aeat.adapters.outbound.fx._ecb_provider module¶
ECB euro reference-rate exchange-rate provider.
Implements the domain.currency.ExchangeRateProvider protocol over a
bundled snapshot of the European Central Bank euro foreign-exchange reference
rates (eurofxref XML). The ECB rates are the official exchange rate of
Spanish law (Ley 46/1998 art. 36) accepted for IRPF, IVA, and PGC conversion —
see the ledger-fx-conversion ADR.
The ECB publishes EUR-base quotes (1 EUR = rate CCY). The
domain.currency.CurrencyNormalizationService expects
get_eur_rate to return CCY->EUR (so eur = amount * rate), so this provider
returns 1 / ecb_rate. The ECB publishes only on TARGET working days, so a
lookup for a non-publication date falls back to the most-recent prior published
date.
- class EcbReferenceRateProvider(*, rates_path=None)[source]¶
Bases:
objectEUR reference-rate provider backed by a bundled ECB
eurofxrefsnapshot.- Parameters:
rates_path (Path | None)
- default_ecb_rate_provider()[source]¶
Return the process-wide
EcbReferenceRateProviderover the bundled ECB snapshot (cached).- Return type: