Ethiopian exchange rate library - fetch rates from NBE and CBE with CLI and GUI
# πͺπΉ ethio-exchange-rates
**Foreign-exchange rates from Ethiopian banks β in Python, on the command line, or in a desktop app.**
**Built with:** Python 3.9+ Β· Requests Β· Tkinter Β· argparse Β· pytest
---
**ethio-exchange-rates** fetches daily rates from the **National Bank of
Ethiopia (NBE)** and the **Commercial Bank of Ethiopia (CBE)** and gives you
three ways to use them: a typed Python client library, a scriptable CLI, and
a point-and-click Tkinter desktop app β all backed by the same well-tested
core.
| Python API | CLI | Desktop GUI |
|:---:|:---:|:---:|
| Typed clients for your own scripts | Perfect for cron jobs & pipelines | Search, quick date presets, one-click export |
## Table of contents
- Features
- Installation
- Usage
- Desktop GUI
- Command line
- Python API
- Notes on the data
- Development
- License
## Features
- π¦ **Two providers, one interface** β `NBEClient` and `CBEClient` share
the same typed request/response contract, so switching banks is a
one-line change.
- π§Ύ **Typed results, not raw dicts** β `ExchangeRateResult` and
`CurrencyRate` dataclasses mean your editor autocompletes fields and
catches typos before runtime.
- π **Resilient by default** β automatic retries with backoff on
transient failures (429/500/502/503/504), sane timeouts, and errors that
never crash your script β a failed fetch returns `success=False` instead
of raising.
- β¨οΈ **Scriptable CLI** β `ethio-exchange-rates fetch --bank nbe` prints a
table, JSON, or CSV, so it drops straight into cron jobs and shell
pipelines.
- π₯οΈ **Desktop GUI** β live search, "Today / Yesterday / -7 Days" quick
filters, and one-click JSON/CSV export for both banks side by side.
- π€ **Reusable export helpers** β `to_json()` / `to_csv()` work the same
whether you call them from the GUI, the CLI, or your own code.
## Installation
```bash
pip install ethio-exchange-rates
```
> **Tkinter note:** the desktop GUI uses Tkinter, which ships with most
> official Python installers. On β¦