rgeomex 
Geographic boundaries of Mexico (states, municipalities, localities, AGEB, blocks and electoral sections) from INEGI 2019 and INE 2020, and functions to extract the AGEB, blocks and electoral sections of a locality. It is the Python version of the R package rgeomex, part of the dengueverse.
import rgeomex
merida = rgeomex.extract_locality(cve_edo="31", locality="Merida")
blocks = rgeomex.extract_blocks(locality="Merida", cve_edo="31")["block"]
len(blocks) # 15,374 blocks
Features
- Data on demand: each dataset is downloaded the first time it is used, verified (SHA-256) and kept in a local cache.
- Split by state: the large datasets (blocks, AGEB, sections) are one file per state, so working with one state downloads only that state.
- Same functions as in R:
extract_locality(),extract_blocks(),extract_ageb(),extract_sectores()andfind_most_similar_string(). - Clean data: EPSG:4326, text in UTF-8 and invalid geometries repaired.
- GeoParquet + geopandas: every layer is a
GeoDataFrame.
Next
- Getting Started: installation and first steps.
- Examples: complete use cases.
- Datasets: the layers available.
- Citation: how to cite the package.