Metadata-Version: 2.4
Name: boe-exchange-rate
Version: 1.0.0
Summary: Official Bank of England exchange rates - ~23 currencies vs GBP, history since 2016. Keyless, zero-dependency Python client.
Author-email: AllRatesToday <info@allratestoday.com>
License-Expression: MIT
Project-URL: Homepage, https://allratestoday.com/central-bank-rates-api/boe/
Project-URL: Documentation, https://allratestoday.com/docs
Project-URL: Repository, https://github.com/AllRates-Today/exchange-rates-api
Project-URL: Issues, https://github.com/AllRates-Today/exchange-rates-api/issues
Keywords: allratestoday,bank,boe,central-bank,currency,england,exchange-rate,exchange-rates,forex,fx,gbp,official-rates
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Office/Business :: Financial :: Accounting
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# boe-exchange-rate

**Official Bank of England exchange rates — ~23 currencies vs GBP, history since 2016.**

```bash
pip install boe-exchange-rate
```

```python
from boe_exchange_rate import get_rate

pair = get_rate("GBP", "USD")
print(pair["rate"], "published", pair["rate_date"])
```

**No API key needed** for the latest published table.

## What these rates are

The numbers Bank of England itself publishes — fixed once published, carrying the
institution's own date. Tax filings, customs valuations, invoicing rules and
statutory accounts generally require this published rate, not a live market
rate; the two routinely differ by a percent or more.

For live mid-market rates, use [`allratestoday`](https://pypi.org/project/allratestoday/).
For all 100+ sources in one package, use
[`allratestoday-central-bank`](https://pypi.org/project/allratestoday-central-bank/).

## API

| Function | API key? | Returns |
|---|---|---|
| `get_latest_rates()` | no | Newest published table |
| `get_rate(source, target)` | no | One pair from it |
| `get_rates_for_date(date, ...)` | yes | The table in force on a date |
| `get_history(symbol=..., from_date=..., to_date=...)` | yes | Date-by-date official series |

Keyed calls read `api_key=` or the `ALLRATES_API_KEY` environment variable.
Get a free key at <https://allratestoday.com/register> (no card).

## Three things that will bite you

1. **`rate_date` is the answer, not the date you asked for.** Bank of England publishes
   on business days only, so a weekend request returns the last published table.
   Record the date that comes back — it is the audit trail.
2. **`derived: True` means the pair was cross-computed** within Bank of England's own
   table because it does not publish that pair directly. Rates are never crossed
   between institutions.
3. **Zero dependencies** — standard library only, so it adds nothing to your
   lockfile.

## Links

- Coverage and docs: <https://allratestoday.com/central-bank-rates-api/boe/>
- Node.js equivalent: [`boe-exchange-rate`](https://www.npmjs.com/package/boe-exchange-rate) on npm

MIT licensed. Rates are served as published by Bank of England; AllRatesToday is not
affiliated with it.
