Module for making and verifying KID numbers
Project description
KID util
Development moved to PyPi package norwegian-numbers: GitHub PyPi
Simple utils to generate and verify KID numbers with either MOD10 or MOD11.
Installation
To install from PyPi as a module in your environment:
pip install kid-util
To install from source as a module in your environment:
python setup.py install
Code usage from installation
Example code usages after installation:
>>> import kid
>>> kid.make('1234')
'12344'
>>> kid.make('1234', mode='MOD11')
'12343'
>>> kid.verify('12344')
True
>>> kid.verify('12343', mode='MOD11')
True
Running from command line
Generating KID from integer string:
$ python -m kid -g 2345678
23456783
$ python -m kid -m mod11 -g 2345678
23456788
Verifying KID from string:
$ python -m kid -v 23456783
True
$ python -m kid -v 23456788
False
$ python -m kid -m mod11 -v 23456788
True
$ python -m kid -m mod11 -v 23456783
False
Testing from source
To run the tests:
python -m unittest discover
Or if you have tox:
tox
Distribution
The distribution was created by the following commands:
python setup.py sdist bdist_wheel
python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kid-util-1.0.1.tar.gz.
File metadata
- Download URL: kid-util-1.0.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25fa8fdf4e1bb0d1efa768688f7e8ad853067253a6cd2b1b37d115524801ee9f
|
|
| MD5 |
0230f6b72c28cab547ab6153f0b6ac84
|
|
| BLAKE2b-256 |
747a973f0d139f0481449cb0688bc2b87567218734111f546733b0a13d58b6f9
|
File details
Details for the file kid_util-1.0.1-py3-none-any.whl.
File metadata
- Download URL: kid_util-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca2d2f507181cb3affe255aeb378ba0c34dca27d6a8574d2710abc690b1c186b
|
|
| MD5 |
641dcc6ae1fc97e4cd2b3dd1985f8da6
|
|
| BLAKE2b-256 |
c75de026a7384e657a54da3ca0bed7564c53d337feb9b95c1761a19b7ee65333
|