python-codicefiscale
python-codicefiscale is a tiny library for encode/decode Italian fiscal code - codifica/decodifica del Codice Fiscale.
Features
Transliteration for name/surname
Multiple birthdate formats (datetime/string) (you can see all the supported string formats in tests/tests.py)
Automatic birthplace city/country code detection
Omocodia support
Installation
pip install python-codicefiscale
Usage
Encoding
from codicefiscale import codicefiscale
codicefiscale.encode(surname='Caccamo', name='Fabio', sex='M', birthdate='03/04/1985', birthplace='Torino')
# returns 'CCCFBA85D03L219P'
Decoding
from codicefiscale import codicefiscale
codicefiscale.decode('CCCFBA85D03L219P')
# returns a dict contaning: 'code', 'sex' ('M' or 'F'), 'birthdate' (datetime), 'birthplace' (dict), 'cin'
Checking
from codicefiscale import codicefiscale
codicefiscale.is_valid('CCCFBA85D03L219P')
# returns True
Testing
python -m unittest tests.tests
# or
python setup.py test
# or
tox
License
Released under MIT License.
Metadata
Release files for python-codicefiscale 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python-codicefiscale-0.2.0.tar.gz | 90.7 kB | Details |
Release files / python-codicefiscale-0.2.0.tar.gz
| Download URL | python-codicefiscale-0.2.0.tar.gz |
|---|---|
| Size | 90.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b53d4da161eb67fc8154e6f86a8701b3ecf0e723822d880c5e42223e43609e9
|
|
BLAKE2b-256 checksum How to use checksums |
81c2c6032bde3b321528331783b0a7ab922909954e5746385af3cc7391f27276
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |