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 …