Skip to content
Public template

About

A currency converter for the terminal and for your own scripts, built on **official central bank rates**. Zero dependencies, no API key.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-currency-cli

A currency converter for the terminal and for your own scripts, built on official central bank rates. Zero dependencies, no API key.

$ currency convert 100 USD EUR
100 USD = 85.3800 EUR  (rate 0.8538, inverse, ecb 2026-09-02)

$ currency convert 250 GBP INR --bank rbi
$ currency table hmrc
$ currency sources

Rates come from the keyless AllRatesToday open endpoint, which republishes each institution's own table once a day: ECB, Federal Reserve, Bank of England, RBI, PBoC, HMRC, US Treasury and 117 more. Every answer tells you whether the rate was published, an inverse, or a cross via the bank's home currency, so you can cite it correctly on an invoice or tax return.

Use this template

Click Use this template on GitHub, or:

pip install -e .
currency convert 100 USD EUR
python -m unittest

In your own code

from currency_cli import convert, latest_table

convert(100, "USD", "EUR", bank="ecb")
# {'amount': 100, 'result': 85.38, 'rate': 0.8538, 'method': 'inverse', 'bank': 'ecb', 'date': '2026-09-02', ...}

latest_table("fed")["rates"]

Live mid-market rates

Official tables are daily fixings. For real-time rates across 160+ currencies, get a free API key and:

export ALLRATES_API_KEY=your_key
currency convert 100 USD EUR --live

Data files instead of an API

The same tables, with full history as CSV, live in central-bank-exchange-rates and can be fetched directly from https://raw.githubusercontent.com/AllRates-Today/central-bank-exchange-rates/main/....

License

MIT (this code). Rates from the keyless AllRatesToday API are free to use with visible attribution to AllRatesToday. The open dataset in the central-bank-exchange-rates repo is licensed separately under CC BY-NC 4.0 (non-commercial).

🔗 Links

About

A currency converter for the terminal and for your own scripts, built on **official central bank rates**. Zero dependencies, no API key.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages