Skip to content

pycensus.census.countries.mexico.constants

Static Mexico geography reference data shared by every Mexico census source.

Technical aspects

Boundary files for Mexico will be fetched from INEGI's geographic data. This module maps logical level names to the functions that fetch them, the geography hierarchy, and configuration for data loading.

Mexico's administrative divisions: - Nation (country level) - State (estado) - 32 states (31 estados + Ciudad de Mexico) - Municipality (municipio) - equivalent to county - Locality (localidad) - equivalent to place/city - Ageb (Area Geoestadistica Basica) - equivalent to tract/blockgroup - Block (manzana)

Source

https://www.inegi.org.mx/temas/geografia/

state_code(state_name_or_abbr)

Return the 2-digit INEGI code for a state name or abbreviation.

Note: This function is maintained for backward compatibility. New code should use utils.state_code() instead for consistency with the usa implementation.

Parameters:

Name Type Description Default
state_name_or_abbr str

State name or abbreviation.

required

Returns:

Type Description
str

2-digit INEGI code.

state_abbr(state_name_or_code)

Return the abbreviation for a state name or code.

Note: This function is maintained for backward compatibility. New code should use utils.state_abbr() instead for consistency with the usa implementation.

Parameters:

Name Type Description Default
state_name_or_code str

State name or code.

required

Returns:

Type Description
str

The abbreviation.