Skip to main content

nhs-number

Python package to provide utilities for NHS Numbers, including validity checks, normalisation, and generation.

Project stewardship

nhs-number is managed by the Open Health Technology Foundation (CIC) (OHTF).

Major announcements affecting users or contributors, such as releases with breaking changes or a change of project stewardship, are also published on openhealthtechnology.org. Website updates are made in ohtf/openhealthtechnology.org-website.

Package Information

License Licence type badge Version Version badge
Supported versions Coverage
Wheel Implementation
Status Downloads

Documentation

All documentation is available at https://ohtf.github.io/nhs-number-py/.

Implementing this in another language?

Please do - and you are welcome to build on our work. We publish a language-agnostic test vector file capturing how this library behaves (checksums, standardisation, validity, CHI date-of-birth rules, regions and range boundaries), so a port in any language can check itself against the same definition of correct.

It is MIT licensed, like the rest of the project: use it freely, no permission needed. Attribution is appreciated but not required. See Implementing an NHS Numbers package in other languages for what the vectors cover, what is deliberately left out and why, and how to use them.

Other libraries

Similar libraries for other languages:

If you maintain one we have missed, please open an issue and we will add it.

Changelog

https://ohtf.github.io/nhs-number-py/changelog/

Metadata

Release files for nhs-number 3.0.0

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

Source distribution (sdist)

Source distribution for nhs-number 3.0.0
File Size Uploaded Provenance Actions
nhs_number-3.0.0.tar.gz 11.4 kB With provenance Details for nhs_number-3.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nhs-number 3.0.0
File Interpreter ABI Platform Actions
nhs_number-3.0.0-py3-none-any.whl Python 3 none any Details for nhs_number-3.0.0-py3-none-any.whl

Total release size: 25.0 kB

Release files / nhs_number-3.0.0.tar.gz

Download URL nhs_number-3.0.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
18d36636a6904e5a1572cc8e6e645c51358bfce7688af9413909f34c8d34d5db
BLAKE2b-256 checksum
How to use checksums
b7d3741e9669d961f4640b1ee0dbbb5774c1f16e10ae31d6ef3cbdcc5ce9e46b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Release files / nhs_number-3.0.0-py3-none-any.whl

Download URL nhs_number-3.0.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7b44b8928c23736fb3dbc19ec8c6c9fa26591b6a2ac14145bdeff25eebd0549
BLAKE2b-256 checksum
How to use checksums
ceac9d22987e49d8b758afb7c391a9aa4d654c433c4a8d6cce49f7ed66f0b420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Security for nhs-number 3.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nhs_number-3.0.0.tar.gz

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 Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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