skillfed

python-stdnum

Python module to handle standardized numbers and codes

python-stdnum v2.2 6.2M downloads/30d#1,961 on PyPI588
Copyleft license LGPL Active released

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-stdnum

uv

uv add python-stdnum

poetry

poetry add python-stdnum

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Financial and Insurance IndustryIntended Audience :: Information TechnologyIntended Audience :: Telecommunications IndustryLicense :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: Office/Business :: FinancialTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: General

Tags

validate tax id numberparse iban bank accountcheck vat number formatidentity card validationstandardized number parserinternational tax identifierfinancial code validator
validationinternational-identifiersfinancial-codes

More Python Modules packages