URN handling

Overview

SDMX allows identifying any artefact in a non-ambiguous and stable fashion using URNs. For example, version 2.1 of the CL_FREQ codelist maintained by SDMX will have the following unique URN: urn:sdmx:org.sdmx.infomodel.codelist.Codelist=SDMX:CL_FREQ(2.1).

pysdmx offers helper methods to:

  • Parse URNs of maintainable artefacts (parse_urn).

  • Parse URNs of items (parse_item_urn).

  • Find the artefact identified by the supplied URN in a collection of artefacts (find_by_urn).

Functions

pysdmx.util.parse_urn(urn)

Parses an SDMX urn and returns an object with the details.

Return type:

Reference

pysdmx.util.parse_item_urn(urn)

Parses an SDMX item urn and returns an object with the details.

Return type:

ItemReference

pysdmx.util.find_by_urn(artefacts, urn)

Returns the maintainable artefact matching the supplied urn.

Return type:

Any

Responses

class pysdmx.util.Reference(sdmx_type: str, agency: str, id: str, version: str)

The coordinates of an SDMX maintainable artefact.

sdmx_type

The type of SDMX artefact (codelist, etc.)

agency

The maintainer of the artefact (e.g. BIS, SDMX, etc.)

id

The artefact ID (e.g. CL_FREQ)

version

The artefact version (e.g. 1.0.0)

class pysdmx.util.ItemReference(sdmx_type: str, agency: str, id: str, version: str, item_id: str)

The coordinates of an SDMX non-nested item.

sdmx_type

The type of SDMX artefact (concept, etc.)

agency

The maintainer of the artefact (e.g. BIS, etc.)

id

The maintainable ID (e.g. CL_FREQ)

version

The artefact version (e.g. 1.0.0)

item_id

The item ID (e.g. A)