Locale de_CH

faker.providers.address

class faker.providers.address.de_CH.Provider(generator: Any)

Bases: faker.providers.address.Provider

address() → str

:example ‘791 Crist Parks, Sashabury, IL 86039-9874’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.address()
...
'Hafnerstrasse 84\n6938 Graubünden'
'Roosstrasse 21\n6781 Nidwalden'
'Mäderstrasse 9\n1160 Jura'
'Freistrasse 92\n8115 Bern'
'Schallerstrasse 939\n5719 Jura'
administrative_unit() → str

Randomly returns a Swiss canton name. :example ‘Zürich’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.administrative_unit()
...
'Neuenburg'
'Zug'
'Nidwalden'
'Appenzell Innerrhoden'
'Glarus'
building_number() → str

:example ‘791’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.building_number()
...
'16'
'88'
'84'
'49'
'324'
canton() → Tuple[str, str]

Randomly returns a swiss canton (‘Abbreviated’, ‘Name’). :example (‘ZH’, ‘Zürich’)

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.canton()
...
('NE', 'Neuenburg')
('ZG', 'Zug')
('NW', 'Nidwalden')
('AI', 'Appenzell Innerrhoden')
('GL', 'Glarus')
canton_code() → str

Randomly returns a Swiss canton code. :example ‘ZH’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.canton_code()
...
'NE'
'ZG'
'NW'
'AI'
'GL'
canton_name() → str

Randomly returns a Swiss canton name. :example ‘Zürich’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.canton_name()
...
'Neuenburg'
'Zug'
'Nidwalden'
'Appenzell Innerrhoden'
'Glarus'
city() → str

:example ‘Sashabury’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.city()
...
'Zug'
'Appenzell Innerrhoden'
'Schaffhausen'
'Neuenburg'
'St. Gallen'
city_suffix() → str

:example ‘town’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.city_suffix()
...
'Ville'
'Ville'
'Ville'
'Ville'
'Ville'
country() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.country()
...
'Maldives'
'Palestine'
'Kingdom of the Netherlands'
'Barbados'
'Israel'
country_code(representation: str = 'alpha-2') → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.country_code()
...
'MV'
'PS'
'NL'
'BB'
'IL'
current_country() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.current_country()
...
'Switzerland'
'Switzerland'
'Switzerland'
'Switzerland'
'Switzerland'
current_country_code() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.current_country_code()
...
'CH'
'CH'
'CH'
'CH'
'CH'
postcode() → str

:example 86039-9874

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.postcode()
...
'7604'
'9764'
'8593'
'9242'
'2948'
street_address() → str

:example ‘791 Crist Parks’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.street_address()
...
'Bauerstrasse 576'
'Schmidtstrasse 324'
'Roosstrasse 21'
'Schaubstrasse 66'
'Mäderstrasse 9'
street_name() → str

:example ‘Crist Parks’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.street_name()
...
'Wettsteinstrasse'
'Hafnerstrasse'
'Wüthrichstrasse'
'Kaiserstrasse'
'Hessstrasse'
street_suffix() → str

:example ‘Avenue’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.street_suffix()
...
'strasse'
'strasse'
'strasse'
'strasse'
'strasse'

faker.providers.bank

class faker.providers.bank.de_CH.Provider(generator: Any)

Bases: faker.providers.bank.Provider

Implement bank provider for de_CH locale.

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: Optional[int] = 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 be None or the integers 8 or 11. If the value is None, then a value of 8 or 11 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 of length is 11. If primary is True and length is 11, 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 is True, 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 if use_dataset were False, 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 the length argument set to 11. If primary is set to True, 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 the length argument set to 8 and with the primary 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.person

class faker.providers.person.de_CH.Provider(generator: Any)

Bases: faker.providers.person.Provider

first_name() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.first_name()
...
'Joelle'
'Julio'
'Belinda'
'Anne-Sophie'
'Zoltán'
first_name_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.first_name_female()
...
'Malea'
'Eleonora'
'Liridona'
'Aisha'
'Morgane'
first_name_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.first_name_male()
...
'Irfan'
'Hannes'
'Gazmend'
'Kerim'
'Frédéric'
first_name_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.first_name_nonbinary()
...
'Joelle'
'Julio'
'Belinda'
'Anne-Sophie'
'Zoltán'
language_name() → str

Generate a random i18n language name (e.g. English).

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.language_name()
...
'Luba-Katanga'
'Malay'
'Aymara'
'Interlingue'
'Quechua'
last_name() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.last_name()
...
'Knecht'
'Wettstein'
'Leu'
'Bauer'
'Hafner'
last_name_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.last_name_female()
...
'Knecht'
'Wettstein'
'Leu'
'Bauer'
'Hafner'
last_name_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.last_name_male()
...
'Knecht'
'Wettstein'
'Leu'
'Bauer'
'Hafner'
last_name_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.last_name_nonbinary()
...
'Knecht'
'Wettstein'
'Leu'
'Bauer'
'Hafner'
name() → str

:example ‘John Doe’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.name()
...
'Belinda Leu'
'Blerim Peter'
'Arda Wüthrich-Hofmann'
'Morris Schmidt-Geiger'
'Hanna Hess Eichenberger'
name_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.name_female()
...
'Belinda Leu'
'Blerim Peter'
'Arda Wüthrich-Hofmann'
'Morris Schmidt-Geiger'
'Hanna Hess Eichenberger'
name_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.name_male()
...
'Belinda Leu'
'Blerim Peter'
'Arda Wüthrich-Hofmann'
'Morris Schmidt-Geiger'
'Hanna Hess Eichenberger'
name_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.name_nonbinary()
...
'Belinda Leu'
'Blerim Peter'
'Arda Wüthrich-Hofmann'
'Morris Schmidt-Geiger'
'Hanna Hess Eichenberger'
prefix() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.prefix()
...
'Prof.'
'Prof.'
'Dr.'
'Prof.'
'Prof.'
prefix_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.prefix_female()
...
'Prof.'
'Prof.'
'Dr.'
'Prof.'
'Prof.'
prefix_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.prefix_male()
...
'Prof.'
'Prof.'
'Dr.'
'Prof.'
'Prof.'
prefix_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.prefix_nonbinary()
...
'Prof.'
'Prof.'
'Dr.'
'Prof.'
'Prof.'
suffix() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.suffix()
...
''
''
''
''
''
suffix_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.suffix_female()
...
''
''
''
''
''
suffix_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.suffix_male()
...
''
''
''
''
''
suffix_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.suffix_nonbinary()
...
''
''
''
''
''

faker.providers.ssn

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

Bases: faker.providers.ssn.fr_CH.Provider

ssn() → str
Returns a 13 digits Swiss SSN named AHV (German) or
AVS (French and Italian)

See: http://www.bsv.admin.ch/themen/ahv/00011/02185/

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ssn()
...
'756.6902.4351.88'
'756.5327.1068.40'
'756.4186.5239.04'
'756.5694.7138.25'
'756.0897.5362.19'
vat_id() → str
Returns:Swiss UID number
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.vat_id()
...
'CHE660487649'
'CHE759382428'
'CHE194892412'
'CHE157815650'
'CHE938778409'