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.0.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

cnp_generator-1.1.0-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

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