Skip to main content

Romania CNP number generator and decoder.

Project description

CNP generator and decoder

📖 About

Cnp-generator package contains both a Python lib and CLI tool for generate and decode CNPs.

With CLI tool you can:

  • generate a valid CNP based on gender, region, and birth date.
  • check if a CNP is valid
  • decode CNP information
  • generate random CNPs for testing purposes

Python lib contains Cnp class that will provide all functionalities available in tool to be used in code.

💻 Tool Usage

Run CNP tool with:

python -m cnpgen

Available options:

-h --help   Show help.
--version   Show program version.
-c          Start new CNP wizard. Guided wizard for genereating a CNP based on input info.
-g N        Generate N random CNPs.
-i CNP      Show relevant information about CNP. 

🧪 API Usage

Quick start

from datetime import date
from cnpgen import Cnp, Gender, Region
print(Cnp(Gender.F, date(1993, 3, 4), Region.Bucuresti))

>>> 2930304400014

Full documentation

Soon available on Readthedocs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cnp-generator-1.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cnp_generator-1.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file cnp-generator-1.1.1.tar.gz.

File metadata

  • Download URL: cnp-generator-1.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for cnp-generator-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b7a6befd8bce9e20f26fed5a937df12a5c30e94d962293d1f097396ba3e2dc8c
MD5 e66101a949c5b94158ac8038a74fa981
BLAKE2b-256 86ccd504de28b24eab173dbc06f6ab380ecce9d9c81ef1cd8ae07e523e5d4374

See more details on using hashes here.

File details

Details for the file cnp_generator-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: cnp_generator-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for cnp_generator-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e22cb7fb86d10315d9a379a4507fd3e25af1a5b330c353d61a209a7a8e8fcb1e
MD5 24f61f7c9078e115328ee957a591d445
BLAKE2b-256 14e6b32ee10522d79f64dae3a6fd9ca555c6c282c9e44943b6322777b16c81be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page