Skip to main content

Library that helps working with different identifier types.

Project description

Library that helps working with different entity (legal person, entrepreneur, subject, etc.) identifier types.

Purpose of this library is to validate string if it matches the identifier format and if possible calculate checksum if it is correct for identifier.

Identifier format checking is based on European Central Bank - List of national identifiers spreadsheet.

Identifier format is extended by identifiers issued by Národná banka Slovenska - Národné voľby a špecifiká v projekte AnaCredit.

Currently supported identifiers for checksum calculation: IČO, IČO NI, LEI, NIČ, all available identifiers and their format is listed in file identifier_tools/

Identifier Tools library has support for ISO 7064 standard that is used to validate NIČ, LEI, IBAN among other things… Read more at wikipedia:


Install the released version:

pip install identifier-tools


Basic usage is to verify if the identifier has correct format, or if the identifier can be used in particular country:

>>> from identifier_tools.formats import verify_identifier_format, verify_national_identifier_country
>>> verify_identifier_format(identifier_type="GEN_VAT_CD", identifier="1111")
>>> verify_national_identifier_country(country_code="SK", national_id_type="SK_ICO_CD")

You can list all available identifiers in a particular country. Some countries has multiple identifiers with different priority, you can get the identifier rank as well:

>>> from identifier_tools.formats import get_country_identifiers, get_identifier_rank
>>> get_country_identifiers("DE")
[(1, 'DE_TRD_RGSTR_CD'), (2, 'DE_VAT_CD'), (3, 'DE_TAX_CD'), (4, 'DE_NOTAP_CD')]
>>> get_identifier_rank("DE_TAX_CD")

If you want to manually verify the identifier, it is possible to find a link provided by ECB:

>>> from identifier_tools.mappers import get_verification_register
>>> get_verification_register('SK_ICO_CD')
>>> get_verification_register('US_EIN_CD')
('', '')


We look forward to any kind of improvements and support for new identifiers.

If you do add support for any identifier, checksum, etc. please add a link to the specific documentation that was used for implementation, so we can reference to it.

Clone a repository locally and make sure you work in your own branch and once you are happy with the functionality create pull request. All new code should be covered with tests. We try to use test driven development for the project.

If you find a bug feel free to create an issue with description, how ever we appreciate even more if you create failing test.


Release is done via twine. The whole package is uploaded in the form of .dist file.

To create .dist file use command:

python sdist bdist_wheel

Now our binary .dist file is created, now we need to upload it using the below command:

python -m twine dist/*

Alternatively if you want to selfhost in a custom PyPI repo you can also upload there as well:

python -m twine upload--repository-url dist/* --cert /custom/cert


Tests are written in pytest and stored in tests directory. Library has 100% test coverage. If you found an error, write a failing test first.

Run the tests by following command:

pytest identifier_tools

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

identifier-tools-2.7.0.tar.gz (23.8 kB view hashes)

Uploaded Source

Built Distribution

identifier_tools-2.7.0-py3-none-any.whl (25.8 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