faker.providers.ssn.sv_SE

Package Contents

Classes

SsnProvider

Provider

Functions

calculate_luhn(→ int)

Generates the Checksum using Luhn's algorithm

faker.providers.ssn.sv_SE.calculate_luhn(partial_number: float) int

Generates the Checksum using Luhn’s algorithm

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

Bases: faker.providers.BaseProvider

ssn_formats: faker.providers.ElementsType[str] = ('###-##-####',)
ssn() str
class faker.providers.ssn.sv_SE.Provider(generator: Any)

Bases: faker.providers.ssn.Provider

ORG_ID_DIGIT_1 = (1, 2, 3, 5, 6, 7, 8, 9)
static _org_to_vat(org_id: str) str
ssn(min_age: int = 18, max_age: int = 90, long: bool = False, dash: bool = True) str

Returns a 10 or 12 (long=True) digit Swedish SSN, “Personnummer”.

It consists of 10 digits in the form (CC)YYMMDD-SSSQ, where YYMMDD is the date of birth, SSS is a serial number and Q is a control character (Luhn checksum).

Specifying dash=False will give a purely numeric string, suitable for writing direct to databases.

http://en.wikipedia.org/wiki/Personal_identity_number_(Sweden)

org_id(long: bool = False, dash: bool = True) str

Returns a 10 or 12 digit Organisation ID for a Swedish company. (In Swedish) https://sv.wikipedia.org/wiki/Organisationsnummer

vat_id() str

http://ec.europa.eu/taxation_customs/vies/faq.html#item_11 :return: A random Swedish VAT ID, based on a valid Org ID

org_and_vat_id(long: bool = False, dash: bool = True) Tuple[str, str]

Returns matching Org ID and VAT number