faker.providers.ssn.it_IT

it_IT ssn provider (yields italian fiscal codes)

Package Contents

Classes

SsnProvider

Provider

Generates italian fiscal codes.

Functions

checksum(→ str)

Calculates the checksum char used for the 16th char.

Attributes

ALPHABET

ALPHANUMERICS

ALPHANUMERICS_DICT

MONTHS_LIST

VOWELS

CONSONANTS

MUNICIPALITIES_LIST

CHECKSUM_TABLE

class faker.providers.ssn.it_IT.SsnProvider(generator: Any)

Bases: faker.providers.BaseProvider

ssn_formats: faker.providers.ElementsType[str] = ('###-##-####',)
ssn() str
faker.providers.ssn.it_IT.ALPHABET
faker.providers.ssn.it_IT.ALPHANUMERICS
faker.providers.ssn.it_IT.ALPHANUMERICS_DICT
faker.providers.ssn.it_IT.MONTHS_LIST = ('A', 'B', 'C', 'D', 'E', 'H', 'L', 'M', 'P', 'R', 'S', 'T')
faker.providers.ssn.it_IT.VOWELS = 'AEIOU'
faker.providers.ssn.it_IT.CONSONANTS
faker.providers.ssn.it_IT.MUNICIPALITIES_LIST = ('A001', 'A004', 'A005', 'A006', 'A007', 'A008', 'A010', 'A013', 'A014', 'A015', 'A016', 'A017',...
faker.providers.ssn.it_IT.CHECKSUM_TABLE = ((1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 2, 4, 18, 20, 11, 3, 6,...
faker.providers.ssn.it_IT.checksum(value: str) str

Calculates the checksum char used for the 16th char. Author: Vincenzo Palazzo

class faker.providers.ssn.it_IT.Provider(generator: Any)

Bases: faker.providers.ssn.Provider

Generates italian fiscal codes.

vat_id_formats = ('IT###########',)
ssn() str
vat_id() str

http://ec.europa.eu/taxation_customs/vies/faq.html#item_11 :return: A random Italian VAT ID

_get_name_letters(sex: int) str
Rules:
  • take all consonants in their order * if >= 4, take the 1st, 3rd and 4th * if < 3 take the vowels also; vowels must go _after_ the consonants

    and must be taken in the order they appear (LUCA -> LCU)

    • if == 3 return all 3 consonants

  • if name is < 3 chars, pad it on the right with “X” (LI -> LIX)

Args:

sex: int

Returns:

str

_get_surname_letters() str

Rules: * if consonants >=3 : take the first 3 * if less, pad them with vowels; vowels come after the consonants and in the order they appear (ROSA -> RSO) * if surname is less than 3 chars, pad it on the right with ‘X’ (FO -> FOX)

Returns:

str

static _transliterate_name(name: str) str
static _get_vowels(sequence: str) list

Returns list of vowels in provided string

static _get_consonants(sequence: str) list

Returns list of consonants in provided string

static _pad_shorter(sequence: str) str

Pads shorter string with the allowed char