Skip to main content

Validator, generator and parser for Bulgarian unique citizenship numbers (EGN/ЕГН).

Project description


Python package for validating, parsing and generating unique citizenship numbers in Bulgaria EGN (ЕГН).

Български: Скрипт за проверка и генериране на ЕГН / Програма за проверка и генериране на единни граждански номера.

PyPI package Documentation Status


Install the package with pypi.

$ pip install egn


Use it as command line or python package. Here are the options:

Python package

import egn

# Validate
>>> 123123123 is invalid!

# Parsing
>>> ....

# Generating
>>> ....

# Generating with options
egn_options = {'year': 1999, 'month': 3, 'day': 3, 'region': 'Sofia', 'sex': 'm'}
>>> ....

Command line

Invoke the package with simply typing egn:

$ egn

Which will print the help message. Here are the most common commands:

# Validate
$ egn 1234567890

# Parse
$ egn -p 1234567890

# Generate
$ egn -g # random without options
$ egn -g -y 1999 -m 3 -d 3 -r Sofia -s male # with options


  • First step: validation

Project details

Download files

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

Files for egn, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size egn-0.1.3.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page