DataStructureDefinition

class sdmxthon.model.definitions.DataStructureDefinition(id_: str | None = None, uri: str | None = None, urn: str | None = None, annotations=None, name: InternationalString | None = None, description: InternationalString | None = None, version: str | None = None, validFrom: datetime | None = None, validTo: datetime | None = None, isFinal: bool | None = None, isExternalReference: bool | None = None, serviceUrl: str | None = None, structureUrl: str | None = None, maintainer=None, dimension_list: DimensionDescriptor | None = None, measure_list: MeasureDescriptor | None = None, attribute_list: AttributeDescriptor | None = None, group_dimension_descriptor: GroupDimensionDescriptor | None = None, constraint: list | None = None)

Bases: MaintainableArtefact

A collection of metadata concepts, their structure and usage when used to collect or disseminate data.

add_constraint(value: ContentConstraint)
property attribute_codes

Keys of the attributeDescriptor components

property attribute_descriptor

A set metadata concepts that define the attributes of a Data Structure Definition.

property constraints

Constraints of the DataStructureDefinition

Returns:

List of constraints

property content

Extracts the content of a DSD as a dict

property dataset_attribute_codes

Attributes with no specified relationship

property dimension_codes

Keys of the dimensionDescriptor components

property dimension_descriptor

An ordered set of metadata concepts that, combined, classify a statistical series, and whose values, when combined (the key) in an instance such as a data set, uniquely identify a specific observation

property group_dimension_descriptor

A set metadata concepts that define a partial key derived from the Dimension Descriptor in a Data Structure Definition.

property measure_code

Key of the MeasureDescriptor component (PrimaryMeasure)

property measure_descriptor

A metadata concept that defines the measure of a Data Structure Definition

to_vtl_json(path: str | None = None)

Formats the DataStructureDefinition as a VTL DataStructure

to_xml(output_path: str = '', header: Header | None = None, id_: str = 'test', test: str = 'true', prepared: datetime | None = None, sender: str = 'Unknown', receiver: str = 'Not_supplied', prettyprint=True)

Exports the DataStructureDefinition to a XML file in SDMX-ML 2.1 format

Parameters:
  • output_path (str) – Path to save the file, defaults to ‘’

  • prettyprint (bool) – Specifies if the output file is formatted

  • header (Header) – Header to be written, defaults to None

Important

If the header argument is not None, rest of the below arguments will not be used

Parameters:
  • id (str) – ID of the Header, defaults to ‘test’

  • test (str) – Mark as test file, defaults to ‘true’

  • prepared (datetime) – Datetime of the preparation of the Message, defaults to current date and time

  • sender (str) – ID of the Sender, defaults to ‘Unknown’

  • receiver (str) – ID of the Receiver, defaults to ‘Not_supplied’

Returns:

A str, if outputPath is ‘’

upload_to_fmr(host: str = 'localhost', port: int = 8080, user: str = 'root', password: str = 'password', use_https: bool = False)

Uploads the DataStructureDefinition to the FMR

Parameters:
  • host (str) – Host to be connected

  • port (int) – Port to be used

  • user (str) – Username for basic Auth (Admin or Agency privileges)

  • password (str) – Password for basic Auth

  • use_https (bool) – Flag to use or not https

DataFlowDefinition

class sdmxthon.model.definitions.DataFlowDefinition(id_: str | None = None, uri: str | None = None, urn: str | None = None, annotations=None, name: InternationalString | None = None, description: InternationalString | None = None, version: str | None = None, validFrom: datetime | None = None, validTo: datetime | None = None, isFinal: bool | None = None, isExternalReference: bool | None = None, serviceUrl: str | None = None, structureUrl: str | None = None, maintainer=None, structure: DataStructureDefinition | None = None, constraints: list | None = None)

Bases: MaintainableArtefact

Abstract concept (i.e. the structure without any data) of a flow of data that providers will provide for different reference periods.

add_constraint(value: ContentConstraint)
property structure

Associates a DataflowDefinition to the DataStructureDefinition.

to_xml(output_path: str = '', header: Header | None = None, id_: str = 'test', test: str = 'true', prepared: datetime | None = None, sender: str = 'Unknown', receiver: str = 'Not_supplied', prettyprint=True)

Exports the DataFlow to a XML file in SDMX-ML 2.1 format

Parameters:
  • output_path (str) – Path to save the file, defaults to ‘’

  • prettyprint (bool) – Specifies if the output file is formatted

  • header (Header) – Header to be written, defaults to None

Important

If the header argument is not None, rest of the below arguments will not be used

Parameters:
  • id (str) – ID of the Header, defaults to ‘test’

  • test (str) – Mark as test file, defaults to ‘true’

  • prepared (datetime) – Datetime of the preparation of the Message, defaults to current date and time

  • sender (str) – ID of the Sender, defaults to ‘Unknown’

  • receiver (str) – ID of the Receiver, defaults to ‘Not_supplied’

Returns:

A str, if outputPath is ‘’

upload_to_fmr(host: str = 'localhost', port: int = 8080, user: str = 'root', password: str = 'password', use_https: bool = False)

Uploads the DataFlow to the FMR

Parameters:
  • host (str) – Host to be connected

  • port (int) – Port to be used

  • user (str) – Username for basic Auth (Admin or Agency privileges)

  • password (str) – Password for basic Auth

  • use_https (bool) – Flag to use or not https