SDMX-REST Structure Queries

Note

Additional information about how to build SDMX-REST queries can be found in the following tutorial:

Build SDMX-REST structure queries.

class pysdmx.api.qb.structure.StructureDetail(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

The desired amount of information to be returned.

class pysdmx.api.qb.structure.StructureFormat(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

The SDMX Structure formats.

class pysdmx.api.qb.structure.StructureQuery(artefact_type: StructureType = StructureType.ALL, agency_id: str | Sequence[str] = '*', resource_id: str | Sequence[str] = '*', version: str | Sequence[str] = '~', item_id: str | Sequence[str] = '*', detail: StructureDetail = StructureDetail.FULL, references: StructureReference = StructureReference.NONE, as_of: datetime | None = None)

A query for structural metadata.

artefact_type

The type of structural metadata to be returned.

agency_id

The agency (or agencies) maintaining the artefact(s) to be returned.

resource_id

The id(s) of the artefact(s) to be returned.

version

The version(s) of the artefact(s) to be returned.

item_id

The id(s) of the item(s) to be returned.

detail

The desired amount of information to be returned.

references

The additional artefact(s) to include in the response.

as_of

Retrieve the artefact as it was at the specified point in time (aka time travel).

static from_ref(ref)

Create a StructureQuery out of the supplied reference.

Parameters:

ref (Union[ItemReference, Reference, str]) – Either a reference object (Reference for maintainable artefacts, or ItemReference for items), or an SDMX urn.

Return type:

StructureQuery

Returns:

A StructureQuery to retrieve the supplied reference.

Raises:

Invalid – If reference is a string and it is not an SDMX urn, or if the type cannot be translated into a StructureType.

class pysdmx.api.qb.structure.StructureReference(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Which additional artefacts to include in the response.

is_artefact_type()

Whether the references points to a type of artefacts.

Return type:

bool

class pysdmx.api.qb.structure.StructureType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

The type of structural metadata to be returned.

classmethod from_type(sdmx_type, is_item=False)

Create a StructureType from an sdmx type string.

Return type:

StructureType