Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 1.55 KB

File metadata and controls

72 lines (48 loc) · 1.55 KB

ecbx

Fetch and query exchange rate data published by the European Central Bank.

Rates are stored locally in a SQLite database and can be queried offline. Cross-rates between non-EUR currencies are calculated from their respective EUR reference rates.

Usage

Initialize the local database

Downloads the full historical dataset (~27 years of daily rates):

ecbx initialize

Update to the latest rates

ecbx update

Show database status

ecbx status
ecbx --verbose status   # also lists all available currencies

Convert between currencies

The date argument is currently required in practice — defaulting to the latest available rate when no date is given is a known limitation.

# Specific date
ecbx convert 2024-01-05 EUR USD 100

# Compact date format also works
ecbx convert 20240105 EUR USD 100

List all rates for a date

# Latest available date
ecbx rates

# Specific date
ecbx rates 2024-01-05

Show a full rate matrix for a base currency

ecbx matrix 2024-01-05 USD
ecbx matrix --format json 2024-01-05 USD

List available currencies

ecbx currencies

Options

Option Description
--db PATH Use a custom database file instead of the default XDG path
--verbose Show additional information

The default database is stored at $XDG_CONFIG_HOME/ecbx/rates.db (usually ~/.config/ecbx/rates.db).