Skip to content

pycensus.census.countries.andorra.constants

Static Andorra reference data shared by every Andorra census source.

Technical aspects

Andorra has 7 parishes ("parroquies" in Catalan; "comĂș" is their local government body). PARISH_CODES below uses the real ISO 3166-2:AD subdivision codes -- verified 2026-08-20 by cross-checking against the Codi field of the Departament d'Estadistica's own hosted parish boundary layer (see :mod:pycensus.andorra.geography), which returned exactly these 7 codes/names: https://www.estadistica.ad/server/rest/services/Estadistica/Cartografia_base/FeatureServer/3/query?where=1%3D1&outFields=*&outSR=4326&f=geojson

These also match the parish list and ordering documented on Wikipedia's "Parishes of Andorra" page and the ISO 3166-2:AD standard.

parish_code(name_or_code)

Return the ISO 3166-2:AD code for a parish name, alias, or code.

Parameters:

Name Type Description Default
name_or_code str

Parish name (Catalan, either the real spelling or the known PARISH_NAME_ALIASES variant), or an AD-0X code.

required

Returns:

Type Description
str

The real ISO 3166-2:AD parish code ("AD-01".."AD-07").

Raises:

Type Description
ValueError

If name_or_code does not resolve to a known parish.