romanian-cnp-validator
Validate, parse and generate Romanian personal numeric codes (CNP). Zero dependencies, fully typed, Python 3.11+.
pip install romanian-cnp-validator
from romanian_cnp_validator import is_valid, validate, parse, generate
is_valid("1900101120013") # True
validate("9900101120011").error # CnpError.NIF_NOT_CNP
parse("1900101120013").county.name # 'Cluj'
generate(sex="female", min_age=18, max_age=30)
The full documentation lives in the main README. It covers how a CNP is built, the control-digit algorithm, edge cases (foreign residents, code 70, NIF numbers) and the official sources behind every rule.
MIT License, Copyright (c) 2026 Andrei-Florin Opriș
Metadata
Release files for romanian-cnp-validator 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| romanian_cnp_validator-1.0.0.tar.gz | 8.6 kB | With provenance | Details for romanian_cnp_validator-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| romanian_cnp_validator-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for romanian_cnp_validator-1.0.0-py3-none-any.whl |
Total release size: 19.7 kB
Release files / romanian_cnp_validator-1.0.0.tar.gz
| Download URL | romanian_cnp_validator-1.0.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49d0e60ef205160a2ccecdf6fe6b2abd3a79f8236275e54ab519329ea070eea4
|
|
BLAKE2b-256 checksum How to use checksums |
544d2a10e274b01d6d2e62b61c2accfc15a53b5078621cab8e92946c0489c250
|
| 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 Dec 2, 2026.
Transparency logRelease files / romanian_cnp_validator-1.0.0-py3-none-any.whl
| Download URL | romanian_cnp_validator-1.0.0-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d2f895c46466656411a609a84291592130b8b1c8cf6dfb214c76a0d367b3557
|
|
BLAKE2b-256 checksum How to use checksums |
8ffee4c40e695f2afbd229e774e03a1a09660d2ef829ce5a87c5679446451f53
|
| 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 Dec 2, 2026.
Transparency logSecurity for romanian-cnp-validator 1.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.
Attestation for romanian_cnp_validator-1.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 Dec 2, 2026.
Transparency logA 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.