Skip to content

pycensus.census.countries.euskadi.eustat

Euskadi municipal population source (real data via Eurostat/GISCO LAU).

Importing this module registers the gdf.eustat GeoDataFrame accessor (see :mod:pycensus.accessors). Use :func:load to fetch data.

Technical aspects

Named eustat for continuity with the column-naming convention (eustat_population, etc.), but see api.py and geography.py for why the actual data comes from Eurostat/GISCO's LAU dataset rather than eustat.eus directly (that portal 403s a scripted client).

Source

https://gisco-services.ec.europa.eu/distribution/v2/lau/lau-2021-files.html

load(aoi=None, regions=None, level='municipality', year='latest', api_key=None, cache_dir=None, cache=True, data_dir=None)

Load Euskadi municipal population data as a common-schema GeoDataFrame.

Parameters:

Name Type Description Default
aoi Optional[GeoDataFrame]

Area of interest. Used to auto-detect regions if not given, and to clip the final result.

None
regions Optional[Union[str, List[str]]]

Territory name(s)/abbreviation(s)/code(s) to load (Araba, Bizkaia, Gipuzkoa or 01, 48, 20). Derived from aoi if omitted (aoi is then required).

None
level str

Standard geometry level name. Real levels implemented here are autonomous_community, territory, and municipality -- everything finer falls back to municipality via :data:pycensus.euskadi.constants.LEVEL_FALLBACK (see that module's docstring for why).

'municipality'
year Union[int, str]

Vintage year, or "latest" (only 2021, GISCO LAU's vintage, is implemented).

'latest'
api_key Optional[str]

Unused -- no API key is required for this source.

None
cache_dir Optional[str]

Root of pyCensus' parquet cache.

None
cache bool

If False, bypass the cache entirely.

True
data_dir Optional[str]

Unused (kept for interface compatibility).

None

Returns:

Type Description
GeoDataFrame

GeoDataFrame with GEOID, geometry, and one eustat_-prefixed

GeoDataFrame

column per logical column in :data:pycensus.euskadi.eustat.schema.SCHEMA.

Raises:

Type Description
ValueError

If neither regions nor aoi is given.