Skip to content

Instantly share code, notes, and snippets.

@giufus
Last active October 5, 2021 11:17
Show Gist options
  • Save giufus/dfbdcacf6ab5d1580dd37a495bd46c15 to your computer and use it in GitHub Desktop.
Save giufus/dfbdcacf6ab5d1580dd37a495bd46c15 to your computer and use it in GitHub Desktop.
python codice fiscale
- Install the library (tkz to https://github.com/fabiocaccamo/python-codicefiscale)
pip install codicefiscale
- Create the script ~/codice_suca
```
#!/bin/env bash
COGNOME=$1
NOME=$2
SESSO=$3
DATA_DI_NASCITA=$4
COMUNE=$5
python -c "from codicefiscale import codicefiscale; print(codicefiscale.encode('$COGNOME','$NOME','$SESSO','$DATA_DI_NASCITA','$COMUNE')) "
```
- Give execution permissions
chmod +x ~/codice_suca
- Then put it in .bashrc
alias suca='~/codice_suca'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment