sciqnt FX source unit — ECB EUR-cross daily reference rates (public, no auth)
Project description
sq-fx-ecb — findings & quirks
Living log. Update when you learn something new about ECB's feed or our handling.
ECB data model
- Daily reference rates published weekdays around 16:00 CET ("close of trading day in the Eurosystem").
- Format:
1 EUR = rate units of CCY. Every rate is EUR-cross. - Daily file:
https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml - 90-day rolling:
…/eurofxref-hist-90d.xml - Full history (since 1999):
…/eurofxref-hist.xml(~1 MB) — wired:asofolder than ~80 days transparently loads this file instead of the 90-day one. Live-verified 2026-06-11: USD→EUR at 2021-03-15, 2005-07-01 and 1999-01-08 all return that day's fixing.
Cache policy
- Daily file: 12h TTL. Survives a re-run within the trading day; refreshes once the next publishing window passes.
- 90-day file: 24h TTL. Rolls daily anyway.
- Cache dir:
~/.cache/sciqnt/fx-ecb/(XDG-style; user-owned, outside the repo, survivesgit clean -fdx). - Writes are atomic (
.tmp+replace) so an interrupted refresh leaves no corrupt XML.
Triangulation
Non-EUR pairs (e.g. USD → GBP) computed via EUR:
rate(USD, GBP) = rate(EUR, GBP) / rate(EUR, USD)
Introduces ~1e-10 rounding (well below money-display granularity). Round-trip (e.g. convert(amount, USD, EUR) then back) does not always equal amount exactly — quantize at display.
Currencies excluded from ECB basket
- RUB — excluded since the 2022 sanctions. Any query for RUB returns
None. - Historically other currencies have entered/left the basket; check the ECB site if a query unexpectedly returns
None.
Open issues / TODO
- Consider intraday — ECB ships a daily fixing only. For live FX-sensitive use,
sq-fx-yfinance(when built) is the better source. - Conformance suite uses fixture XML (no network); add an opt-in integration test (
SQ_FX_ECB_LIVE=1) that hits the real ECB endpoint to detect schema drift early.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sciqnt_fx_ecb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sciqnt_fx_ecb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8c78b1f799944d70dfe80603f9b0cf5f864b6c325a6dc7322d62284170ab446
|
|
| MD5 |
9c89c3849473d0e1e92a9eca06341312
|
|
| BLAKE2b-256 |
11dc236f5060457020234bb5d5110d1c0fc7f04b293d673a745dc41f7c03e037
|