Skip to content

SDMX overview

ilostat provides an SDMX-oriented interface to ILOSTAT through get_sdmx().

Resources and workflow

Use the resource argument to select the information you need.

Resource Purpose Dataset identifier
dataflow Discover available datasets Optional
structure Inspect dataset components Required
codelist Retrieve codes and labels for a component Required
data Retrieve statistical observations Required

A typical workflow is to discover a dataset, inspect its structure, retrieve the relevant codelists, and then retrieve filtered observations.

Bulk data or SDMX?

Use Bulk data access for native ILOSTAT dimension names and the SDMX interface when working with SDMX component identifiers or structural metadata.

Data access

Retrieve data using SDMX component identifiers:

import ilostat

df = ilostat.get_sdmx(
    "UNE_TUNE_SEX_AGE_NB_A",
    filters={
        "REF_AREA": "FRA",
        "SEX": "SEX_F",
        "TIME_PERIOD": "2020:2025",
    },
)

Component identifiers

Typical components include:

Component Description
REF_AREA Reference area
SOURCE Source
FREQ Frequency
MEASURE Measure
SEX Sex
AGE Age classification, where applicable
TIME_PERIOD Time period
OBS_VALUE Observation value
OBS_STATUS Observation status
UNIT_MEASURE Unit of measure
UNIT_MULT Unit multiplier

Classification dimensions are derived from dataset metadata. For example, an ILOSTAT classif1 dimension representing age is exposed as AGE.

Structural metadata

Structure

structure = ilostat.get_sdmx(
    "UNE_TUNE_SEX_AGE_NB_A",
    resource="structure",
)

See Structures.

Codelist

age = ilostat.get_sdmx(
    "UNE_TUNE_SEX_AGE_NB_A",
    resource="codelist",
    component="AGE",
)

See Codelists.

Dataflow

dataflows = ilostat.get_sdmx(
    resource="dataflow",
)

See Dataflows.

Supported formats

Resource dataframe sdmx-ml sdmx-json
Data Yes Not documented Not documented
Structure Yes Yes Yes
Codelist Yes Yes Yes
Dataflow Yes Yes Yes

The formal serialization formats described here apply to structural metadata, not observation data.

The default format is a pandas DataFrame:

structure = ilostat.get_sdmx(
    "UNE_TUNE_SEX_AGE_NB_A",
    resource="structure",
    format="dataframe",
)

Structure, codelist, and dataflow resources can also be serialized as:

sdmx-ml
sdmx-json

The package targets:

  • SDMX-ML 3.1
  • SDMX-JSON 2.1

These outputs are validated during package testing against the official SDMX schemas.

Languages

SDMX labels and names are available in English, French, and Spanish:

structure = ilostat.get_sdmx(
    "UNE_TUNE_SEX_AGE_NB_A",
    resource="structure",
    type="both",
    lang="fr",
)
Language Code
English en
French fr
Spanish es

Next steps

  • :material-network: Structures

    Inspect dataset components and their representations.

    Structures

  • :material-book-open: Codelists

    Explore component codes and labels.

    Codelists

  • :material-database: Dataflows

    Discover datasets and update information.

    Dataflows

  • :material-code-braces: API reference

    Consult the public function signatures.

    API reference