faker.providers.ssn.es_MX
¶
SSN provider for es_MX.
This module adds a provider for mexican SSN, along with Unique Population Registry Code (CURP) and Federal Taxpayer Registry ID (RFC).
Package Contents¶
Classes¶
A Faker provider for the Mexican SSN, RFC and CURP |
Functions¶
|
Sum of digits of a number until sum becomes single digit. |
|
Calculate the checksum for the mexican SSN (IMSS). |
|
Calculate the checksum for the mexican CURP. |
Attributes¶
- class faker.providers.ssn.es_MX.BaseProvider(generator: Any)¶
Bases:
faker.providers.BaseProvider
- faker.providers.ssn.es_MX.ALPHABET¶
- faker.providers.ssn.es_MX.ALPHANUMERIC¶
- faker.providers.ssn.es_MX.VOWELS = 'AEIOU'¶
- faker.providers.ssn.es_MX.CONSONANTS¶
- faker.providers.ssn.es_MX.STATES_RENAPO = ['AS', 'BC', 'BS', 'CC', 'CS', 'CH', 'DF', 'CL', 'CM', 'DG', 'GT', 'GR', 'HG', 'JC', 'MC', 'MN',...¶
- faker.providers.ssn.es_MX.FORBIDDEN_WORDS¶
- faker.providers.ssn.es_MX.CURP_CHARACTERS = '0123456789ABCDEFGHIJKLMNÑOPQRSTUVWXYZ'¶
- faker.providers.ssn.es_MX._reduce_digits(number: int) int ¶
Sum of digits of a number until sum becomes single digit.
- Example:
658 => 6 + 5 + 8 = 19 => 1 + 9 = 10 => 1
- faker.providers.ssn.es_MX.ssn_checksum(digits: map) int ¶
Calculate the checksum for the mexican SSN (IMSS).
- faker.providers.ssn.es_MX.curp_checksum(characters: str) int ¶
Calculate the checksum for the mexican CURP.
- class faker.providers.ssn.es_MX.Provider(generator: Any)¶
Bases:
faker.providers.ssn.Provider
A Faker provider for the Mexican SSN, RFC and CURP
- ssn_formats = ('###########',)¶
- curp() str ¶
See https://es.wikipedia.org/wiki/Clave_%C3%9Anica_de_Registro_de_Poblaci%C3%B3n.
- Returns
a random Mexican CURP (Unique Population Registry Code)
- rfc(natural: bool = True) str ¶
See https://es.wikipedia.org/wiki/Registro_Federal_de_Contribuyentes
- Parameters
natural (bool) – Whether to return the RFC of a natural person. Otherwise return the RFC of a legal person.
- Returns
a random Mexican RFC
- elector_code(gender: Optional[Literal[H, M]] = None) str ¶
Unique elector code issued by INE (Instituto Nacional Electoral) in Mexico.
- Parameters
gender (str) – Gender for which to generate the code. Will be randomly selected if not provided.
- Returns
a random INE elector code
- Sample
- Sample
gender=’M’