Skip to content

pycensus.census.countries.spain.ine_tables.loader

Municipality-level INE tables read from the keyless INE CSV bulk files (same route as spain.adrh).

Technical aspects

https://www.ine.es/jaxiT3/files/t/es/csv_bd/<id>.csv?nocab=1 (tab separated, Spanish number format: '.' thousands, ',' decimals). Verified 2026-10-25: * 39363 Viviendas turisticas (VTE, official INE experimental statistic from portal data, NOT Airbnb microdata): dwellings and places by municipality, semi-annual (2026M05, 2025M11, ...). 31 MB. Rows keyed 'NNNNN Name' in the 'Municipios' column. * 39366 Share of tourist dwellings over census dwellings, by municipality. * 69767 EMCR 'Saldos por municipio, ano, sexo y tipo de saldo' (net migration: total/exterior/interior), annual, 23 MB. Country-of-birth by section is not here: use censo2021 (ID_LUGAR_NAC_EXT_N1). INE table 75690 gives birth-country flows only by sub-municipal area for big cities (probed, not loaded). Native resolution is the municipality: the caller must broadcast to sections/H3 and tag the native level in popups.

load_tourist_dwellings(provinces=None, data_dir=None)

Per municipality (GEOID, 5 digits): ine_tourist_dwellings_<period>, ine_tourist_places_<period> (period like 2026M05) and ine_tourist_dwellings_share_<period> (% of census dwellings), plus ..._latest columns. Municipalities with INE-suppressed values are NaN.

Parameters:

Name Type Description Default
provinces Optional[Iterable[str]]

2-digit province codes; None = all.

None
data_dir Optional[str]

Folder of the raw downloads; None = the pycensus cache.

None

Returns:

Type Description
DataFrame

One row per municipality.

load_migration_balance(provinces=None, data_dir=None)

Per municipality: ine_netmig_{total,exterior,interior}_<year> (both sexes), net migration saldo from EMCR (table 69767).

Parameters:

Name Type Description Default
provinces Optional[Iterable[str]]

2-digit province codes; None = all.

None
data_dir Optional[str]

Folder of the raw downloads; None = the pycensus cache.

None

Returns:

Type Description
DataFrame

One row per municipality.