python-stdnum
Python module to handle standardized numbers and codes
What it is and what it does
python-stdnum is a validation and formatting library for standardized identification and financial numbers used across the world. It handles tax IDs, VAT numbers, bank account identifiers, national identity codes, and other regulated number formats from many countries and regions. The library provides functions to check whether a number is valid according to its format's checksum or structural rules, and to reformat numbers into canonical or display-friendly forms.
The package is designed for developers in finance, insurance, telecommunications, and government sectors who need to validate user input or process international identifiers. It has no external dependencies, installs quickly, and works across modern Python versions. Typical use cases include validating customer tax IDs before submission to authorities, checking IBAN correctness in payment systems, or normalizing identity numbers for database storage.
Use it for:
- Validate a customer's tax ID or VAT number before submitting to a government agency or payment processor.
- Normalize and reformat bank account numbers for consistent storage or display in financial applications.
- Check the structural validity of national identity card numbers during user registration or KYC workflows.
- Parse and validate international business registration numbers in multi-country accounting systems.
- Verify financial security identifiers in trading or portfolio management tools.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses, validates, and reformats standard numbers and codes across many countries and industries—tax IDs, bank accounts, identity numbers, VAT codes, and financial identifiers.
Yes. The package is production-stable, actively maintained, has no dependencies, and solves a real problem for any application handling international identifiers or financial codes. The copyleft license is standard for this type of utility and poses no barrier for most commercial use. Install it if you validate or reformat standardized numbers.
Install
python-stdnum on PyPI
pip
pip install python-stdnumuv
uv add python-stdnumpoetry
poetry add python-stdnumInstalling python-stdnum
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent release and steady commit activity. Supports Python 3.8 through 3.14 and PyPy.
License in practice
Licensed under LGPL (copyleft); you may use it freely but must disclose modifications and license derivative works under LGPL if distributed.
Quickstart
pip install python-stdnum
from stdnum.es import nif
if nif.is_valid('ABC'):
print(nif.format('ABC'))
Verify before relying
- Whether validation rules are kept current with real-world regulatory changes across all supported jurisdictions.
- Performance characteristics when validating large batches of numbers.
- Exact count of supported country formats and number types.
Package facts
| License | LGPL (copyleft) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 222 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,192,662/month — #1,961 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_stdnum-2.2-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
clabeValidates and generates CLABE numbers, Mexico's…
permissive · top 15,000 on PyPI
python-codicefiscaleEncodes and decodes Italian fiscal codes…
permissive · top 15,000 on PyPI
brazilnumValidates and formats Brazilian identification…
permissive · top 15,000 on PyPI
luhnGenerates and verifies Luhn check digits for…
permissive · top 15,000 on PyPI
barcodenumberValidates product codes across multiple barcode…
copyleft · top 15,000 on PyPI
country-converterConverts and matches country names across…
copyleft · top 5,000 on PyPI
vat-utilsProvides Python utilities for VAT (Value Added…
unclear · top 15,000 on PyPI
phonenumbersliteParses, validates, formats, and analyzes…
permissive · top 5,000 on PyPI
numerizeConverts large numbers into human-readable…
permissive · top 15,000 on PyPI
num2wordsConverts numbers to their word representations…
copyleft · top 5,000 on PyPI