All Projects → fabiocaccamo → python-codicefiscale

fabiocaccamo / python-codicefiscale

Licence: MIT license
🇮🇹 💳 encode / decode italian fiscal codes - codifica / decodifica del Codice Fiscale italiano.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-codicefiscale

codice fiscale
A Ruby gem that calculates the Italian Tax ID (Codice Fiscale)
Stars: ✭ 17 (-67.92%)
Mutual labels:  italian, codicefiscale, italy
Comuni-Italiani-2018-Sql-Json-excel
DATABASE dei COMUNI ITALIANI 2018 PROVINCE, REGIONI, COMUNI CON CAP e COORDINATE GEOGRAFICHE
Stars: ✭ 87 (+64.15%)
Mutual labels:  italy, istat
guida-javascript-moderno
Guida alla creazione di un progetto Javascript Moderno
Stars: ✭ 28 (-47.17%)
Mutual labels:  italian, italiano
italy
Free open public domain football data (football.db) for Italy / Europe - Serie A etc.
Stars: ✭ 35 (-33.96%)
Mutual labels:  italy, italia
TrenitaliaAPI
Reverse engineering dell'API dell'app di Trenitalia
Stars: ✭ 32 (-39.62%)
Mutual labels:  italian, italy
code-examples
Example Code that I use for Referencing when needed
Stars: ✭ 14 (-73.58%)
Mutual labels:  code
Android-Live-Templates
A curated android live templates to make your android development more fast🚀 and easy✨.
Stars: ✭ 197 (+271.7%)
Mutual labels:  code
code-run
一个代码在线编辑预览工具,类似codepen、jsbin、jsfiddle等。
Stars: ✭ 325 (+513.21%)
Mutual labels:  code
R edu
Facebook
Stars: ✭ 18 (-66.04%)
Mutual labels:  code
awesome-end2end-speech-recognition
💬 A list of End-to-End speech recognition, including papers, codes and other materials
Stars: ✭ 49 (-7.55%)
Mutual labels:  code
PhoneCountryCodePicker
An iOS tableview picker for PhoneCountryCode (English & Chinese supported)
Stars: ✭ 31 (-41.51%)
Mutual labels:  code
vscode-in-docker
Run VSCode inside of a Docker Container
Stars: ✭ 22 (-58.49%)
Mutual labels:  code
Unity3D-Cars
A project built for a Renaissance Coders tutorial to introduce vehicle physics.
Stars: ✭ 60 (+13.21%)
Mutual labels:  code
Cheatsheets
Quick reference material for techies
Stars: ✭ 66 (+24.53%)
Mutual labels:  code
Ransom
Various codes related to Ransomware Developement
Stars: ✭ 119 (+124.53%)
Mutual labels:  code
i-am-root-nuget-package
📦🏴‍☠️ NuGet package that shows we can run arbitrary code from any NuGet package
Stars: ✭ 22 (-58.49%)
Mutual labels:  code
code-art
🌈 Collect beautiful art text, never bug. 收集好看的艺术代码,佛祖保佑,永无 Bug。找好看的注释,看这里。
Stars: ✭ 38 (-28.3%)
Mutual labels:  code
NFC-e-Desktop-Delphi
NFC-e - Delphi
Stars: ✭ 24 (-54.72%)
Mutual labels:  fiscal
hastebin-bot
An opensource bot for Discord that posts data to Hastebin
Stars: ✭ 22 (-58.49%)
Mutual labels:  code
RS232-Monitor-Database
🔌📺 This is a public database for all the known RS232 commands for professionnal screens, monitors and projectors. Feel free to contribute !
Stars: ✭ 22 (-58.49%)
Mutual labels:  code

python-codicefiscale

python-codicefiscale is a library for encode/decode Italian fiscal code - codifica/decodifica del Codice Fiscale.

Codice Fiscale

Features

  • NEW Auto-updated data (once a week) directly from ANPR data-source.
  • Transliteration for name/surname
  • Multiple birthdate formats (date/string) (you can see all the supported string formats here)
  • Automatic birthplace city/foreign-country code detection from name
  • Omocodia support

Installation

pip install python-codicefiscale

Usage

Import

from codicefiscale import codicefiscale

Encode

codicefiscale.encode(surname='Caccamo', name='Fabio', sex='M', birthdate='03/04/1985', birthplace='Torino')

# 'CCCFBA85D03L219P'

Decode

codicefiscale.decode('CCCFBA85D03L219P')

# {
#     'code': 'CCCFBA85D03L219P',
#     'sex': 'M',
#     'birthdate': datetime.datetime(1985, 4, 3, 0, 0),
#     'birthplace': {
#         'name': 'TORINO'
#         'province': 'TO',
#         'code': 'L219',
#     },
#     'omocodes': [
#         'CCCFBA85D03L219P',
#         'CCCFBA85D03L21VE',
#         'CCCFBA85D03L2MVP',
#         'CCCFBA85D03LNMVE',
#         'CCCFBA85D0PLNMVA',
#         'CCCFBA85DLPLNMVL',
#         'CCCFBA8RDLPLNMVX',
#         'CCCFBAURDLPLNMVU',
#     ],
#     'raw': {
#         'code': 'CCCFBA85D03L219P',
#         'surname': 'CCC',
#         'name': 'FBA',
#         'birthdate': '85D03',
#         'birthdate_year': '85'
#         'birthdate_month': 'D',
#         'birthdate_day': '03',
#         'birthplace': 'L219',
#         'cin': 'P',
#     },
# }

Check

codicefiscale.is_valid('CCCFBA85D03L219P')

# True
codicefiscale.is_omocode('CCCFBA85D03L219P')

# False

Testing

# clone repository
git clone https://github.com/fabiocaccamo/python-codicefiscale.git && cd python-codicefiscale

# create virtualenv and activate it
python -m venv venv && . venv/bin/activate

# upgrade pip
python -m pip install --upgrade pip

# install requirements
pip install -r requirements.txt -r requirements-test.txt

# run tests using tox
tox

# or run tests using unittest
python -m unittest tests.tests

License

Released under MIT License.


Supporting

See also

  • python-benedict - dict subclass with keylist/keypath support, I/O shortcuts (base64, csv, json, pickle, plist, query-string, toml, xml, yaml) and many utilities. 📘

  • python-fontbro - friendly font operations. 🧢

  • python-fsutil - file-system utilities for lazy devs. 🧟‍♂️

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].