Skip to main content

uk-bank-rate

The UK Bank Rate from the Bank of England's own data, using the standard library alone, and honest about the hours after a decision.

pip install uk-bank-rate
from uk_bank_rate import bundled_history, get_bank_rate, rate_on

current = get_bank_rate()
covid_low = rate_on(bundled_history, "2020-03-15")

get_bank_rate() returns the rate today, the day it took effect, the last day the published series covers, the next scheduled decision, and a pending_decision that is set whenever a decision has been announced, or is due, that the published data does not reflect yet, and a beyond_schedule flag for dates past both the data and the published schedule. The Committee announces at 12:00 London time and the series can lag by a working day or two, so a client that reads only the latest row reports the old rate for that whole window without knowing it.

rate_on() answers the rate on any date since 2 January 1975 from a bundled history of every change, with no network call. Dates come back as datetime.date and rates as Decimal, so interest worked out from them does not drift. Every failure to reach the Bank raises BankRateSourceError with a failure of http, not_csv, empty, timeout or network.

The Bank's firewall refuses Python's default urllib user agent with 403 Access Denied, which is why so many hand-written scripts pretend to be a browser. This package sends its own honest one instead. It needs Python 3.11 or later and nothing outside the standard library, apart from tzdata on Windows, which ships no time zone database.

The full guide, the TypeScript package and the design notes are in the repository.

Contains data from the Bank of England Database, licensed under the Open Government Licence v3.0 and copyright the Governor and Company of the Bank of England. Not affiliated with or endorsed by the Bank of England. Code released under the MIT licence.

Developed by Bhupen Varsani.

Metadata

Release files for uk-bank-rate 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uk-bank-rate 0.2.1
File Size Uploaded
uk_bank_rate-0.2.1.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uk-bank-rate 0.2.1
File Interpreter ABI Platform
uk_bank_rate-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / uk_bank_rate-0.2.1.tar.gz

Download URL uk_bank_rate-0.2.1.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2096abe5f593ad644e4a2db6f138370b2e7755cbefe773d20840c9f2f2a0c85b
BLAKE2b-256 checksum
How to use checksums
0eb70e5432c970527259add5d723576350a725cfa373c3c19f2b83a5afb87d93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / uk_bank_rate-0.2.1-py3-none-any.whl

Download URL uk_bank_rate-0.2.1-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f54653cf1cbc83b24c1020734f22b75c37de0919adca11ff84da4a66db92c8eb
BLAKE2b-256 checksum
How to use checksums
4f17d909b41406ae50090c6e4860714967f2e0b83ebb8843afd55c734b00c02c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

This release

0.2.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page