Locale it_CH¶
faker.providers.bank
¶
- class faker.providers.bank.it_CH.Provider(generator: Any)¶
Bases:
Provider
Implement bank provider for
it_CH
locale.There is no difference from the
de_CH
implementation.- aba() str ¶
Generate an ABA routing transit number.
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.aba() ... '076048766' '057593829' '052194896' '034115783' '025659384'
- bank_country() str ¶
Generate the bank provider’s ISO 3166-1 alpha-2 country code.
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.bank_country() ... 'CH' 'CH' 'CH' 'CH' 'CH'
- bban() str ¶
Generate a Basic Bank Account Number (BBAN).
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.bban() ... '66048764759382421' '94892411578156593' '87784080160975351' '39332871158714841' '85839894719659342'
- iban() str ¶
Generate an International Bank Account Number (IBAN).
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.iban() ... 'CH8566048764759382421' 'CH1694892411578156593' 'CH2487784080160975351' 'CH3639332871158714841' 'CH3285839894719659342'
- swift(length: int | None = None, primary: bool = False, use_dataset: bool = False) str ¶
Generate a SWIFT code.
SWIFT codes, reading from left to right, are composed of a 4 alphabet character bank code, a 2 alphabet character country code, a 2 alphanumeric location code, and an optional 3 alphanumeric branch code. This means SWIFT codes can only have 8 or 11 characters, so the value of
length
can only beNone
or the integers8
or11
. If the value isNone
, then a value of8
or11
will randomly be assigned.Because all 8-digit SWIFT codes already refer to the primary branch or office, the
primary
argument only has an effect if the value oflength
is11
. Ifprimary
isTrue
andlength
is11
, the 11-digit SWIFT codes generated will always end in'XXX'
to denote that they belong to primary branches/offices.For extra authenticity, localized providers may opt to include SWIFT bank codes, location codes, and branch codes used in their respective locales. If
use_dataset
isTrue
, this method will generate SWIFT codes based on those locale-specific codes if included. If those codes were not included, then it will behave as ifuse_dataset
wereFalse
, and in that mode, all those codes will just be randomly generated as per the specification.- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift() ... 'YNBICH65ZT4' 'SGQECHSIGQ8' 'JDXCCHV4' 'LNKTCHN9' 'OQIBCH9AFZA'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=8) ... 'MYNBCHQ6' 'PMZJCH4W' 'SGQECHSI' 'YDTZCHQ8' 'WZTECHTG'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=8, use_dataset=True) ... 'MYNBCHQ6' 'PMZJCH4W' 'SGQECHSI' 'YDTZCHQ8' 'WZTECHTG'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=11) ... 'MYNBCHQ65ZT' 'PLSGCH6ISIG' 'TZIRCHJTGEV' 'PRDLCH1UN94' 'OQIBCH9AFZA'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=11, primary=True) ... 'MYNBCHQ6XXX' 'PMZJCH4WXXX' 'SGQECHSIXXX' 'YDTZCHQ8XXX' 'WZTECHTGXXX'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=11, use_dataset=True) ... 'MYNBCHQ65ZT' 'PLSGCH6ISIG' 'TZIRCHJTGEV' 'PRDLCH1UN94' 'OQIBCH9AFZA'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=11, primary=True, use_dataset=True) ... 'MYNBCHQ6XXX' 'PMZJCH4WXXX' 'SGQECHSIXXX' 'YDTZCHQ8XXX' 'WZTECHTGXXX'
- swift11(primary: bool = False, use_dataset: bool = False) str ¶
Generate an 11-digit SWIFT code.
This method uses
swift()
under the hood with thelength
argument set to11
. Ifprimary
is set toTrue
, the SWIFT code will always end with'XXX'
. All 11-digit SWIFT codes use this convention to refer to the primary branch/office.- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift11() ... 'MYNBCHQ65ZT' 'PLSGCH6ISIG' 'TZIRCHJTGEV' 'PRDLCH1UN94' 'OQIBCH9AFZA'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift11(use_dataset=True) ... 'MYNBCHQ65ZT' 'PLSGCH6ISIG' 'TZIRCHJTGEV' 'PRDLCH1UN94' 'OQIBCH9AFZA'
- swift8(use_dataset: bool = False) str ¶
Generate an 8-digit SWIFT code.
This method uses
swift()
under the hood with thelength
argument set to8
and with theprimary
argument omitted. All 8-digit SWIFT codes already refer to the primary branch/office.- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift8() ... 'MYNBCHQ6' 'PMZJCH4W' 'SGQECHSI' 'YDTZCHQ8' 'WZTECHTG'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift8(use_dataset=True) ... 'MYNBCHQ6' 'PMZJCH4W' 'SGQECHSI' 'YDTZCHQ8' 'WZTECHTG'
faker.providers.phone_number
¶
- class faker.providers.phone_number.it_CH.Provider(generator: Any)¶
Bases:
Provider
- country_calling_code() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.country_calling_code() ... '+687' '+595' '+880' '+964' '+41'
- msisdn() str ¶
https://en.wikipedia.org/wiki/MSISDN
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.msisdn() ... '6048764759382' '2194892411578' '5659387784080' '6097535139332' '1158714841858'