SDMX Information Model

See the implementation notes.

Quick links to classes common to SDMX 2.1 and 3.0 (in alphabetical order):

ActionType Agency AgencyScheme AllDimensions AnnotableArtefact AttributeDescriptor AttributeRelationship AttributeValue Categorisation Category CategoryScheme Code Codelist CodingFormat Component ComponentList Concept ConceptScheme ConstrainableArtefact ConstraintRole ConstraintRoleType Contact CubeRegion CustomType CustomTypeScheme DEFAULT_LOCALE DataAttribute DataConsumer DataConsumerScheme DataProvider DataProviderScheme Datasource Dimension DimensionComponent DimensionDescriptor DimensionRelationship EndPeriod ExtendedFacetValueType Facet FacetType FacetValueType FromVTLSpaceKey GroupDimensionDescriptor GroupKey GroupRelationship HierarchicalCode ISOConceptReference IdentifiableArtefact InternationalString Item ItemScheme Key KeyValue Level MaintainableArtefact MessageText MetadataTargetRegion NamePersonalisation NamePersonalisationScheme NameableArtefact Organisation OrganisationScheme ProvisionAgreement QueryDatasource RESTDatasource Representation Ruleset RulesetScheme SeriesKey SimpleDatasource StartPeriod StatusMessage Structure StructureUsage SubmissionResult SubmissionStatusType TimeDimension TimeKeyValue ToVTLSpaceKey Transformation TransformationScheme UsageStatus UserDefinedOperator UserDefinedOperatorScheme VTLConceptMapping VTLDataflowMapping VTLMappingScheme Version VersionableArtefact

Quick links to classes specific to the SDMX 2.1 implementation:

AfterPeriod Annotation BeforePeriod CodeMap CodelistMap Constraint ContentConstraint DataKey DataKeySet DataSet DataSetTarget DataStructureDefinition DataflowDefinition DimensionDescriptorValuesTarget EnumeratedAttributeValue GenericDataSet GenericTimeSeriesDataSet HierarchicalCodelist Hierarchy IdentifiableObjectTarget ItemAssociation ItemSchemeMap MeasureDescriptor MeasureDimension MemberSelection MemberValue MetadataReport MetadataSet MetadataStructureDefinition MetadataTarget MetadataflowDefinition NoSpecifiedRelationship NonEnumeratedAttributeValue Observation OtherNonEnumeratedAttributeValue PrimaryMeasure PrimaryMeasureRelationship RangePeriod ReportPeriodTarget ReportStructure ReportedAttribute ReportingCategory ReportingTaxonomy ReportingYearStartDay SelectionValue StructureSet StructureSpecificDataSet StructureSpecificTimeSeriesDataSet TargetIdentifiableObject TargetObject TargetObjectKey TargetObjectValue TargetReportPeriod TextAttributeValue TimeRangeValue XHTMLAttributeValue

Quick links to classes specific to the SDMX 3.0 implementation:

AfterPeriod Annotation BeforePeriod CodeSelection CodedMetadataAttributeValue CodelistExtension Constraint DataConstraint DataKey DataKeySet DataSet DataStructureDefinition Dataflow DataflowRelationship ExclusiveCodeSelection GeoCodelist GeoFeatureSetCode GeoGridCode GeoGridCodelist GeoRefCode GeographicCodelist Hierarchy HierarchyAssociation IdentifiableObjectSelection InclusiveCodeSelection Measure MeasureDescriptor MeasureRelationship MemberSelection MemberValue MetadataAttributeDescriptor MetadataAttributeUsage MetadataAttributeValue MetadataConstraint MetadataProvider MetadataProviderScheme MetadataSet MetadataStructureDefinition Metadataflow Observation ObservationRelationship OtherUncodedAttributeValue RangePeriod SelectionValue StructureSpecificDataSet TargetIdentifiableObject TextAttributeValue TimeRangeValue UncodedMetadataAttributeValue ValueItem ValueList XHTMLAttributeValue

Common to SDMX 2.1 and 3.0

sdmx.model.internationalstring.DEFAULT_LOCALE = 'en'[source]

Default locale for InternationalString.

class sdmx.model.internationalstring.InternationalString(value: Convertible | None = None, **kwargs)[source]

Bases: object

SDMX-IM InternationalString.

SDMX-IM LocalisedString is not implemented. Instead, localizations is a mapping in which:

  • keys correspond to the ‘locale’ property of LocalisedString.

  • values correspond to the ‘label’ property of LocalisedString.

When InternationalStringDescriptor is used as a dataclass field type, the field can be assigned in one of four ways:

@dataclass
class Foo:
     name: InternationalStringDescriptor() = InternationalStringDescriptor()

# Equivalent: no localizations
f = Foo()
f = Foo(name={})

# Using an explicit locale
f.name['en'] = "Foo's name in English"

# Using a (locale, label) tuple
f.name = ('fr', "Foo's name in French")

# Using a dict
f.name = {'en': "Replacement English name",
          'fr': "Replacement French name"}

# Using a bare string, implicitly for the DEFAULT_LOCALE
f.name = "Name in DEFAULT_LOCALE language"

Only the first method preserves existing localizations; the latter three replace them.

localizations: dict[str, str][source]
localized_default(locale=None) str[source]

Return the string in locale, or else the first defined.

class sdmx.model.internationalstring.InternationalStringDescriptor[source]

Bases: object

sdmx.model.version.VERSION_PATTERNS = {'2_1': re.compile('^(?P<release>[0-9]+(?:\\.[0-9]+){1})$'), '3_0': re.compile('^(?P<release>[0-9]+(?:\\.[0-9]+){2})(-(?P<ext>.+))?$')}[source]

Regular expressions (re.Pattern) for version strings.

  • "2_1" SDMX 2.1, e.g. “1.0”

  • "3_0" SDMX 3.0, e.g. “1.0.0-draft”

class sdmx.model.version.Version(value: dataclasses.InitVar[str | None] = None, kind: str = 'py', epoch: int = 0, release: tuple[int, ...]=(0, ), pre: tuple[str, int] | None=None, post: tuple[str, int] | None=None, dev: tuple[str, int] | None=None, local: tuple[str | int, ...]=<factory>, _key: CmpKey = <factory>)[source]

Bases: _BaseVersion

Class representing a version.

The SDMX Information Model does not specify a Version class; instead, VersionableArtefact.version is described as “a version string following SDMX versioning rules.”

In order to simplify application of those ‘rules’, and to handle differences between SDMX 2.1 and 3.x, this class extends packaging.version._BaseVersion, and thus is comparable with packaging.version.Version. It implements the particular form of version specifiers laid out by the SDMX standards. Specifically:

  • kind identifies whether a Version instance is an SDMX 2.1, SDMX 3.x, or Python-style version string.

  • patch and ext attributes match the particular terms used in the SDMX 3.0 standards.

  • The str representation of a Version uses the SDMX 3.0 style of separating the ext with a hyphen (“1.0.0-dev1”). This differs from the Python specification, which uses either (a) no separator for a ‘pre-release’ (“1.0rc1”), (b) a period for a ‘post-’ and/or ‘development release’ (“1.0.post2.dev3”), or (c) plus and period symbols for ‘local parts’ (“1.0+local1.local2”).

  • increment(), an added convenience method.

  • The class is comparable and interchangeable with str version expressions.

Parameters:

value (dataclasses.InitVar[str | None]) – String version expression.

dev: tuple[str, int] | None[source]

Same as packaging.version.Version.dev.

epoch: int[source]

Same as packaging.version.Version.epoch.

property ext: str | None[source]

SDMX 3.0 version ‘extension’.

For kind="py", this is equivalent to packaging.version.Version.local.

increment(major: bool | int | None = None, minor: bool | int | None = None, patch: bool | int | None = None, ext: bool | int | None = None, *, micro: bool | int | None = None, local: bool | int | None = None) Version[source]

Return a Version that is incrementally greater than the current Version.

Each argument may be one of:

  • int: the respective release component or extension is incremented by this amount. If the argument is 0, the current value is preserved exactly.

  • True: same as 1.

  • False: same as 0.

  • None (default): if any ‘larger’ component is incremented, zero the respective component. For instance, if major=1, minor=None, then the major release component is incremented, and the minor release component is reset to 0.

If no arguments are given, then by default minor=1 and ext=1.

Parameters:
  • major – If given, increment the Version.major component of the release segment by this amount.

  • minor – If given, increment the Version.minor part.

  • patch – If given, increment the Version.patch part. The keyword argument patch may be used as an alias.

  • ext – If given, increment the Version.ext part. If this part is not present, add “dev{ext}”. The keyword argument local may be used as an alias.

kind: str[source]

"2_1" or "3_0" for SDMX-compatible versions. "py" for a Python version specifier.

local: tuple[str | int, ...][source]

Same as packaging.version.Version.local.

post: tuple[str, int] | None[source]

Same as packaging.version.Version.post.

pre: tuple[str, int] | None[source]

Same as packaging.version.Version.pre.

release: tuple[int, ...][source]

Same as packaging.version.Version.release.

sdmx.model.version.increment(value: Version | str, **kwargs) Version[source]

Increment the version existing.

Identical to Version(str(value)).increment(**kwargs).

sdmx.model.version.parse(value: str) Version[source]

Parse the given version string.

Identical to Version(value).

See also

Version

Information Model classes common to SDMX 2.1 and 3.0.

class sdmx.model.common.ActionType(*values)[source]

Bases: Enum

Per the standard…

…used to specify the action that a receiving system should take when processing the content that is the object of the action:

Append

Data or metadata is an incremental update for an existing data/metadata set or the provision of new data or documentation (attribute values) formerly absent. If any of the supplied data or metadata is already present, it will not replace that data or metadata.

Replace

Data/metadata is to be replaced and may also include additional data/metadata to be appended.

Delete

Data/Metadata is to be deleted.

Information

Data and metadata are for information purposes.

—SDMX 3.0.0 Section 2 §3.4.2.1

append = 3[source]
delete = 1[source]
information = 4[source]
replace = 2[source]
class sdmx.model.common.Agency(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>, contact: list[Contact] = <factory>)[source]

Bases: Organisation

SDMX-IM Organization.

This class is identical to its parent class.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.AgencyScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: OrganisationScheme[Agency]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

sdmx.model.common.AllDimensions = <sdmx.model.common._AllDimensions object>[source]

A singleton.

class sdmx.model.common.AnnotableArtefact(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>)[source]

Bases: Comparable

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

eval_annotation(id: str, globals=None)[source]

Retrieve the annotation with the given id and eval() its contents.

This can be used for unpacking Python values (e.g. dict) stored as an annotation on an AnnotableArtefact (e.g. Code).

Returns None if no attribute exists with the given id.

get_annotation(**attrib)[source]

Return a Annotation with given attrib, e.g. ‘id’.

If more than one attrib is given, all must match a particular annotation.

Raises:

KeyError – If there is no matching annotation.

pop_annotation(**attrib)[source]

Remove and return a Annotation with given attrib, e.g. ‘id’.

If more than one attrib is given, all must match a particular annotation.

Raises:

KeyError – If there is no matching annotation.

class sdmx.model.common.AttributeComponent(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, related_to: AttributeRelationship | None = None)[source]

Bases: Component

SDMX 3.0 AttributeComponent.

Note

This intermediate, abstract class is not present in the SDMX 2.1 IM.

id: str[source]

Unique identifier of the object.

related_to: AttributeRelationship | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.AttributeDescriptor(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>)[source]

Bases: ComponentList[DataAttribute]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.AttributeRelationship[source]

Bases: object

class sdmx.model.common.AttributeValue(value: str | Code, value_for: DataAttribute | None = None, start_date: date | None = None, dsd: dataclasses.InitVar[BaseDataStructureDefinition] = None)[source]

Bases: Comparable

SDMX AttributeValue.

In the spec, AttributeValue is an abstract class. Here, it serves as both the concrete subclasses CodedAttributeValue and UncodedAttributeValue.

Important

The SDMX 3.0.0 “Summary of major changes and new functionality” document mentions (§2.3 Information Model, p.8) “new features such as multiple measures and value arrays for measures and attributes,” and the SDMX-ML 3.0.0 examples (such as ECB_EXR_CA.xml) indicate that this can be a “value array,” but the SDMX 3.0.0 IM (Figure 31/§5.4.2, p.84) gives only ‘String’ as the type of UncodedAttributeValue.value. No class for multiple values is described.

As a consequence, when such multiply-valued attributes are parsed from SDMX-ML, the type annotation for value will be incorrect. The actual type may be list[str], list[Code], or something else.

Todo

Separate and enforce properties of Coded- and UncodedAttributeValue.

dsd: dataclasses.InitVar[BaseDataStructureDefinition] = None[source]
start_date: date | None = None[source]
value: str | Code[source]
value_for: DataAttribute | None = None[source]
class sdmx.model.common.BaseAnnotation(id: str | None = None, title: str | None = None, type: str | None = None, url: str | None = None, text: sdmx.model.internationalstring.InternationalStringDescriptor = None)[source]

Bases: object

id: str | None = None[source]

Can be used to disambiguate multiple annotations for one AnnotableArtefact.

text: InternationalStringDescriptor = None[source]

Content of the annotation.

title: str | None = None[source]

Title, used to identify an annotation.

type: str | None = None[source]

Specifies how the annotation is processed.

url: str | None = None[source]

A link to external descriptive text.

property value: str | None[source]

A non-localised version of the Annotation content.

This feature was added by SDMX 3.0.0. In v30.Annotation, this can be read and written. In this default implementation and in v21.Annotation the value is always None.

sdmx provides a common attribute so that both classes have identical type signatures.

class sdmx.model.common.BaseConstraint(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None)[source]

Bases: ABC, MaintainableArtefact

ABC for SDMX 2.1 and 3.0 Constraint.

class sdmx.model.common.BaseContentConstraint[source]

Bases: object

ABC for SDMX 2.1 and 3.0 ContentConstraint.

class sdmx.model.common.BaseDataKey(included: bool, key_value: dict[~sdmx.model.common.Component, ~sdmx.model.common.ComponentValue]=<factory>)[source]

Bases: object

Common features of SDMX 2.1 and 3.0 DataKey.

included: bool[source]
key_value: dict[Component, ComponentValue][source]

Mapping from Component to ComponentValue comprising the key.

class sdmx.model.common.BaseDataKeySet(included: bool, keys: list[BaseDataKey] = <factory>)[source]

Bases: object

Common features of SDMX 2.1 and 3.0 DataKeySet.

included: bool[source]

True if the keys are included in the Constraint; False if they are excluded.

keys: list[BaseDataKey][source]

DataKeys appearing in the set.

class sdmx.model.common.BaseDataSet(annotations: list[BaseAnnotation] = <factory>, action: ActionType | None = None, valid_from: str | None = None, described_by: BaseDataflow | None = None, structured_by: BaseDataStructureDefinition | None = None, obs: list[BaseObservation] = <factory>, series: SeriesKey, list[~sdmx.model.common.BaseObservation]]=None, group: GroupKey, list[~sdmx.model.common.BaseObservation]]=None)[source]

Bases: AnnotableArtefact

Common features of SDMX 2.1 and 3.0 DataSet.

action: ActionType | None = None[source]

Action to be performed

add_obs(observations: Iterable[BaseObservation], series_key: SeriesKey | None = None) None[source]

Add observations to the data set, and to a series with series_key.

Checks consistency and adds group associations.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

described_by: BaseDataflow | None = None[source]

Association to the Dataflow that contains the data set.

group: DictLikeDescriptor[GroupKey, list[BaseObservation]] = None[source]

Map of group key → list of observations. sdmx extension not in the IM.

obs: list[BaseObservation][source]

All observations in the DataSet.

series: DictLikeDescriptor[SeriesKey, list[BaseObservation]] = None[source]

Map of series key → list of observations. sdmx extension not in the IM.

structured_by: BaseDataStructureDefinition | None = None[source]

Association to the DataStructure <.BaseDataStructureDefinition that defines the structure of the data set.

valid_from: str | None = None[source]
class sdmx.model.common.BaseDataStructureDefinition(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, attributes: AttributeDescriptor = <factory>, dimensions: DimensionDescriptor = <factory>, group_dimensions: DictLikeDescriptor[str, ~sdmx.model.common.GroupDimensionDescriptor]=None)[source]

Bases: Structure, ConstrainableArtefact

Common features of SDMX 2.1 and 3.0 DataStructureDefinition (DSD).

ConstraintType: ClassVar[type[BaseConstraint]][source]
MemberSelection: ClassVar[type[BaseMemberSelection]][source]
MemberValue: ClassVar[type[BaseMemberValue]][source]
attributes: AttributeDescriptor[source]

A AttributeDescriptor that describes the attributes of the data structure.

dimensions: DimensionDescriptor[source]

A DimensionDescriptor that describes the dimensions of the data structure.

classmethod from_keys(keys)[source]

Return a new DSD given some keys.

The DSD’s dimensions refers to a set of new Concepts and Codelists, created to represent all the values observed across keys for each dimension.

Parameters:

keys (iterable of Key) – or of subclasses such as SeriesKey or GroupKey.

group_dimensions: DictLikeDescriptor[str, GroupDimensionDescriptor] = None[source]

Mapping from GroupDimensionDescriptor.id to GroupDimensionDescriptor.

id: str[source]

Unique identifier of the object.

iter_keys(constraint: BaseConstraint | None = None, dims: list[str] = []) Generator[Key, None, None][source]

Iterate over keys.

Parameters:
  • constraint (Constraint, optional) – If given, only yield Keys that are within the constraint.

  • dims (list of str, optional) – If given, only iterate over allowable values for the Dimensions with these IDs. Other dimensions have only a single value like “(DIM_ID)”, where DIM_ID is the ID of the dimension.

make_constraint(key)[source]

Return a constraint for key.

key is a dict wherein:

  • keys are str ids of Dimensions appearing in this DSD’s dimensions, and

  • values are ‘+’-delimited str containing allowable values, or iterables of str, each an allowable value.

For example:

cc2 = dsd.make_constraint({'foo': 'bar+baz', 'qux': 'q1+q2+q3'})

cc2 includes any key where the ‘foo’ dimension is ‘bar’ or ‘baz’, and the ‘qux’ dimension is one of ‘q1’, ‘q2’, or ‘q3’.

Returns:

A constraint with one CubeRegion in its data_content_region , including only the values appearing in key.

Return type:

ContentConstraint

Raises:

ValueError – if key contains a dimension IDs not appearing in dimensions.

make_key(key_cls, values: Mapping, extend=False, group_id=None)[source]

Make a Key or subclass.

Parameters:
Returns:

An instance of key_cls.

Return type:

Key

Raises:

KeyError – If any of the keys of values is not a Dimension or Attribute in the DSD.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.BaseDataflow(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, structure: BaseDataStructureDefinition = <factory>)[source]

Bases: StructureUsage, ConstrainableArtefact

Common features of SDMX 2.1 DataflowDefinition and 3.0 Dataflow.

id: str[source]

Unique identifier of the object.

iter_keys(constraint: BaseConstraint | None = None, dims: list[str] = []) Generator[Key, None, None][source]

Iterate over keys.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.BaseMemberSelection(values_for: Component, included: bool = True, values: list[BaseSelectionValue] = <factory>)[source]

Bases: object

Common features of SDMX 2.1 and 3.0 MemberSelection.

included: bool = True[source]
values: list[BaseSelectionValue][source]

Value(s) included in the selection. Note that the name of this attribute is not stated in the IM, so ‘values’ is chosen for the implementation in this package.

values_for: Component[source]
class sdmx.model.common.BaseMemberValue(value: str, cascade_values: bool | None = None)[source]

Bases: object

Common features of SDMX 2.1 and 3.0 MemberValue.

cascade_values: bool | None = None[source]
value: str[source]
class sdmx.model.common.BaseMetadataSet(action: ActionType | None = None, reporting_begin: date | None = None, reporting_end: date | None = None, publication_period: date | None = None, publication_year: date | None = None, described_by: BaseMetadataflow | None = None, structured_by: IdentifiableArtefact | None = None)[source]

Bases: object

ABC for SDMX 2.1 and 3.0 MetadataSet.

action: ActionType | None = None[source]
described_by: BaseMetadataflow | None = None[source]

Association to the metadata flow definition of which the metadataset is part.

publication_period: date | None = None[source]
publication_year: date | None = None[source]
reporting_begin: date | None = None[source]
reporting_end: date | None = None[source]
structured_by: IdentifiableArtefact | None = None[source]

Note that the class of this attribute differs from SDMX 2.1 to SDMX 3.0. Compare v21.MetadataSet.structured_by and v30.MetadataSet.structured_by.

class sdmx.model.common.BaseMetadataStructureDefinition(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None)[source]

Bases: Structure, ConstrainableArtefact

ABC for SDMX 2.1 and 3.0 MetadataStructureDefinition.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.BaseMetadataflow(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None)[source]

Bases: StructureUsage, ConstrainableArtefact

ABC for SDMX 2.1 MetadataflowDefinition and SDMX 3.0 Metadataflow.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.BaseObservation(attached_attribute: DictLikeDescriptor[str, ~sdmx.model.common.AttributeValue]=None, series_key: SeriesKey | None = None, dimension: Key | None = None, value: Any | Code | None = None, group_keys: set[GroupKey] = <factory>)[source]

Bases: Comparable

Common features of SDMX 2.1 and 3.0 Observation.

This class also implements the IM classes ObservationValue, UncodedObservationValue, and CodedObservation.

attached_attribute: DictLikeDescriptor[str, AttributeValue] = None[source]
property attrib[source]

Return a view of combined observation, series & group attributes.

property dim[source]
dimension: Key | None = None[source]

Key for dimension(s) varying at the observation level.

group_keys: set[GroupKey][source]

sdmx extension not in the IM.

property key[source]

Return the entire key, including KeyValues at the series level.

series_key: SeriesKey | None = None[source]
value: Any | Code | None = None[source]

Data value.

class sdmx.model.common.BaseSelectionValue[source]

Bases: object

ABC for SDMX 2.1 and 3.0 SelectionValue.

class sdmx.model.common.BaseTextAttributeValue(text: InternationalStringDescriptor = None)[source]

Bases: object

ABC for SDMX 2.1 and 3.0 TextAttributeValue.

text: InternationalStringDescriptor = None[source]
class sdmx.model.common.BaseXHTMLAttributeValue(value: str)[source]

Bases: object

ABC for SDMX 2.1 and 3.0 XHTMLAttributeValue.

value: str[source]
class sdmx.model.common.Categorisation(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None, category: sdmx.model.common.Category | None = None, artefact: sdmx.model.common.IdentifiableArtefact | None = None)[source]

Bases: MaintainableArtefact

artefact: IdentifiableArtefact | None = None[source]
category: Category | None = None[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.Category(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>)[source]

Bases: Item[Category]

SDMX-IM Category.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.CategoryScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme[Category]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.ClassFinder(module_name: str, name_map: dict[str, str]=<factory>, parent_map: dict[type, type]=<factory>)[source]

Bases: object

dir()[source]

For module.__dir__.

get_class(name: str | Resource, package=None) type | None[source]

Return a class for name and (optional) package names.

getattr(name)[source]

For module.__getattr__.

module_name: str[source]
name_map: dict[str, str][source]
parent_class(cls)[source]

Return the class that contains objects of type cls.

For example, if cls is PrimaryMeasure, returns v21.MeasureDescriptor.

parent_map: dict[type, type][source]
class sdmx.model.common.Code(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>)[source]

Bases: Item[Code]

SDMX Code.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.Codelist(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme[IT]

SDMX Codelist.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.CodingFormat(coding_format: Facet = <factory>)[source]

Bases: Comparable

SDMX CodingFormat.

coding_format: Facet[source]
class sdmx.model.common.Component(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: sdmx.model.common.Concept | None = None, local_representation: sdmx.model.common.Representation | None = None)[source]

Bases: IdentifiableArtefact

concept_identity: Concept | None = None[source]
id: str[source]

Unique identifier of the object.

local_representation: Representation | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.ComponentList(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>)[source]

Bases: IdentifiableArtefact, Generic[CT]

append(value: CT) None[source]

Append value to components.

auto_order = 1[source]

Counter used to automatically populate DimensionComponent.order values.

components: list[CT][source]
extend(values: Iterable[CT]) None[source]

Extend components with values.

get(id) CT[source]

Return the component with the given id.

getdefault(id, cls=None, **kwargs) CT[source]

Return or create the component with the given id.

If the component is automatically created, its Dimension.order attribute is set to the value of auto_order, which is then incremented.

Parameters:
  • id (str) – Component ID.

  • cls (type, optional) – Hint for the class of a new object.

  • kwargs – Passed to the constructor of Component, or a Component subclass if components is overridden in a subclass of ComponentList.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.ComponentValue(value_for: sdmx.model.common.Component, value: Any)[source]

Bases: object

value: Any[source]
value_for: Component[source]
class sdmx.model.common.Concept(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>)[source]

Bases: Item[Concept]

core_representation: Representation | None = None[source]
id: str[source]

Unique identifier of the object.

iso_concept: ISOConceptReference | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.ConceptScheme(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None, is_partial: bool | None = None, items: dict[str, ~IT]=<factory>)[source]

Bases: ItemScheme[Concept]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.ConstrainableArtefact[source]

Bases: object

SDMX ConstrainableArtefact.

class sdmx.model.common.ConstraintRole(role: sdmx.model.common.ConstraintRoleType)[source]

Bases: object

role: ConstraintRoleType[source]
class sdmx.model.common.ConstraintRoleType(*values)[source]

Bases: Enum

actual = 2[source]
allowable = 1[source]
class sdmx.model.common.Contact(name: InternationalStringDescriptor = None, org_unit: InternationalStringDescriptor = None, telephone: str | None = None, responsibility: InternationalStringDescriptor = None, email: list[str] = <factory>, fax: list[str] = <factory>, uri: list[str] = <factory>, x400: list[str] = <factory>)[source]

Bases: object

Organization contact information.

IMF is the only known data provider that returns messages with Contact information. These differ from the IM in several ways. This class reflects these differences:

  • ‘name’ and ‘org_unit’ are InternationalString, instead of strings.

  • ‘email’ may be a list of e-mail addresses, rather than a single address.

  • ‘fax’ may be a list of fax numbers, rather than a single number.

  • ‘uri’ may be a list of URIs, rather than a single URI.

  • ‘x400’ may be a list of strings, rather than a single string.

email: list[str][source]
fax: list[str][source]
name: InternationalStringDescriptor = None[source]
org_unit: InternationalStringDescriptor = None[source]
responsibility: InternationalStringDescriptor = None[source]
telephone: str | None = None[source]
uri: list[str][source]
x400: list[str][source]
class sdmx.model.common.CubeRegion(included: bool = True, member: dict[sdmx.model.common.DimensionComponent, sdmx.model.common.BaseMemberSelection]=<factory>)[source]

Bases: object

included: bool = True[source]
member: dict[DimensionComponent, BaseMemberSelection][source]
to_query_string(structure)[source]
class sdmx.model.common.CustomType(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>, data_type: str | None = None, null_value: str | None = None, output_format: str | None = None, vtl_literal_format: str | None = None, vtl_scalar_type: str | None = None)[source]

Bases: Item[CustomType]

data_type: str | None = None[source]
id: str[source]

Unique identifier of the object.

null_value: str | None = None[source]
output_format: str | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

vtl_literal_format: str | None = None[source]
vtl_scalar_type: str | None = None[source]
class sdmx.model.common.CustomTypeScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme[CustomType]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.DataAttribute(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: sdmx.model.common.Concept | None = None, local_representation: sdmx.model.common.Representation | None = None, related_to: sdmx.model.common.AttributeRelationship | None = None, usage_status: sdmx.model.common.UsageStatus | None = None, concept_role: sdmx.model.common.Concept | None = None)[source]

Bases: AttributeComponent

concept_role: Concept | None = None[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

usage_status: UsageStatus | None = None[source]
class sdmx.model.common.DataConsumer(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>, contact: list[Contact] = <factory>)[source]

Bases: Organisation, ConstrainableArtefact

SDMX DataConsumer.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.DataConsumerScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: OrganisationScheme[DataConsumer]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.DataProvider(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>, contact: list[Contact] = <factory>)[source]

Bases: Organisation, ConstrainableArtefact

SDMX DataProvider.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.DataProviderScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: OrganisationScheme[DataProvider]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.Datasource[source]

Bases: object

url: str[source]
class sdmx.model.common.Dimension(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, order: int | None = None, concept_role: Concept | None = None)[source]

Bases: DimensionComponent

SDMX Dimension.

concept_role: Concept | None = None[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.DimensionComponent(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, order: int | None = None)[source]

Bases: Component

SDMX DimensionComponent (abstract class).

id: str[source]

Unique identifier of the object.

order: int | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.DimensionDescriptor(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>)[source]

Bases: ComponentList[DimensionComponent]

Describes a set of dimensions.

IM: “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.”

components is a list (ordered) of Dimension, MeasureDimension, and/or TimeDimension.

assign_order()[source]

Assign the DimensionComponent.order attribute.

The Dimensions in components are numbered, starting from 1.

classmethod from_key(key)[source]

Create a new DimensionDescriptor from a key.

For each KeyValue in the key:

Parameters:

key (Key or GroupKey or SeriesKey)

id: str[source]

Unique identifier of the object.

order_key(key)[source]

Return a key ordered according to the DSD.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.DimensionRelationship(dimensions: list[sdmx.model.common.DimensionComponent] = <factory>, group_key: 'GroupDimensionDescriptor | None' = None)[source]

Bases: AttributeRelationship

dimensions: list[DimensionComponent][source]
group_key: GroupDimensionDescriptor | None = None[source]

NB the IM says “0..*” here in a diagram, but the text does not match.

class sdmx.model.common.EndPeriod(is_inclusive: bool, period: datetime)[source]

Bases: Period

class sdmx.model.common.ExtendedFacetValueType(*values)[source]

Bases: Enum

SDMX ExtendedFaceValueType.

This enumeration is identical to FacetValueType except for one additional member, “Xhtml”. This member is used only in metadata.

Xhtml = 44[source]
alpha = 13[source]
alphaNumeric = 14[source]
basicTimePeriod = 20[source]
bigInteger = 2[source]
boolean = 9[source]
count = 11[source]
dataSetReference = 43[source]
dateTime = 34[source]
day = 38[source]
decimal = 6[source]
double = 8[source]
duration = 40[source]
exclusiveValueRange = 16[source]
float = 7[source]
gregorianDay = 25[source]
gregorianMonth = 23[source]
gregorianTimePeriod = 21[source]
gregorianYear = 22[source]
gregorianYearMonth = 24[source]
identifiableReference = 42[source]
inclusiveValueRange = 12[source]
incremental = 17[source]
integer = 3[source]
keyValues = 41[source]
long = 4[source]
month = 36[source]
monthDay = 37[source]
numeric = 15[source]
observationalTimePeriod = 18[source]
reportingDay = 33[source]
reportingMonth = 31[source]
reportingQuarter = 30[source]
reportingSemester = 28[source]
reportingTimePeriod = 26[source]
reportingTrimester = 29[source]
reportingWeek = 32[source]
reportingYear = 27[source]
short = 5[source]
standardTimePeriod = 19[source]
string = 1[source]
time = 39[source]
timesRange = 35[source]
uri = 10[source]
class sdmx.model.common.Facet(type: sdmx.model.common.FacetType = <factory>, value: str | None = None, value_type: sdmx.model.common.FacetValueType | None = None)[source]

Bases: object

type: FacetType[source]
value: str | None = None[source]
value_type: FacetValueType | None = None[source]
class sdmx.model.common.FacetType(is_sequence: bool | None = None, min_length: int | None = None, max_length: int | None = None, min_value: float | None = None, max_value: float | None = None, start_value: float | None = None, end_value: str | None = None, interval: float | None = None, time_interval: datetime.timedelta | None = None, decimals: int | None = None, pattern: str | None = None, start_time: datetime.datetime | None = None, end_time: datetime.datetime | None = None, sentinel_values: str | None = None)[source]

Bases: object

decimals: int | None = None[source]
end_time: datetime | None = None[source]
end_value: str | None = None[source]
interval: float | None = None[source]
is_sequence: bool | None = None[source]
max_length: int | None = None[source]
max_value: float | None = None[source]
min_length: int | None = None[source]
min_value: float | None = None[source]
pattern: str | None = None[source]
sentinel_values: str | None = None[source]

SDMX 3.0 only; not present in SDMX 2.1

start_time: datetime | None = None[source]
start_value: float | None = None[source]
time_interval: timedelta | None = None[source]
class sdmx.model.common.FacetValueType(*values)[source]

Bases: Enum

SDMX FacetValueType.

In the SDMX 2.0 IM, three diagrams in the spec show this enumeration containing ‘gregorianYearMonth’ but not ‘gregorianYear’ or ‘gregorianMonth’. The table in §3.6.3.3 Representation Constructs does the opposite. One ESTAT query (via SGR) shows a real-world usage of ‘gregorianYear’; while one query shows usage of ‘gregorianYearMonth’; so all three are included.

alpha = 13[source]
alphaNumeric = 14[source]
basicTimePeriod = 20[source]
bigInteger = 2[source]
boolean = 9[source]
count = 11[source]
dataSetReference = 43[source]
dateTime = 34[source]
day = 38[source]
decimal = 6[source]
double = 8[source]
duration = 40[source]
exclusiveValueRange = 16[source]
float = 7[source]
geospatialInformation = 44[source]
gregorianDay = 25[source]
gregorianMonth = 23[source]
gregorianTimePeriod = 21[source]
gregorianYear = 22[source]
gregorianYearMonth = 24[source]
identifiableReference = 42[source]
inclusiveValueRange = 12[source]
incremental = 17[source]
integer = 3[source]
keyValues = 41[source]
long = 4[source]
month = 36[source]
monthDay = 37[source]
numeric = 15[source]
observationalTimePeriod = 18[source]
reportingDay = 33[source]
reportingMonth = 31[source]
reportingQuarter = 30[source]
reportingSemester = 28[source]
reportingTimePeriod = 26[source]
reportingTrimester = 29[source]
reportingWeek = 32[source]
reportingYear = 27[source]
short = 5[source]
standardTimePeriod = 19[source]
string = 1[source]
time = 39[source]
timesRange = 35[source]
uri = 10[source]
class sdmx.model.common.FromVTLSpaceKey(key: str)[source]

Bases: VTLSpaceKey

class sdmx.model.common.GroupDimensionDescriptor(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>)[source]

Bases: DimensionDescriptor

assign_order()[source]

assign_order() has no effect for GroupDimensionDescriptor.

attachment_constraint: bool | None = None[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.GroupKey(arg: collections.abc.Mapping | None = None, **kwargs)[source]

Bases: Key

described_by: GroupDimensionDescriptor | None = None[source]
id: str | None = None[source]
class sdmx.model.common.GroupRelationship(group_key: 'GroupDimensionDescriptor | None' = None)[source]

Bases: AttributeRelationship

group_key: GroupDimensionDescriptor | None = None[source]

“Retained for compatibility reasons” in SDMX 2.1 versus 2.0; not used by sdmx.

class sdmx.model.common.HierarchicalCode(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, valid_from: str | None = None, valid_to: str | None = None, code: Code | None = None, level: Level | None = None, parent: HierarchicalCode | Any = None, child: list[HierarchicalCode] = <factory>)[source]

Bases: IdentifiableArtefact

SDMX HierarchicalCode.

child: list[HierarchicalCode][source]
code: Code | None = None[source]

The Code that is used at the specific point in the hierarchy.

id: str[source]

Unique identifier of the object.

level: Level | None = None[source]
parent: HierarchicalCode | Any = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

valid_from: str | None = None[source]

Date from which the construct is valid.

valid_to: str | None = None[source]

Date from which the construct is superseded.

class sdmx.model.common.ISOConceptReference(agency: str, id: str, scheme_id: str)[source]

Bases: object

agency: str[source]
id: str[source]
scheme_id: str[source]
class sdmx.model.common.IdentifiableArtefact(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None)[source]

Bases: AnnotableArtefact

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.Item(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>)[source]

Bases: NameableArtefact, Generic[IT]

append_child(other: IT)[source]
child: list[IT][source]
get_child(id) IT[source]

Return the child with the given id.

get_scheme()[source]

Return the ItemScheme to which the Item belongs, if any.

property hierarchical_id[source]

Construct the ID of an Item in a hierarchical ItemScheme.

Returns, for example, ‘A.B.C’ for an Item with id ‘C’ that is the child of an item with id ‘B’, which is the child of a root Item with id ‘A’.

id: str[source]

Unique identifier of the object.

parent: IT | ItemScheme | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.ItemScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: MaintainableArtefact, Generic[IT]

SDMX-IM Item Scheme.

The IM states that ItemScheme “defines a set of Items…” To simplify indexing/retrieval, this implementation uses a dict for the items attribute, in which the keys are the id of the Item.

Because this may change in future versions, user code should not access items directly. Instead, use the getattr() and indexing features of ItemScheme, or the public methods, to access and manipulate Items:

>>> foo = ItemScheme(id='foo')
>>> bar = Item(id='bar')
>>> foo.append(bar)
>>> foo
<ItemScheme: 'foo', 1 items>
>>> (foo.bar is bar) and (foo['bar'] is bar) and (bar in foo)
True
append(item: IT)[source]

Add item to the ItemScheme.

Parameters:

item – Item to add. Elements must be of the same class as items.

extend(items: Iterable[IT])[source]

Extend the ItemScheme with members of items.

Parameters:

items – Elements must be of the same class as items.

get(id: str, default: str | IT | None = None) str | IT[source]

Get an Item by its id; if not present, return default.

get_hierarchical(id: str) IT[source]

Get an Item by its hierarchical_id.

id: str[source]

Unique identifier of the object.

is_partial: bool | None = None[source]
items: dict[str, IT][source]

Members of the ItemScheme. Both ItemScheme and Item are abstract classes. Concrete classes are paired: for example, a Codelist contains Codes.

setdefault(obj=None, **kwargs) IT[source]

Retrieve the item name, or add it with kwargs and return it.

The returned object is a reference to an object in the ItemScheme, and is of the appropriate class.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.Key(arg: Mapping | Sequence[KeyValue] | None = None, **kwargs)[source]

Bases: object

SDMX Key class.

The constructor takes an optional list of keyword arguments; the keywords are used as Dimension or Attribute IDs, and the values as KeyValues.

For convenience, the values of the key may be accessed directly:

>>> k = Key(foo=1, bar=2)
>>> k.values['foo']
1
>>> k['foo']
1
Parameters:
attrib: DictLikeDescriptor[str, AttributeValue] = None[source]
copy(arg=None, **kwargs)[source]
described_by: DimensionDescriptor | None = None[source]
get_values()[source]
order(value=None)[source]
values: DictLikeDescriptor[str, KeyValue] = None[source]

Individual KeyValues that describe the key.

class sdmx.model.common.KeyValue(id: str, value: Any, value_for: DimensionComponent | None = None, dsd: dataclasses.InitVar[BaseDataStructureDefinition] = None)[source]

Bases: object

One value in a multi-dimensional Key.

dsd: dataclasses.InitVar[BaseDataStructureDefinition] = None[source]
id: str[source]
value: Any[source]

The actual value.

value_for: DimensionComponent | None = None[source]
class sdmx.model.common.Level(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: Level | Any = None, child: Level | None = None, code_format: CodingFormat = <factory>)[source]

Bases: NameableArtefact

SDMX Level.

child: Level | None = None[source]
code_format: CodingFormat[source]
id: str[source]

Unique identifier of the object.

parent: Level | Any = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.MaintainableArtefact(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None)[source]

Bases: VersionableArtefact

id: str[source]

Unique identifier of the object.

is_external_reference: bool | None = None[source]

True if the content of the object is held externally; i.e., not the current Message.

is_final: bool | None = None[source]

True if the object is final; otherwise it is in a draft state.

maintainer: Agency | None = None[source]

Association to the Agency responsible for maintaining the object.

service_url: str | None = None[source]

URL of an SDMX-compliant web service from which the object can be retrieved.

structure_url: str | None = None[source]

URL of an SDMX-ML document containing the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.MessageText(code: int = 0, text: InternationalStringDescriptor = None)[source]

Bases: object

SDMX MessageText.

See Registration and maintenance.

code: int = 0[source]
text: InternationalStringDescriptor = None[source]
class sdmx.model.common.MetadataAttribute(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, related_to: AttributeRelationship | None = None, is_presentational: bool | None = None, max_occurs: int | None = None, min_occurs: int | None = None, parent: MetadataAttribute | None = None, child: list[MetadataAttribute] = <factory>)[source]

Bases: AttributeComponent

SDMX MetadataAttribute.

child: list[MetadataAttribute][source]
id: str[source]

Unique identifier of the object.

is_presentational: bool | None = None[source]
max_occurs: int | None = None[source]
min_occurs: int | None = None[source]
parent: MetadataAttribute | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.MetadataTargetRegion(is_included: bool = True)[source]

Bases: object

is_included: bool = True[source]
sdmx.model.common.MissingID = ''[source]

Singleton used for IdentifiableArtefact.id if none given.

class sdmx.model.common.NamePersonalisation(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>, vtl_default_name: str | None = None)[source]

Bases: Item[NamePersonalisation]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

vtl_default_name: str | None = None[source]
class sdmx.model.common.NamePersonalisationScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme[NamePersonalisation]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.NameableArtefact(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None)[source]

Bases: IdentifiableArtefact

description: InternationalStringDescriptor = None[source]

Multi-lingual description of the object.

id: str[source]

Unique identifier of the object.

name: InternationalStringDescriptor = None[source]

Multi-lingual name of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.Organisation(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>, contact: list[sdmx.model.common.Contact] = <factory>)[source]

Bases: Item[Organisation]

contact: list[Contact][source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.OrganisationScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme[IT]

SDMX OrganisationScheme (abstract class).

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

sdmx.model.common.PACKAGE = {'Agency': 'base', 'AgencyScheme': 'base', 'Categorisation': 'categoryscheme', 'Category': 'categoryscheme', 'CategoryScheme': 'categoryscheme', 'Code': 'codelist', 'Codelist': 'codelist', 'CodelistMap': 'mapping', 'Concept': 'conceptscheme', 'ConceptScheme': 'conceptscheme', 'ContentConstraint': 'registry', 'CustomTypeScheme': 'transformation', 'DataConsumerScheme': 'base', 'DataProvider': 'base', 'DataProviderScheme': 'base', 'DataStructure': 'datastructure', 'DataStructureDefinition': 'datastructure', 'Dataflow': 'datastructure', 'DataflowDefinition': 'datastructure', 'HierarchicalCode': 'codelist', 'HierarchicalCodelist': 'codelist', 'Hierarchy': 'codelist', 'Level': 'codelist', 'MetadataStructureDefinition': 'metadatastructure', 'Metadataflow': 'metadatastructure', 'MetadataflowDefinition': 'metadatastructure', 'NamePersonalisationScheme': 'transformation', 'OrganisationScheme': 'base', 'ProvisionAgreement': 'registry', 'ReportingTaxonomy': 'categoryscheme', 'RulesetScheme': 'transformation', 'StructureSet': 'mapping', 'StructureUsage': 'datastructure', 'TransformationScheme': 'transformation', 'UserDefinedOperatorScheme': 'transformation', 'VTLMappingScheme': 'transformation', 'ValueList': 'codelist'}[source]

The SDMX-IM groups classes into ‘packages’; these are used in URNs.

class sdmx.model.common.Period(is_inclusive: bool, period: datetime)[source]

Bases: object

Class not specified in the IM.

is_inclusive: bool[source]
period: datetime[source]
class sdmx.model.common.ProvisionAgreement(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None, structure_usage: sdmx.model.common.StructureUsage | None = None, data_provider: sdmx.model.common.DataProvider | None = None)[source]

Bases: MaintainableArtefact, ConstrainableArtefact

data_provider: DataProvider | None = None[source]
id: str[source]

Unique identifier of the object.

structure_usage: StructureUsage | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.QueryDatasource[source]

Bases: Datasource

class sdmx.model.common.RESTDatasource[source]

Bases: QueryDatasource

class sdmx.model.common.Representation(enumerated: sdmx.model.common.ItemScheme | None = None, non_enumerated: list[sdmx.model.common.Facet] = <factory>)[source]

Bases: object

enumerated: ItemScheme | None = None[source]
non_enumerated: list[Facet][source]
class sdmx.model.common.Ruleset(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>, definition: str | None = None, scope: str | None = None, type: str | None = None)[source]

Bases: Item[Ruleset]

definition: str | None = None[source]
id: str[source]

Unique identifier of the object.

scope: str | None = None[source]
type: str | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.RulesetScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme[Ruleset]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.SeriesKey(attrib: sdmx.dictlike.DictLikeDescriptor[str, sdmx.model.common.AttributeValue]=None, described_by: sdmx.model.common.DimensionDescriptor | None = None, values: sdmx.dictlike.DictLikeDescriptor[str, sdmx.model.common.KeyValue]=None, group_keys: set[sdmx.model.common.GroupKey] = <factory>)[source]

Bases: Key

property group_attrib[source]

Return a view of attributes on all GroupKey including the series.

group_keys: set[GroupKey][source]

sdmx extension not in the IM.

class sdmx.model.common.SimpleDatasource[source]

Bases: Datasource

class sdmx.model.common.StartPeriod(is_inclusive: bool, period: datetime)[source]

Bases: Period

class sdmx.model.common.StatusMessage(status: SubmissionStatusType, text: list[MessageText] = <factory>)[source]

Bases: object

SDMX StatusMessage.

See Registration and maintenance.

status: SubmissionStatusType[source]
text: list[MessageText][source]
class sdmx.model.common.Structure(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None)[source]

Bases: MaintainableArtefact

property grouping: Sequence[ComponentList][source]

A collection of all the ComponentLists associated with a subclass.

id: str[source]

Unique identifier of the object.

replace_grouping(cl: ComponentList) None[source]

Replace existing component list with cl.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.StructureUsage(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None)[source]

Bases: MaintainableArtefact

id: str[source]

Unique identifier of the object.

structure: Structure | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.SubmissionResult(maintainable_object: MaintainableArtefact, action: ActionType, status_message: StatusMessage, external_dependencies: bool = False)[source]

Bases: object

SDMX SubmissionResult.

See Registration and maintenance.

action: ActionType[source]
external_dependencies: bool = False[source]
maintainable_object: MaintainableArtefact[source]
status_message: StatusMessage[source]
class sdmx.model.common.SubmissionStatusType(*values)[source]

Bases: Enum

See Registration and maintenance.

failure = 2[source]
success = 1[source]
warning = 3[source]
class sdmx.model.common.TimeDimension(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, order: int | None = None)[source]

Bases: DimensionComponent

SDMX TimeDimension.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.TimeDimensionValue(value_for: sdmx.model.common.Component, value: Any, time_value: Any, operator: str)[source]

Bases: ComponentValue

operator: str[source]
time_value: Any[source]
class sdmx.model.common.TimeKeyValue(id: str, value: Any, value_for: DimensionComponent | None = None, dsd: dataclasses.InitVar[BaseDataStructureDefinition] = None)[source]

Bases: KeyValue

SDMX TimeKeyValue.

Identical to its parent class.

class sdmx.model.common.ToVTLSpaceKey(key: str)[source]

Bases: VTLSpaceKey

class sdmx.model.common.Transformation(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>, expression: str | None = None, result: str | None = None)[source]

Bases: Item[Transformation]

expression: str | None = None[source]
id: str[source]

Unique identifier of the object.

result: str | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.TransformationScheme(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None, is_partial: bool | None = None, items: dict[str, ~IT]=<factory>, custom_type_scheme: sdmx.model.common.CustomTypeScheme | None = None, name_personalisation_scheme: sdmx.model.common.NamePersonalisationScheme | None = None, ruleset_scheme: sdmx.model.common.RulesetScheme | None = None, user_defined_operator_scheme: sdmx.model.common.UserDefinedOperatorScheme | None = None, vtl_mapping_scheme: sdmx.model.common.VTLMappingScheme | None = None)[source]

Bases: ItemScheme[Transformation]

custom_type_scheme: CustomTypeScheme | None = None[source]
id: str[source]

Unique identifier of the object.

name_personalisation_scheme: NamePersonalisationScheme | None = None[source]
ruleset_scheme: RulesetScheme | None = None[source]
update_ref(ref)[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

user_defined_operator_scheme: UserDefinedOperatorScheme | None = None[source]
vtl_mapping_scheme: VTLMappingScheme | None = None[source]
class sdmx.model.common.UsageStatus(*values)[source]

Bases: Enum

conditional = 2[source]
mandatory = 1[source]
class sdmx.model.common.UserDefinedOperator(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>, definition: str | None = None)[source]

Bases: Item[UserDefinedOperator]

definition: str | None = None[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.UserDefinedOperatorScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme[UserDefinedOperator]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.VTLConceptMapping(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>, concept_alias: sdmx.model.common.Concept | None = None)[source]

Bases: VTLMapping

concept_alias: Concept | None = None[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.VTLDataflowMapping(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType]=None, child: list[IT] = <factory>, dataflow_alias: sdmx.model.common.BaseDataflow | None = None, from_vtl_method: collections.abc.Sequence[sdmx.model.common.VTLSpaceKey] = <factory>, from_vtl_superspace: sdmx.model.common.VTLSpaceKey | None = None, to_vtl_method: sdmx.model.common.SDMXtoVTL | None = None, to_vtl_subspace: collections.abc.Sequence[sdmx.model.common.VTLSpaceKey] = <factory>)[source]

Bases: VTLMapping

dataflow_alias: BaseDataflow | None = None[source]
from_vtl_method: Sequence[VTLSpaceKey][source]
from_vtl_superspace: VTLSpaceKey | None = None[source]
id: str[source]

Unique identifier of the object.

to_vtl_method: SDMXtoVTL | None = None[source]
to_vtl_subspace: Sequence[VTLSpaceKey][source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.VTLMapping(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>)[source]

Bases: Item[VTLMapping]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.VTLMappingScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme[VTLMapping]

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.common.VTLSpaceKey(key: str)[source]

Bases: object

key: str[source]
class sdmx.model.common.VersionableArtefact(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None)[source]

Bases: NameableArtefact

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

valid_from: str | None = None[source]

Date from which the version is valid.

valid_to: str | None = None[source]

Date from which the version is superseded.

version: str | Version | None = None[source]

A version string following an agreed convention.

sdmx.model.common.value_for_dsd_ref(kind, args, kwargs)[source]

Maybe replace a string ‘value_for’ in kwargs with a DSD reference.

SDMX 2.1

SDMX 2.1 Information Model.

class sdmx.model.v21.KeyValue(id: str, value: Any, value_for: DimensionComponent | None = None, dsd: dataclasses.InitVar[BaseDataStructureDefinition] = None)[source]

One value in a multi-dimensional Key.

__eq__(other)[source]

Compare the value to a simple Python built-in type or other key-like.

other may be KeyValue or ComponentValue; if so, and both self and other have value_for, these must refer to the same object.

id: str[source]
value: Any[source]

The actual value.

value_for: DimensionComponent | None = None[source]
class sdmx.model.v21.AfterPeriod(is_inclusive: bool, period: datetime)[source]

Bases: TimeRangeValue, Period

class sdmx.model.v21.Annotation(id: str | None = None, title: str | None = None, type: str | None = None, url: str | None = None, text: InternationalStringDescriptor = None)[source]

Bases: BaseAnnotation

SDMX 2.1 Annotation.

Identical to its parent class.

class sdmx.model.v21.BeforePeriod(is_inclusive: bool, period: datetime)[source]

Bases: TimeRangeValue, Period

class sdmx.model.v21.CodeMap(annotations: list[BaseAnnotation] = <factory>, source: IT | None = None, target: IT | None = None)[source]

Bases: ItemAssociation[Code]

SDMX 2.1 CodeMap.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

class sdmx.model.v21.CodelistMap(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, source: IST | None = None, target: IST | None = None, item_association: list[IAT] = <factory>)[source]

Bases: ItemSchemeMap[Codelist, CodeMap]

SDMX 2.1 CodelistMap.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.Constraint(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, role: ConstraintRole | None = None, data_content_keys: DataKeySet | None = None)[source]

Bases: BaseConstraint

SDMX 2.1 Constraint.

For SDMX 3.0, see v30.Constraint.

data_content_keys: DataKeySet | None = None[source]

DataKeySet included in the Constraint.

role: ConstraintRole | None = None[source]
class sdmx.model.v21.ContentConstraint(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None, role: sdmx.model.common.ConstraintRole | None = None, data_content_keys: sdmx.model.v21.DataKeySet | None = None, data_content_region: list[sdmx.model.common.CubeRegion] = <factory>, content: set[sdmx.model.common.ConstrainableArtefact] = <factory>, metadata_content_region: sdmx.model.common.MetadataTargetRegion | None = None)[source]

Bases: Constraint, BaseContentConstraint

content: set[ConstrainableArtefact][source]
data_content_region: list[CubeRegion][source]

CubeRegions included in the ContentConstraint.

iter_keys(obj: DataStructureDefinition | DataflowDefinition, dims: list[str] = []) Generator[Key, None, None][source]

Iterate over keys.

A warning is logged if obj is not already explicitly associated to this ContentConstraint, i.e. present in content.

See also

DataStructureDefinition.iter_keys

metadata_content_region: MetadataTargetRegion | None = None[source]
to_query_string(structure)[source]
class sdmx.model.v21.DataKey(included: bool, key_value: dict[~sdmx.model.common.Component, ~sdmx.model.common.ComponentValue]=<factory>)[source]

Bases: BaseDataKey

SDMX 2.1 DataKey.

Identical to its parent class.

class sdmx.model.v21.DataKeySet(included: bool, keys: list[BaseDataKey] = <factory>)[source]

Bases: BaseDataKeySet

SDMX 2.1 DataKeySet.

Identical to its parent class.

class sdmx.model.v21.DataSet(annotations: list[BaseAnnotation] = <factory>, action: ActionType | None = None, valid_from: str | None = None, described_by: BaseDataflow | None = None, structured_by: DataStructureDefinition | None = None, obs: list[BaseObservation] = <factory>, series: SeriesKey, list[~sdmx.model.common.BaseObservation]]=None, group: GroupKey, list[~sdmx.model.common.BaseObservation]]=None, attrib: DictLikeDescriptor[str, ~sdmx.model.common.AttributeValue]=None)[source]

Bases: BaseDataSet

SDMX 2.1 DataSet.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

attrib: DictLikeDescriptor[str, AttributeValue] = None[source]

Named attachedAttribute in the IM.

structured_by: DataStructureDefinition | None = None[source]

Association to the DataStructure <.BaseDataStructureDefinition that defines the structure of the data set.

class sdmx.model.v21.DataSetTarget(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None)[source]

Bases: TargetObject

SDMX 2.1 DataSetTarget.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.DataStructureDefinition(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, attributes: AttributeDescriptor = <factory>, dimensions: DimensionDescriptor = <factory>, group_dimensions: DictLikeDescriptor[str, ~sdmx.model.common.GroupDimensionDescriptor]=None, measures: MeasureDescriptor = <factory>)[source]

Bases: BaseDataStructureDefinition

SDMX 2.1 DataStructureDefinition (‘DSD’).

ConstraintType[source]

alias of ContentConstraint

class MemberSelection(values_for: Component, included: bool = True, values: list[BaseSelectionValue] = <factory>)[source]

Bases: BaseMemberSelection

SDMX 2.1 MemberSelection.

class MemberValue(value: str, cascade_values: bool | None = None)[source]

Bases: BaseMemberValue, SelectionValue

SDMX 2.1 MemberValue.

id: str[source]

Unique identifier of the object.

measures: MeasureDescriptor[source]

A MeasureDescriptor.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.DataflowDefinition(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None, structure: sdmx.model.v21.DataStructureDefinition = <factory>)[source]

Bases: BaseDataflow

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.DimensionDescriptorValuesTarget(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None)[source]

Bases: TargetObject

SDMX 2.1 DimensionDescriptorValuesTarget.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.EnumeratedAttributeValue(value_for: MetadataAttribute, parent: ReportedAttribute | None = None, child: list[ReportedAttribute] = <factory>)[source]

Bases: ReportedAttribute

SDMX 2.1 EnumeratedAttributeValue.

Analogous to v30.CodedMetadataAttributeValue.

value: str[source]
value_of: Code[source]

Note

The SDMX 2.1 IM (2011-08) gives this as valueFor, but this name duplicates ReportedAttribute.value_for. sdmx uses value_of for consistency with v30.CodedMetadataAttributeValue.value_of.

class sdmx.model.v21.GenericDataSet(annotations: list[BaseAnnotation] = <factory>, action: ActionType | None = None, valid_from: str | None = None, described_by: BaseDataflow | None = None, structured_by: DataStructureDefinition | None = None, obs: list[BaseObservation] = <factory>, series: SeriesKey, list[~sdmx.model.common.BaseObservation]]=None, group: GroupKey, list[~sdmx.model.common.BaseObservation]]=None, attrib: DictLikeDescriptor[str, ~sdmx.model.common.AttributeValue]=None)[source]

Bases: DataSet

SDMX 2.1 GenericDataSet.

This subclass has no additional functionality compared to DataSet.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

class sdmx.model.v21.GenericTimeSeriesDataSet(annotations: list[BaseAnnotation] = <factory>, action: ActionType | None = None, valid_from: str | None = None, described_by: BaseDataflow | None = None, structured_by: DataStructureDefinition | None = None, obs: list[BaseObservation] = <factory>, series: SeriesKey, list[~sdmx.model.common.BaseObservation]]=None, group: GroupKey, list[~sdmx.model.common.BaseObservation]]=None, attrib: DictLikeDescriptor[str, ~sdmx.model.common.AttributeValue]=None)[source]

Bases: DataSet

SDMX 2.1 GenericTimeSeriesDataSet.

This subclass has no additional functionality compared to DataSet.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

class sdmx.model.v21.HierarchicalCodelist(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, hierarchy: list[Hierarchy] = <factory>)[source]

Bases: MaintainableArtefact

SDMX 2.1 HierarchicalCodelist.

hierarchy: list[Hierarchy][source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.Hierarchy(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, has_formal_levels: bool = False, codes: dict[str, ~sdmx.model.common.HierarchicalCode]=<factory>, level: Level | None = None)[source]

Bases: NameableArtefact

SDMX 2.1 Hierarchy.

codes: dict[str, HierarchicalCode][source]

Hierarchical codes in the hierarchy.

has_formal_levels: bool = False[source]
id: str[source]

Unique identifier of the object.

level: Level | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.IdentifiableObjectTarget(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, object_type: type[IdentifiableArtefact] | None = None)[source]

Bases: TargetObject

SDMX 2.1 IdentifiableObjectTarget.

id: str[source]

Unique identifier of the object.

object_type: type[IdentifiableArtefact] | None = None[source]

Type of IdentifiableArtefact that is targeted.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.ItemAssociation(annotations: list[BaseAnnotation] = <factory>, source: IT | None = None, target: IT | None = None)[source]

Bases: AnnotableArtefact, Generic[IT]

SDMX 2.1 ItemAssociation.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

source: IT | None = None[source]
target: IT | None = None[source]
class sdmx.model.v21.ItemSchemeMap(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, source: IST | None = None, target: IST | None = None, item_association: list[IAT] = <factory>)[source]

Bases: NameableArtefact, Generic[IST, IAT]

SDMX 2.1 ItemSchemeMap.

id: str[source]

Unique identifier of the object.

item_association: list[IAT][source]
source: IST | None = None[source]
target: IST | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.MeasureDescriptor(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>)[source]

Bases: ComponentList[PrimaryMeasure]

SDMX 2.1 MeasureDescriptor.

For SDMX 3.0 see instead v30.MeasureDescriptor.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.MeasureDimension(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, order: int | None = None, concept_role: Concept | None = None)[source]

Bases: DimensionComponent

SDMX 2.1 MeasureDimension.

This class is not present in SDMX 3.0.

concept_role: Concept | None = None[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.MemberSelection(values_for: Component, included: bool = True, values: list[BaseSelectionValue] = <factory>)[source]

Bases: BaseMemberSelection

SDMX 2.1 MemberSelection.

class sdmx.model.v21.MemberValue(value: str, cascade_values: bool | None = None)[source]

Bases: BaseMemberValue, SelectionValue

SDMX 2.1 MemberValue.

class sdmx.model.v21.MetadataReport(annotations: list[BaseAnnotation] = <factory>, metadata: list[TReportedAttribute] = <factory>, target: MetadataTarget | None = None, attaches_to: TargetObjectKey | None = None)[source]

Bases: AnnotableArtefact

SDMX 2.1 MetadataReport.

Note

The SDMX 2.1 IM does not specify that this is a subtype of AnnotableArtefact, but this is implied by the XSD schemas for SDMX-ML.

annotations[source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

attaches_to: TargetObjectKey | None = None[source]
get(mda_or_id: MetadataAttribute | str) TReportedAttribute[source]

Retrieve the ReportedAttribute for the given mda_or_id.

get_value(mda_or_id: MetadataAttribute | str) InternationalString | str | None[source]

Retrieve the value of a ReportedAttribute for the given mda_or_id.

metadata: list[TReportedAttribute][source]
target: MetadataTarget | None = None[source]
class sdmx.model.v21.MetadataSet(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, action: ActionType | None = None, reporting_begin: date | None = None, reporting_end: date | None = None, publication_period: date | None = None, publication_year: date | None = None, described_by: MetadataflowDefinition | None = None, structured_by: MetadataStructureDefinition | None = None, published_by: DataProvider | None = None, report: list[MetadataReport] = <factory>, report_structure: ReportStructure | None = None)[source]

Bases: BaseMetadataSet, NameableArtefact

SDMX 2.1 MetadataSet.

Important

The SDMX 2.1 IM (Figure 29/§7.4.1 on p.84 and §7.4.2.2 on p.87) gives two associations from MetadataSet with the same name “+describedBy”.

One is an association to a MetadataflowDefinition. sdmx implements this as the attribute MetadataSet.described_by.

The second is to a ReportStructure. Because Python does not allow for multiple class attributes with the same name, sdmx implements this as the attribute MetadataSet.report_structure, which differs from the name given in the standard.

One reason for this implementation choice is that MetadataSet.described_by is similar to DataSet.described_by in that each refers to a (meta)data flow definition.

Note

Contrast v30.MetadataSet, which inherits from MaintainableArtefact instead of NameableArtefact.

described_by: MetadataflowDefinition | None = None[source]

See note above.

id: str[source]

Unique identifier of the object.

published_by: DataProvider | None = None[source]

Analogous to v30.MetadataSet.provided_by.

report: list[MetadataReport][source]
report_structure: ReportStructure | None = None[source]

See note above.

structured_by: MetadataStructureDefinition | None = None[source]

See also

v30.MetadataSet.structured_by, which has different semantics.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.MetadataStructureDefinition(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, report_structure: DictLikeDescriptor[str, ~sdmx.model.v21.ReportStructure]=None, target: DictLikeDescriptor[str, ~sdmx.model.v21.MetadataTarget]=None)[source]

Bases: BaseMetadataStructureDefinition

SDMX 2.1 MetadataStructureDefinition.

id: str[source]

Unique identifier of the object.

report_structure: DictLikeDescriptor[str, ReportStructure] = None[source]
target: DictLikeDescriptor[str, MetadataTarget] = None[source]

Association to 1 or more MetadataTarget

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.MetadataTarget(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>)[source]

Bases: ComponentList

SDMX 2.1 MetadataTarget.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.MetadataflowDefinition(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, structure: MetadataStructureDefinition | None = None)[source]

Bases: BaseMetadataflow

SDMX 2.1 MetadataflowDefinition.

id: str[source]

Unique identifier of the object.

structure: MetadataStructureDefinition | None = None[source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.NoSpecifiedRelationship[source]

Bases: AttributeRelationship

Indicates that the attribute is attached to the entire data set.

class sdmx.model.v21.NonEnumeratedAttributeValue(value_for: MetadataAttribute, parent: ReportedAttribute | None = None, child: list[ReportedAttribute] = <factory>)[source]

Bases: ReportedAttribute

SDMX 2.1 NonEnumeratedAttributeValue.

class sdmx.model.v21.Observation(attached_attribute: sdmx.dictlike.DictLikeDescriptor[str, sdmx.model.common.AttributeValue]=None, series_key: sdmx.model.common.SeriesKey | None = None, dimension: sdmx.model.common.Key | None = None, value: Any | sdmx.model.common.Code | None = None, group_keys: set[sdmx.model.common.GroupKey] = <factory>, value_for: sdmx.model.v21.PrimaryMeasure | None = None)[source]

Bases: BaseObservation

value_for: PrimaryMeasure | None = None[source]
class sdmx.model.v21.OtherNonEnumeratedAttributeValue(value_for: MetadataAttribute, parent: ReportedAttribute | None = None, child: list[ReportedAttribute] = <factory>, value: str | None = None)[source]

Bases: NonEnumeratedAttributeValue

SDMX 2.1 OtherNonEnumeratedAttributeValue.

value: str | None = None[source]
class sdmx.model.v21.PrimaryMeasure(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None)[source]

Bases: Component

SDMX 2.1 PrimaryMeasure.

This class is not present in SDMX 3.0; see instead v30.Measure.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.PrimaryMeasureRelationship[source]

Bases: AttributeRelationship

Indicates that the attribute is attached to a particular observation.

class sdmx.model.v21.RangePeriod(start: sdmx.model.common.StartPeriod, end: sdmx.model.common.EndPeriod)[source]

Bases: TimeRangeValue

end: EndPeriod[source]
start: StartPeriod[source]
class sdmx.model.v21.ReportPeriodTarget(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None)[source]

Bases: TargetObject

SDMX 2.1 ReportPeriodTarget.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.ReportStructure(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>, report_for: list[MetadataTarget] = <factory>)[source]

Bases: ComponentList

SDMX 2.1 ReportStructure.

id: str[source]

Unique identifier of the object.

report_for: list[MetadataTarget][source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.ReportedAttribute(value_for: MetadataAttribute, parent: ReportedAttribute | None = None, child: list[ReportedAttribute] = <factory>)[source]

Bases: object

SDMX 2.1 ReportedAttribute.

Analogous to v30.MetadataAttributeValue.

child: list[ReportedAttribute][source]
get_child(mda_or_id: MetadataAttribute | str) TReportedAttribute | None[source]

Retrieve the child ReportedAttribute for the given mda_or_id.

parent: ReportedAttribute | None = None[source]
value_for: MetadataAttribute[source]
class sdmx.model.v21.ReportingCategory(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>)[source]

Bases: Item

SDMX 2.1 ReportingCategory.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.ReportingTaxonomy(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: ItemScheme

SDMX 2.1 ReportingTaxonomy.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.ReportingYearStartDay(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, related_to: AttributeRelationship | None = None, usage_status: UsageStatus | None = None, concept_role: Concept | None = None)[source]

Bases: DataAttribute

SDMX 2.1 ReportingYearStartDay.

This class is deleted in SDMX 3.0.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.SelectionValue[source]

Bases: BaseSelectionValue

SDMX 2.1 SelectionValue.

Identical to its parent class.

class sdmx.model.v21.StructureSet(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, item_scheme_map: list[ItemSchemeMap] = <factory>)[source]

Bases: MaintainableArtefact

SDMX 2.1 StructureSet.

id: str[source]

Unique identifier of the object.

item_scheme_map: list[ItemSchemeMap][source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.StructureSpecificDataSet(annotations: list[BaseAnnotation] = <factory>, action: ActionType | None = None, valid_from: str | None = None, described_by: BaseDataflow | None = None, structured_by: DataStructureDefinition | None = None, obs: list[BaseObservation] = <factory>, series: SeriesKey, list[~sdmx.model.common.BaseObservation]]=None, group: GroupKey, list[~sdmx.model.common.BaseObservation]]=None, attrib: DictLikeDescriptor[str, ~sdmx.model.common.AttributeValue]=None)[source]

Bases: DataSet

SDMX 2.1 StructureSpecificDataSet.

This subclass has no additional functionality compared to DataSet.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

class sdmx.model.v21.StructureSpecificTimeSeriesDataSet(annotations: list[BaseAnnotation] = <factory>, action: ActionType | None = None, valid_from: str | None = None, described_by: BaseDataflow | None = None, structured_by: DataStructureDefinition | None = None, obs: list[BaseObservation] = <factory>, series: SeriesKey, list[~sdmx.model.common.BaseObservation]]=None, group: GroupKey, list[~sdmx.model.common.BaseObservation]]=None, attrib: DictLikeDescriptor[str, ~sdmx.model.common.AttributeValue]=None)[source]

Bases: DataSet

SDMX 2.1 StructureSpecificTimeSeriesDataSet.

This subclass has no additional functionality compared to DataSet.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

class sdmx.model.v21.TargetIdentifiableObject(value_for: TargetObject, obj: IdentifiableArtefact)[source]

Bases: TargetObjectValue

SDMX 2.1 TargetIdentifiableObject.

obj: IdentifiableArtefact[source]
class sdmx.model.v21.TargetObject(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None)[source]

Bases: Component

SDMX 2.1 TargetObject.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v21.TargetObjectKey(key_values: DictLikeDescriptor[str, TargetObjectValue] = None)[source]

Bases: object

SDMX 2.1 TargetObjectKey.

TargetObjectKey supports item access (tok["name"]) to members of key_values.

key_values: DictLikeDescriptor[str, TargetObjectValue] = None[source]

Keys and values of the TargetObjectKey.

class sdmx.model.v21.TargetObjectValue(value_for: TargetObject)[source]

Bases: object

SDMX 2.1 TargetObjectValue.

value_for: TargetObject[source]
class sdmx.model.v21.TargetReportPeriod(value_for: TargetObject, report_period: str)[source]

Bases: TargetObjectValue

SDMX 2.1 TargetReportPeriod.

report_period: str[source]
class sdmx.model.v21.TextAttributeValue(value_for: MetadataAttribute, parent: ReportedAttribute | None = None, child: list[ReportedAttribute] = <factory>, text: InternationalStringDescriptor = None)[source]

Bases: BaseTextAttributeValue, NonEnumeratedAttributeValue

SDMX 2.1 TextAttributeValue.

property value: InternationalString[source]

Convenience access to BaseTextAttributeValue.text.

This allows accessing the value of any ReportedAttribute subclass with the same attribute name.

sdmx extension not in the IM.

class sdmx.model.v21.TimeRangeValue[source]

Bases: SelectionValue

SDMX 2.1 TimeRangeValue.

class sdmx.model.v21.XHTMLAttributeValue(value: str, value_for: MetadataAttribute, parent: ReportedAttribute | None = None, child: list[ReportedAttribute] = <factory>)[source]

Bases: NonEnumeratedAttributeValue, BaseXHTMLAttributeValue

SDMX 2.1 XHTMLAttributeValue.

value: str[source]

SDMX 3.0

SDMX 3.0 Information Model.

class sdmx.model.v30.KeyValue(id: str, value: Any, value_for: DimensionComponent | None = None, dsd: dataclasses.InitVar[BaseDataStructureDefinition] = None)[source]

One value in a multi-dimensional Key.

__eq__(other)[source]

Compare the value to a simple Python built-in type or other key-like.

other may be KeyValue or ComponentValue; if so, and both self and other have value_for, these must refer to the same object.

id: str[source]
value: Any[source]

The actual value.

value_for: DimensionComponent | None = None[source]
class sdmx.model.v30.AfterPeriod(is_inclusive: bool, period: datetime, valid_from: str | None = None, valid_to: str | None = None)[source]

Bases: TimeRangeValue, Period

SDMX 3.0 AfterPeriod.

class sdmx.model.v30.Annotation(id: str | None = None, title: str | None = None, type: str | None = None, url: str | None = None, text: InternationalStringDescriptor = None, value: str | None = None)[source]

Bases: BaseAnnotation

SDMX 3.0 Annotation.

value: str | None = None[source]

A non-localised version of the Annotation content.

class sdmx.model.v30.BeforePeriod(is_inclusive: bool, period: datetime, valid_from: str | None = None, valid_to: str | None = None)[source]

Bases: TimeRangeValue, Period

SDMX 3.0 BeforePeriod.

class sdmx.model.v30.CodeSelection(mv: list['MemberValue'] = <factory>)[source]

Bases: object

mv: list[MemberValue][source]
class sdmx.model.v30.CodedMetadataAttributeValue[source]

Bases: MetadataAttributeValue

SDMX 3.0 CodedMetadataAttributeValue.

Analogous to v21.EnumeratedAttributeValue.

value_of: Code[source]
class sdmx.model.v30.CodelistExtension(extends: sdmx.model.common.Codelist, prefix: str | None = None, sequence: int | None = None, selection: sdmx.model.v30.CodeSelection | None = None)[source]

Bases: object

extends: Codelist[source]
prefix: str | None = None[source]
selection: CodeSelection | None = None[source]
sequence: int | None = None[source]
class sdmx.model.v30.Constraint(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, role: ConstraintRole | None = None)[source]

Bases: BaseConstraint

SDMX 3.0 Constraint (abstract class).

For SDMX 2.1, see v21.Constraint.

role: ConstraintRole | None = None[source]
class sdmx.model.v30.DataConstraint(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None, role: sdmx.model.common.ConstraintRole | None = None, content: set[sdmx.model.common.ConstrainableArtefact] = <factory>, data_content_keys: sdmx.model.v30.DataKeySet | None = None, data_content_region: sdmx.model.common.CubeRegion | None = None)[source]

Bases: Constraint

content: set[ConstrainableArtefact][source]
data_content_keys: DataKeySet | None = None[source]
data_content_region: CubeRegion | None = None[source]
class sdmx.model.v30.DataKey(included: bool, key_value: dict[sdmx.model.common.Component, sdmx.model.common.ComponentValue]=<factory>, valid_from: str | None = None, valid_to: str | None = None)[source]

Bases: BaseDataKey

valid_from: str | None = None[source]

Date from which the DataKey is valid.

valid_to: str | None = None[source]

Date from which the DataKey is superseded.

class sdmx.model.v30.DataKeySet(included: bool, keys: list[sdmx.model.common.BaseDataKey] = <factory>, member: Any = None)[source]

Bases: BaseDataKeySet

member: Any = None[source]

the diagram shows “member” as an attribute of DataKey, but the table lists it as an attribute of DataKeySet.

Type:

TODO the SDMX 3.0 spec is ambiguous about this

class sdmx.model.v30.DataSet(annotations: list[BaseAnnotation] = <factory>, action: ActionType | None = None, valid_from: str | None = None, described_by: BaseDataflow | None = None, structured_by: BaseDataStructureDefinition | None = None, obs: list[BaseObservation] = <factory>, series: SeriesKey, list[~sdmx.model.common.BaseObservation]]=None, group: GroupKey, list[~sdmx.model.common.BaseObservation]]=None)[source]

Bases: BaseDataSet

SDMX 3.0 Data Set.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

structured_by: DataStructureDefinition | None = None[source]

Association to the DataStructure <.BaseDataStructureDefinition that defines the structure of the data set.

class sdmx.model.v30.DataStructureDefinition(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, attributes: AttributeDescriptor = <factory>, dimensions: DimensionDescriptor = <factory>, group_dimensions: DictLikeDescriptor[str, ~sdmx.model.common.GroupDimensionDescriptor]=None, measures: MeasureDescriptor = <factory>, metadata: MetadataStructureDefinition | None = None)[source]

Bases: BaseDataStructureDefinition

SDMX 3.0 DataStructureDefinition (‘DSD’).

ConstraintType[source]

alias of DataConstraint

class MemberSelection(values_for: Component, included: bool = True, values: list[BaseSelectionValue] = <factory>, remove_prefix: bool = False)[source]

Bases: BaseMemberSelection

SDMX 3.0 MemberSelection.

remove_prefix: bool = False[source]

Whether Codes should retain the prefix specified in a code list extension.

class MemberValue(value: str, cascade_values: bool | None = None, valid_from: str | None = None, valid_to: str | None = None)[source]

Bases: SelectionValue, BaseMemberValue

SDMX 3.0 MemberValue.

id: str[source]

Unique identifier of the object.

measures: MeasureDescriptor[source]

A MeasureDescriptor.

metadata: MetadataStructureDefinition | None = None[source]

Association to a MetatadatStructureDefinition.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.Dataflow(annotations: list[sdmx.model.common.BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | sdmx.model.version.Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: 'Agency | None' = None, structure: sdmx.model.v30.DataStructureDefinition = <factory>)[source]

Bases: BaseDataflow

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.DataflowRelationship[source]

Bases: AttributeRelationship

SDMX 3.0 DataflowRelationship.

Indicates that the attribute is attached to the entire data set. Compare with v21.NoSpecifiedRelationship.

class sdmx.model.v30.ExclusiveCodeSelection(mv: list[MemberValue] = <factory>)[source]

Bases: CodeSelection

class sdmx.model.v30.GeoCodelist(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: Codelist[GeoRefCode]

SDMX 3.0 GeoCodelist (abstract class).

geo_type: ClassVar[GeoCodelistType][source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.GeoFeatureSetCode(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>, value: str = '')[source]

Bases: GeoRefCode

SDMX 3.0 GeoFeatureSetCode.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

value: str = ''[source]
class sdmx.model.v30.GeoGridCode(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>, geo_cell: str = '')[source]

Bases: GeoRefCode

SDMX 3.0 GridCode.

geo_cell: str = ''[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.GeoGridCodelist(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>, grid_definition: str = '')[source]

Bases: GeoCodelist

SDMX 3.0 GeoGridCodelist.

geo_type: ClassVar[GeoCodelistType] = 2[source]
grid_definition: str = ''[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.GeoRefCode(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>)[source]

Bases: Code

SDMX 3.0 GeoRefCode (abstract class).

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.GeographicCodelist(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: GeoCodelist

SDMX 3.0 GeographicCodelist.

geo_type: ClassVar[GeoCodelistType] = 1[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.Hierarchy(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, has_formal_levels: bool = False, level: Level | None = None, codes: dict[str, ~sdmx.model.common.HierarchicalCode]=<factory>)[source]

Bases: MaintainableArtefact

SDMX 3.0 Hierarchy.

codes: dict[str, HierarchicalCode][source]

The top-level HierarchicalCodes in the hierarchy.

has_formal_levels: bool = False[source]
id: str[source]

Unique identifier of the object.

level: Level | None = None[source]

The top Level in the hierarchy.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.HierarchyAssociation(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, context_object: IdentifiableArtefact | None = None, linked_object: IdentifiableArtefact | None = None, linked_hierarchy: Hierarchy | None = None)[source]

Bases: MaintainableArtefact

SDMX 3.0 HierarchyAssociation.

context_object: IdentifiableArtefact | None = None[source]

The context within which the association is performed.

id: str[source]

Unique identifier of the object.

linked_hierarchy: Hierarchy | None = None[source]

The Hierarchy that is associated.

linked_object: IdentifiableArtefact | None = None[source]

The IdentifiableArtefact that needs the Hierarchy.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.IdentifiableObjectSelection[source]

Bases: object

SDMX 3.0 IdentifiableObjectSelection.

class sdmx.model.v30.InclusiveCodeSelection(mv: list[MemberValue] = <factory>)[source]

Bases: CodeSelection

class sdmx.model.v30.Measure(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, concept_role: Concept | None = None)[source]

Bases: Component

SDMX 3.0 Measure.

This class is not present in SDMX 2.1; see instead v21.PrimaryMeasure.

concept_role: Concept | None = None[source]
id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.MeasureDescriptor(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>)[source]

Bases: ComponentList[Measure]

SDMX 3.0 MeasureDescriptor.

For SDMX 2.1 see instead v21.MeasureDescriptor.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.MeasureRelationship[source]

Bases: AttributeRelationship

SDMX 3.0 MeasureRelationship.

class sdmx.model.v30.MemberSelection(values_for: Component, included: bool = True, values: list[BaseSelectionValue] = <factory>, remove_prefix: bool = False)[source]

Bases: BaseMemberSelection

SDMX 3.0 MemberSelection.

remove_prefix: bool = False[source]

Whether Codes should retain the prefix specified in a code list extension.

class sdmx.model.v30.MemberValue(value: str, cascade_values: bool | None = None, valid_from: str | None = None, valid_to: str | None = None)[source]

Bases: SelectionValue, BaseMemberValue

SDMX 3.0 MemberValue.

class sdmx.model.v30.MetadataAttributeDescriptor(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, components: list[CT] = <factory>)[source]

Bases: ComponentList

SDMX 3.0 MetadataAttributeDescriptor.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.MetadataAttributeUsage(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, concept_identity: Concept | None = None, local_representation: Representation | None = None, related_to: AttributeRelationship | None = None, metadata_attribute: MetadataAttribute | None = None)[source]

Bases: AttributeComponent

SDMX 3.x MetadataAttributeUsage.

The existence, name, and attributes of this class are ambiguous in the SDMX IM as of version 3.1. See https://github.com/sdmx-twg/sdmx-im/issues/53 for details. This implementation follows “Interpretation B” recorded there, wherein MetadataAttributeUsage (referer) occurring within the AttributeDescriptor of a DataStructureDefinition is distinct from the referent MetadataAttribute occuring within the MetadataAttributeDescriptor of a MetadataStructureDefinition.

id: str[source]

Unique identifier of the object.

metadata_attribute: MetadataAttribute | None = None[source]

Association to a MetadataAttribute within a MetadataAttributeDescriptor and MetadataStructureDefinition.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.MetadataAttributeValue[source]

Bases: object

SDMX 3.0 MetadataAttributeValue.

Analogous to v21.ReportedAttribute.

child: list[MetadataAttributeValue] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object>,_field_type=None)[source]
parent: MetadataAttributeValue | None = None[source]
class sdmx.model.v30.MetadataConstraint(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, role: ConstraintRole | None = None)[source]

Bases: Constraint

metadata_content_region: MetadataTargetRegion | None = None[source]
class sdmx.model.v30.MetadataProvider(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, parent: IT | ItemScheme | None = None, child: list[IT] = <factory>, contact: list[Contact] = <factory>)[source]

Bases: Organisation

An organization that produces reference metadata.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.MetadataProviderScheme(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, is_partial: bool | None = None, items: dict[str, ~sdmx.model.common.IT]=<factory>)[source]

Bases: OrganisationScheme[MetadataProvider]

A maintained collection of MetadataProvider.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.MetadataSet(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, action: ActionType | None = None, reporting_begin: date | None = None, reporting_end: date | None = None, publication_period: date | None = None, publication_year: date | None = None, described_by: Metadataflow | None = None, structured_by: MetadataAttributeDescriptor | None = None, set_id: str | None = None, provided_by: MetadataProvider | None = None, attaches_to: list[TargetIdentifiableObject] = <factory>, metadata: list[MetadataAttributeValue] = <factory>)[source]

Bases: BaseMetadataSet, MaintainableArtefact

SDMX 3.0 MetadataSet.

Note

Contrast v21.MetadataSet, which is a NameableArtefact.

attaches_to: list[TargetIdentifiableObject][source]
described_by: Metadataflow | None = None[source]

Note

According to the standard, MetadataSet has two associations, both named .described_by: one to a Metadataflow, and the other to a MetadataProvisionAgreement. sdmx implements the first, because it is consistent with SDMX 2.1.

id: str[source]

Unique identifier of the object.

metadata: list[MetadataAttributeValue][source]
provided_by: MetadataProvider | None = None[source]

Analogous to v21.MetadataSet.published_by.

set_id: str | None = None[source]
structured_by: MetadataAttributeDescriptor | None = None[source]

Note

According to the standard, this differs from v21.MetadataSet.structured_by in that it points directly to MetadataStructureDefinition.attributes, rather than to the MetadataStructureDefinition that contains the attribute descriptor.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

valid_from: str | None = None[source]

Date from which the version is valid.

valid_to: str | None = None[source]

Date from which the version is superseded.

class sdmx.model.v30.MetadataStructureDefinition(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, attributes: MetadataAttributeDescriptor = <factory>)[source]

Bases: BaseMetadataStructureDefinition

SDMX 3.0 MetadataStructureDefinition.

attributes: MetadataAttributeDescriptor[source]

A MetadataAttributeDescriptor that describes the attributes of the metadata structure.

Note

The SDMX 3.0.0 IM (version 1.0 / 2021-10) does not give a name for this association. sdmx uses attributes for consistency with DataStructureDefinition.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.Metadataflow(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None)[source]

Bases: BaseMetadataflow

SDMX 3.0 MetadataflowDefinition.

id: str[source]

Unique identifier of the object.

uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.Observation(attached_attribute: sdmx.dictlike.DictLikeDescriptor[str, sdmx.model.common.AttributeValue]=None, series_key: sdmx.model.common.SeriesKey | None = None, dimension: sdmx.model.common.Key | None = None, value: Any | sdmx.model.common.Code | None = None, group_keys: set[sdmx.model.common.GroupKey] = <factory>, value_for: sdmx.model.v30.Measure | None = None)[source]

Bases: BaseObservation

value_for: Measure | None = None[source]
class sdmx.model.v30.ObservationRelationship[source]

Bases: AttributeRelationship

SDMX 3.0 ObservationRelationship.

Indicates that the attribute is attached to a particular observation. Compare with v21.PrimaryMeasureRelationship.

class sdmx.model.v30.OtherUncodedAttributeValue[source]

Bases: UncodedMetadataAttributeValue

SDMX 3.0 OtherUncodedAttributeValue.

start_time: date[source]
value: str[source]
class sdmx.model.v30.RangePeriod(valid_from: str | None = None, valid_to: str | None = None, start: sdmx.model.common.StartPeriod | None = None, end: sdmx.model.common.EndPeriod | None = None)[source]

Bases: TimeRangeValue

end: EndPeriod | None = None[source]
start: StartPeriod | None = None[source]
class sdmx.model.v30.SelectionValue(valid_from: str | None = None, valid_to: str | None = None)[source]

Bases: BaseSelectionValue

valid_from: str | None = None[source]

Date from which the DataKey is valid.

valid_to: str | None = None[source]

Date from which the DataKey is superseded.

class sdmx.model.v30.StructureSpecificDataSet(annotations: list[BaseAnnotation] = <factory>, action: ActionType | None = None, valid_from: str | None = None, described_by: BaseDataflow | None = None, structured_by: BaseDataStructureDefinition | None = None, obs: list[BaseObservation] = <factory>, series: SeriesKey, list[~sdmx.model.common.BaseObservation]]=None, group: GroupKey, list[~sdmx.model.common.BaseObservation]]=None)[source]

Bases: DataSet

SDMX 3.0 StructureSpecificDataSet.

This subclass has no additional functionality compared to DataSet.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

class sdmx.model.v30.TargetIdentifiableObject[source]

Bases: object

SDMX 3.0 TargetIdentifiableObject.

class sdmx.model.v30.TextAttributeValue(text: InternationalStringDescriptor = None)[source]

Bases: UncodedMetadataAttributeValue, BaseTextAttributeValue

SDMX 3.0 TextAttributeValue.

class sdmx.model.v30.TimeRangeValue(valid_from: str | None = None, valid_to: str | None = None)[source]

Bases: SelectionValue

SDMX 3.0 TimeRangeValue.

class sdmx.model.v30.UncodedMetadataAttributeValue[source]

Bases: MetadataAttributeValue

SDMX 3.0 UncodedMetadataAttributeValue.

class sdmx.model.v30.ValueItem(annotations: list[BaseAnnotation] = <factory>, id: str = '', name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None)[source]

Bases: EnumeratedItem

SDMX 3.0 ValueItem.

annotations: list[BaseAnnotation][source]

Annotations of the object.

sdmx implementation detail: The IM does not specify the name of this feature.

class sdmx.model.v30.ValueList(annotations: list[BaseAnnotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, name: InternationalStringDescriptor = None, description: InternationalStringDescriptor = None, version: str | Version | None = None, valid_from: str | None = None, valid_to: str | None = None, is_final: bool | None = None, is_external_reference: bool | None = None, service_url: str | None = None, structure_url: str | None = None, maintainer: Agency | None = None, items: list[ValueItem] = <factory>)[source]

Bases: EnumeratedList

SDMX 3.0 ValueList.

append(item: ValueItem) None[source]
id: str[source]

Unique identifier of the object.

items: list[ValueItem][source]
uri: str | None[source]

Universal resource identifier that may or may not be resolvable.

urn: str | None[source]

Universal resource name. For use in SDMX registries; all registered objects have a URN.

class sdmx.model.v30.XHTMLAttributeValue(value: str)[source]

Bases: UncodedMetadataAttributeValue, BaseXHTMLAttributeValue

SDMX 3.0 XHTMLAttributeValue.