Skip to content

pycensus.census.countries.germany.destatis

Germany Census 2022 source.

download_census_data(data_type='aggregated', level='state', regions=None, year=2022, data_dir=None, cache_dir=None, overwrite=False)

Download real Germany geography, and real census data if credentials are configured.

Parameters:

Name Type Description Default
data_type

"boundaries" downloads real GISCO NUTS geometry (always works, no credentials needed). "aggregated" downloads real GENESIS population data (requires credentials, see module docstring).

'aggregated'

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

Load Germany census data for one or more regions/an AOI.

Raises:

Type Description
GenesisCredentialsError

If no real GENESIS-Online account is configured in pyCensus/api_keys.json (or via env vars) -- see :mod:pycensus.germany.api. Until an account is added, use :mod:pycensus.census.worldwide.worldpop for Germany population data instead.

ValueError

If neither regions nor aoi is given, or level has no implemented geography source (see :data:pycensus.germany.geography.IMPLEMENTED_LEVELS).

Parameters:

Name Type Description Default
aoi

Area of interest (GeoDataFrame).

None
regions

State codes (instead of aoi).

None
level

Geography level.

'state'
year

Year or "latest".

'latest'
api_key

GENESIS token.

None
cache_dir

Cache folder; None = the pycensus cache.

None
cache

Use the cached result.

True
data_dir

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

None

Returns:

Type Description

GeoDataFrame of the level with the census columns.