SDMX dataflows¶
ILOSTAT datasets are exposed as SDMX Dataflows.
The Dataflow catalogue is derived from the multilingual ILOSTAT table of contents.
Dataflow catalogue¶
Retrieve the available Dataflows for the selected data segment (the default segment is indicator):
import ilostat
dataflows = ilostat.get_sdmx(
resource="dataflow",
)
print(dataflows.head())
The DataFrame contains:
| Column | Description |
|---|---|
DATAFLOW_ID |
Dataset identifier |
DATAFLOW_NAME |
Localized dataset name |
LAST_UPDATE |
Update information from the ILOSTAT table of contents |
DATAFLOW_NAME combines the localized indicator label and frequency label.
For example:
DATAFLOW_ID DATAFLOW_NAME
UNE_TUNE_SEX_AGE_NB_A Unemployment by sex and age (thousands) - Annual
Retrieve one Dataflow¶
Provide a dataset identifier to retrieve a specific Dataflow:
dataflow = ilostat.get_sdmx(
"UNE_TUNE_SEX_AGE_NB_A",
resource="dataflow",
)
Languages¶
Dataflow names are available in English, French, and Spanish:
dataflow = ilostat.get_sdmx(
"UNE_TUNE_SEX_AGE_NB_A",
resource="dataflow",
lang="fr",
)
Last update¶
LAST_UPDATE comes from the ILOSTAT table of contents.
It can be used by Python clients to identify datasets that have changed since a previous retrieval.
Downloaded resources are also managed through the ilostat cache.
Track dataset updates
Retain the dataflow catalogue from a previous retrieval and compare LAST_UPDATE for matching dataset identifiers with a later catalogue. See Cache management for resource refresh options.
Data Structure Definition¶
Each formal SDMX Dataflow references the corresponding ILOSTAT Data Structure Definition.
For example:
Dataflow:
ILO:UNE_TUNE_SEX_AGE_NB_A(1.0)
Data Structure:
ILO:UNE_TUNE_SEX_AGE_NB_A(1.0)
The artefact type distinguishes the Dataflow from its Data Structure Definition. See Structures to inspect dataset components.
Serialization formats¶
The structural resource can also be returned in a standardized exchange format.
=== "SDMX-ML 3.1"
```python
xml = ilostat.get_sdmx(
"UNE_TUNE_SEX_AGE_NB_A",
resource="dataflow",
format="sdmx-ml",
)
```
=== "SDMX-JSON 2.1"
```python
json_text = ilostat.get_sdmx(
"UNE_TUNE_SEX_AGE_NB_A",
resource="dataflow",
format="sdmx-json",
)
```
SDMX-ML and SDMX-JSON Dataflow outputs are validated during package testing against the official SDMX schemas.