Skip to main content

python-kennitala is a python library for common operations on Icelandic National Registry codes - kennitala.

Capabilities

  • Validation of kennitala

  • Extraction of birth date from kennitala

  • Generating kennitala for a given birth date (for people or companies)

  • Generating random kennitala (for people or companies)

  • Recognize if kennitala belongs to person or company

Usage

>>> from datetime import date
>>> from kennitala import Kennitala
>>>
>>> kt_no = '0101109639'
>>> kennitala = Kennitala(kt_no)
>>> kennitala.validate()
True
>>> kennitala.get_birth_date()
datetime.date(1910, 1, 1)
>>> kennitala = Kennitala(kt_no.replace('3', '4'))
>>> kennitala.validate()
False
>>> kennitala.get_birht_date()
Traceback (most recent call last):
    File kennitala.py, in get_birth_date
kennitala.Invalid
>>>
>>> company_kt = Kennitala.generate(date.today(), person=False)
>>> Kennitala.is_personal(company_kt)
False

Installation

inside your virtualenv execute:

$ pip install kennitala

or download and install manually.

Tests

Tests are written for py.test

To run tests simply execute:

$ PYTHONPATH=./ py.test tests

Metadata

Release files for kennitala 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kennitala 0.2.0
File Size Uploaded Provenance Actions
kennitala-0.2.0.tar.gz 5.6 kB Without provenance Details for kennitala-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kennitala 0.2.0
File Interpreter ABI Platform Actions
kennitala-0.2.0-py3-none-any.whl Python 3 none any Details for kennitala-0.2.0-py3-none-any.whl

Total release size: 10.0 kB

Release files / kennitala-0.2.0.tar.gz

Download URL kennitala-0.2.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1288a2c3237e6156db66dc1483be1896a27b00b238d8de489f2bd03f3c57702b
BLAKE2b-256 checksum
How to use checksums
2091541990531c7ab99411f989ec56d651bf37fc5e225ade5521fd5d7ae35b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / kennitala-0.2.0-py3-none-any.whl

Download URL kennitala-0.2.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5fba5ac4c1ab8b21af2aae9a229eefa1d149ea60fb0b3afcb6156e30d902ff3
BLAKE2b-256 checksum
How to use checksums
b8ca56cdec89322002265504e1ec8e6733478615c373e59725a0a6c822ec1a5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Security for kennitala 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page