Skip to main content

nhs-number

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

Package Information

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

Documentation

All documentation is available at https://uk-fci.github.io/nhs-number/

Please note that since the demise of the Faculty of Clinical Informatics, the domain uk-fci.tech has been removed from the package and replaced with uk-fci.github.io. This is a temporary measure until we decide what to do with the uk-fci GitHub organisation.

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:

  • Clojure / ClojureScript: wardle/nhs-number by Mark Wardle - validation, formatting and generation of UK NHS Numbers

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

Changelog

https://uk-fci.github.io/nhs-number/

Metadata

Release files for nhs-number 2.2.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 2.2.0
File Size Uploaded
nhs_number-2.2.0.tar.gz 10.2 kB Details

Built distribution (wheel)

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

Total release size: 22.8 kB

Release files / nhs_number-2.2.0.tar.gz

Download URL nhs_number-2.2.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2a88088cb61e7e5cecccdf81cadb36440f5d8031456374fddbbf5f16e49e2e07
BLAKE2b-256 checksum
How to use checksums
009b868621b635dff7d040c3e1f335c4c2d2692b7038c0dd7de210fe2617631a
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 Oct 13, 2026.

Transparency log

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

Download URL nhs_number-2.2.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
809e0b052dcb41bcd656e15c588c91af843267c307318830a88f87b60982843b
BLAKE2b-256 checksum
How to use checksums
991b22c917b341df20aba6827edbf9e9cfedeb3339f9cc629e49229f19048b68
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 Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.0

2 release files

1.3.10

2 release files

1.3.6

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.2.1

2 release files

1.2.0

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