Python library for Italian fiscal code
codicefiscale is a Python library for working with Italian fiscal code numbers officially known as Italy’s Codice Fiscale.
Copyright (C) 2009-2016 Emanuele Rocca
Homepage: https://github.com/ema/pycodicefiscale
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
codicefiscale Module Documentation
A quick example
>>> import datetime
>>> from codicefiscale import build
>>>
>>> build('Rocca', 'Emanuele', datetime.datetime(1983, 11, 18), 'M', 'D969')
'RCCMNL83S18D969H'
Module Contents
build(surname, name, birthday, sex, municipality) -> string
Computes the fiscal code for the given person data.
- eg: build(‘Rocca’, ‘Emanuele’, datetime.datetime(1983, 11, 18), ‘M’, ‘D969’)
-> RCCMNL83S18D969H
control_code(input_string) -> int
Computes the control code for the given input_string string. The expected input_string is the first 15 characters of a fiscal code.
eg: control_code(‘RCCMNL83S18D969’) -> ‘H’
get_birthday(code) -> string
Birthday of the person whose fiscal code is ‘code’, in the format DD-MM-YY.
Unfortunately it’s not possible to guess the four digit birth year, given that the Italian fiscal code uses only the last two digits (1983 -> 83). Therefore, this function returns a string and not a datetime object.
eg: birthday(‘RCCMNL83S18D969H’) -> 18-11-83
get_sex(code) -> string
The sex of the person whose fiscal code is ‘code’.
- eg: sex(‘RCCMNL83S18D969H’) -> ‘M’
sex(‘CNTCHR83T41D969D’) -> ‘F’
isvalid(code) -> bool
This function checks if the given fiscal code is syntactically valid.
- eg: isvalid(‘RCCMNL83S18D969H’) -> True
isvalid(‘RCCMNL83S18D969’) -> False
Metadata
Release files for codicefiscale 0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| codicefiscale-0.9.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| codicefiscale-0.9-py2.7.egg | Legacy Egg format | - | - | Details |
Total release size: 11.6 kB
Release files / codicefiscale-0.9.tar.gz
| Download URL | codicefiscale-0.9.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2e7b20576fabdf51379e43c42bfefed842b61c71186f5b8776f43f3970b6a4d
|
|
BLAKE2b-256 checksum How to use checksums |
8be553863848e12ff6a13651cddcc83a8df5fccc8b87bd8fae836ce2f763b534
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / codicefiscale-0.9-py2.7.egg
| Download URL | codicefiscale-0.9-py2.7.egg |
|---|---|
| Size | 7.7 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
8caefa74a5bef476d4155ef889f6ecee84756a18fd7c9ca54d9a4470f74af3bb
|
|
BLAKE2b-256 checksum How to use checksums |
4c7154a81e41132984e0d5eec5c28646a34ad517306cbc62bb333d613be20212
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for codicefiscale 0.9
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.