Locale es_MX¶
faker.providers.address
¶
- class faker.providers.address.es_MX.Provider(generator: Any)¶
Bases:
Provider
- address() str ¶
- Example:
‘791 Crist Parks, Sashabury, IL 86039-9874’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.address() ... 'Circuito Segura 647 Interior 593\nVieja Chile, CHIS 89241-1578' 'Continuación Sur Urías 784 Interior 080\nVieja Turquía, AGS 53513-9332' 'Continuación Sauceda 148 Interior 418\nSan Paola de la Montaña, NL 19659-3423' 'Peatonal Coahuila de Zaragoza 220 186\nSan Octavio de la Montaña, JAL 94775-1591' 'Cerrada Angola 413 Edif. 525 , Depto. 601\nNueva Austria, COAH 13991'
- administrative_unit() str ¶
example: u’Guerrero’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.administrative_unit() ... 'Sinaloa' 'Tabasco' 'Baja California Sur' 'Morelos' 'Zacatecas'
- building_number() str ¶
- Example:
‘791’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.building_number() ... '6048' '6475' '382' '2194' '924'
- city() str ¶
- Example:
‘Sashabury’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.city() ... 'San Lucía de la Montaña' 'San Nayeli los bajos' 'San Hernán los bajos' 'San Rodolfo de la Montaña' 'Vieja Chile'
- city_adjective() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.city_adjective() ... 'Vieja' 'Vieja' 'Nueva' 'Vieja' 'Vieja'
- city_prefix() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.city_prefix() ... 'Norte' 'Norte' 'Sur' 'Norte' 'Norte'
- city_suffix() str ¶
- Example:
‘town’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.city_suffix() ... 'los bajos' 'los bajos' 'de la Montaña' 'los bajos' 'los altos'
- country() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.country() ... 'Líbano' 'Maldivas' 'Australia' 'Georgia' 'Palau'
- 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() ... 'Mexico' 'Mexico' 'Mexico' 'Mexico' 'Mexico'
- current_country_code() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.current_country_code() ... 'MX' 'MX' 'MX' 'MX' 'MX'
- postcode() str ¶
- Example:
86039-9874
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.postcode() ... '60487-6475' '82421' '89241-1578' '56593' '78408-0160'
- secondary_address() str ¶
:example ‘020 Interior 999’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.secondary_address() ... '604 Interior 876' '759 Interior 382' '219 Interior 489' '411 578' '565 938'
- state() str ¶
example: u’Guerrero’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.state() ... 'Sinaloa' 'Tabasco' 'Baja California Sur' 'Morelos' 'Zacatecas'
- state_abbr() str ¶
example: u’GRO’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.state_abbr() ... 'SIN' 'TAB' 'BCS' 'MOR' 'ZAC'
- street_address() str ¶
- Example:
‘791 Crist Parks’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.street_address() ... 'Andador Norte Segura 647 Interior 593' 'Calle Chiapas 489 Edif. 241 , Depto. 157' 'Eje vial Puebla 387 Edif. 784 , Depto. 080' 'Viaducto Sur Salcido 351 Interior 393' 'Privada Micronesia 158 714'
- street_name() str ¶
- Example:
‘Crist Parks’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.street_name() ... 'Eje vial Sur Huerta' 'Diagonal Norte Romero' 'Prolongación Jalisco' 'Circunvalación Chile' 'Retorno Henríquez'
faker.providers.bank
¶
- class faker.providers.bank.es_MX.Provider(generator: Any)¶
Bases:
Provider
Bank provider for
es_MX
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() str ¶
Generate a mexican bank name.
- Returns:
A mexican bank name.
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.bank() ... 'Consubanco, S.A.' 'UBS Banco, S.A.' 'Deutsche Securities, S.A. de C.V.' 'AXA Seguros, S.A. De C.V.' 'Banco Santander, S.A.'
- 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() ... 'GB' 'GB' 'GB' 'GB' 'GB'
- bban() str ¶
Generate a Basic Bank Account Number (BBAN).
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.bban() ... 'MYNB4876475938242' 'YDTZ4892411578156' 'KTUG8778408016097' 'KHXK1393328711587' 'DJRJ1858398947196'
- clabe(bank_code: int | None = None) str ¶
Generate a mexican bank account CLABE.
Sources:
- Returns:
A fake CLABE number.
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.clabe() ... '155776689006792158' '131988837681525139' '166940496979959706' '145597357884672403' '062288228915909964'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.clabe(bank_code=2) ... '002864631170560203' '002041424285777665' '002497663450887436' '002991780860070717' '002597357884672407'
- iban() str ¶
Generate an International Bank Account Number (IBAN).
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.iban() ... 'GB37MYNB4876475938242' 'GB05YDTZ4892411578156' 'GB04KTUG8778408016097' 'GB93KHXK1393328711587' 'GB55DJRJ1858398947196'
- 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() ... 'YNBIGB65ZT4' 'SGQEGBSIGQ8' 'JDXCGBV4' 'LNKTGBN9' 'OQIBGB9AFZA'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=8) ... 'MYNBGBQ6' 'PMZJGB4W' 'SGQEGBSI' 'YDTZGBQ8' 'WZTEGBTG'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=8, use_dataset=True) ... 'MYNBGBQ6' 'PMZJGB4W' 'SGQEGBSI' 'YDTZGBQ8' 'WZTEGBTG'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=11) ... 'MYNBGBQ65ZT' 'PLSGGB6ISIG' 'TZIRGBJTGEV' 'PRDLGB1UN94' 'OQIBGB9AFZA'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=11, primary=True) ... 'MYNBGBQ6XXX' 'PMZJGB4WXXX' 'SGQEGBSIXXX' 'YDTZGBQ8XXX' 'WZTEGBTGXXX'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=11, use_dataset=True) ... 'MYNBGBQ65ZT' 'PLSGGB6ISIG' 'TZIRGBJTGEV' 'PRDLGB1UN94' 'OQIBGB9AFZA'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift(length=11, primary=True, use_dataset=True) ... 'MYNBGBQ6XXX' 'PMZJGB4WXXX' 'SGQEGBSIXXX' 'YDTZGBQ8XXX' 'WZTEGBTGXXX'
- 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() ... 'MYNBGBQ65ZT' 'PLSGGB6ISIG' 'TZIRGBJTGEV' 'PRDLGB1UN94' 'OQIBGB9AFZA'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift11(use_dataset=True) ... 'MYNBGBQ65ZT' 'PLSGGB6ISIG' 'TZIRGBJTGEV' 'PRDLGB1UN94' 'OQIBGB9AFZA'
- 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() ... 'MYNBGBQ6' 'PMZJGB4W' 'SGQEGBSI' 'YDTZGBQ8' 'WZTEGBTG'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.swift8(use_dataset=True) ... 'MYNBGBQ6' 'PMZJGB4W' 'SGQEGBSI' 'YDTZGBQ8' 'WZTEGBTG'
faker.providers.company
¶
- class faker.providers.company.es_MX.Provider(generator: Any)¶
Bases:
Provider
- bs() str ¶
- Example:
‘integrate extensible convergence’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.bs() ... 'incuba esquemas proactivas' 'fortalece servicios web front-end' 'compromete interfaces eficientes' 'entrega tecnologías distribuidas' 'orquesta arquitecturas intuitivas'
- catch_phrase() str ¶
- Example:
‘Robust full-range hub’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.catch_phrase() ... 'instalación multitarea enfocado al negocio' 'flexibilidad regional recontextualizado' 'interfaz híbrida realineado' 'conjunto terciaria basado en funcionalidad' 'sistema abierto sensible al contexto mandatorio'
- company() str ¶
- Example:
‘Acme Ltd’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.company() ... 'Peres, Arevalo y Huerta' 'Palacios y Madrigal S.C.' 'Vergara-Gamez S. R.L. de C.V.' 'Corporacin Cintrón-Cadena' 'Industrias Zarate, Contreras y Marín'
faker.providers.job
¶
- class faker.providers.job.es_MX.Provider(generator: Any)¶
Bases:
Provider
- job() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.job() ... 'Técnico en asistencia al usuario de tecnología de la información y las comunicaciones' 'Geólogo' 'Recolector de basura y material reciclable' 'Trabajador comunitario de la salud' 'Ingeniero de minas'
faker.providers.person
¶
- class faker.providers.person.es_MX.Provider(generator: Any)¶
Bases:
Provider
- first_name() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.first_name() ... 'Judith' 'Lucía' 'Alfredo' 'Francisco Javier' 'Nayeli'
- first_name_female() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.first_name_female() ... 'Judith' 'Lucía' 'Alfredo' 'Francisco Javier' 'Nayeli'
- first_name_male() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.first_name_male() ... 'Judith' 'Lucía' 'Alfredo' 'Francisco Javier' 'Nayeli'
- first_name_nonbinary() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.first_name_nonbinary() ... 'Judith' 'Lucía' 'Alfredo' 'Francisco Javier' 'Nayeli'
- language_name() str ¶
Generate a random i18n language name (e.g. English).
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.language_name() ... 'Letón' 'Maltés' 'Aimara' 'Igbo' 'Romanche'
- last_name() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.last_name() ... 'Olmos' 'Peres' 'Arevalo' 'Huerta' 'Segura'
- last_name_female() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.last_name_female() ... 'Olmos' 'Peres' 'Arevalo' 'Huerta' 'Segura'
- last_name_male() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.last_name_male() ... 'Olmos' 'Peres' 'Arevalo' 'Huerta' 'Segura'
- last_name_nonbinary() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.last_name_nonbinary() ... 'Olmos' 'Peres' 'Arevalo' 'Huerta' 'Segura'
- name() str ¶
- Example:
‘John Doe’
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.name() ... 'Lucía Arevalo' 'Nayeli Mercedes Palacios Madrigal' 'Jorge Vergara' 'Natalia Clara Lerma' 'Barbara Serafín Henríquez'
- name_female() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.name_female() ... 'Lucía Arevalo' 'Nayeli Mercedes Palacios Madrigal' 'Jorge Vergara' 'Natalia Clara Lerma' 'Barbara Serafín Henríquez'
- name_male() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.name_male() ... 'Lucía Arevalo' 'Nayeli Mercedes Palacios Madrigal' 'Jorge Vergara' 'Natalia Clara Lerma' 'Barbara Serafín Henríquez'
- name_nonbinary() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.name_nonbinary() ... 'Lucía Arevalo' 'Nayeli Mercedes Palacios Madrigal' 'Jorge Vergara' 'Natalia Clara Lerma' 'Barbara Serafín Henríquez'
- prefix() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.prefix() ... 'Lic.' 'Lic.' 'Sr(a).' 'Mtro.' 'Ing.'
- prefix_female() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.prefix_female() ... 'Lic.' 'Lic.' 'Sr(a).' 'Mtro.' 'Ing.'
- prefix_male() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.prefix_male() ... 'Lic.' 'Lic.' 'Sr(a).' 'Mtro.' 'Ing.'
- prefix_nonbinary() str ¶
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.prefix_nonbinary() ... 'Lic.' 'Lic.' 'Sr(a).' 'Mtro.' 'Ing.'
- 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() ... '' '' '' '' ''
faker.providers.phone_number
¶
- class faker.providers.phone_number.es_MX.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'
faker.providers.ssn
¶
- class faker.providers.ssn.es_MX.Provider(generator: Any)¶
Bases:
Provider
A Faker provider for the Mexican SSN, RFC and CURP
- 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)
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.curp() ... 'WAAG070127MBSYYLA6' 'JILF970115HOCDTP02' 'MAPC571127MDGNNT01' 'HOXL390226HASSFI06' 'WOAO680605HBSRVG04'
- elector_code(gender: Literal['H', 'M'] | None = 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
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.elector_code() ... 'LCYRQM07012710H273' 'VFQCBX97011530H500' 'ZCYQBB57112726M280' 'VWRRSW39022616H408' 'ZFYMWM68060529M668'
>>> Faker.seed(0) >>> for _ in range(5): ... fake.elector_code(gender='M') ... 'YXXDJZ07012705M218' 'PYGSCF97011515M855' 'STZKWH57112709M708' 'GWYDST39022626M234' 'QFKRDQ68060518M563'
- 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
- Examples:
>>> Faker.seed(0) >>> for _ in range(5): ... fake.rfc() ... 'SEBM070127XZD' 'ROUB970115LV1' 'SIGD571127TNA' 'ZOPZ390226ZZM' 'SAGP680605N6T'