SDMX Information Model

Contents

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 AnnotableArtefact Annotation 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 MetadataTargetRegion NamePersonalisation NamePersonalisationScheme NameableArtefact Organisation OrganisationScheme ProvisionAgreement QueryDatasource RESTDatasource Representation Ruleset RulesetScheme SeriesKey SimpleDatasource StartPeriod Structure StructureUsage TimeDimension TimeKeyValue ToVTLSpaceKey Transformation TransformationScheme UserDefinedOperator UserDefinedOperatorScheme VTLConceptMapping VTLDataflowMapping VTLMappingScheme VersionableArtefact

Quick links to classes specific to the SDMX 2.1 implementation:

AfterPeriod BeforePeriod CodeMap CodelistMap Constraint ContentConstraint DataKey DataKeySet 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 BeforePeriod CodedMetadataAttributeValue CodelistExtension Constraint DataConstraint DataKey DataKeySet DataStructureDefinition Dataflow DataflowRelationship GeoCodelist GeoFeatureSetCode GeoGridCode GeoGridCodelist GeoRefCode GeographicCodelist Hierarchy HierarchyAssociation IdentifiableObjectSelection Measure MeasureDescriptor MeasureRelationship MemberSelection MemberValue MetadataAttributeDescriptor 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: str | Sequence | Mapping | Iterable[Tuple[str, str]] | None = None, **kwargs)[source]#

Bases: object

SDMX-IM InternationalString.

SDMX-IM LocalisedString is not implemented. Instead, the ‘localizations’ is a mapping where:

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

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

When used as a type hint with pydantic, InternationalString fields can be assigned to 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

Information Model classes common to SDMX 2.1 and 3.0.

class sdmx.model.common.ActionType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

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

Bases: Organisation

SDMX-IM Organization.

This class is identical to its parent class.

class sdmx.model.common.AgencyScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: OrganisationScheme[Agency]

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

A singleton.

class sdmx.model.common.AnnotableArtefact(annotations: List[sdmx.model.common.Annotation] = <factory>)[source]#

Bases: object

annotations: List[Annotation][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.Annotation(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.

class sdmx.model.common.AttributeComponent(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None)[source]#

Bases: Component

SDMX 3.0 AttributeComponent.

Note

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

class sdmx.model.common.AttributeDescriptor(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, components: ~typing.List[~sdmx.model.common.CT] = <factory>)[source]#

Bases: ComponentList[DataAttribute]

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: object

SDMX AttributeValue.

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

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two AttributeValues are equal if their properties are equal.

Parameters:

strict (bool, optional) – Passed to compare().

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.BaseConstraint(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.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: ~typing.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: ~typing.List[~sdmx.model.common.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: ~typing.List[~sdmx.model.common.Annotation] = <factory>, action: ~sdmx.model.common.ActionType | None = None, valid_from: str | None = None, described_by: ~sdmx.model.common.BaseDataflow | None = None, structured_by: ~sdmx.model.common.BaseDataStructureDefinition | None = None, obs: ~typing.List[~sdmx.model.common.BaseObservation] = <factory>, series: ~sdmx.dictlike.DictLikeDescriptor[~sdmx.model.common.SeriesKey, ~typing.List[~sdmx.model.common.BaseObservation]] = None, group: ~sdmx.dictlike.DictLikeDescriptor[~sdmx.model.common.GroupKey, ~typing.List[~sdmx.model.common.BaseObservation]] = None)[source]#

Bases: AnnotableArtefact

Common features of SDMX 2.1 and 3.0 DataSet.

action: ActionType | None = None[source]#
add_obs(observations, series_key=None)[source]#

Add observations to a series with series_key.

Checks consistency and adds group associations.

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two DataSets are the same if:

  • their action, valid_from compare equal.

  • all dataset-level attached attributes compare equal.

  • they have the same number of observations, series, and groups.

Parameters:

strict (bool, optional) – Passed to compare().

described_by: BaseDataflow | None = None[source]#
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]#
valid_from: str | None = None[source]#
class sdmx.model.common.BaseDataStructureDefinition(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, attributes: ~sdmx.model.common.AttributeDescriptor = <factory>, dimensions: ~sdmx.model.common.DimensionDescriptor = <factory>, group_dimensions: ~sdmx.dictlike.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.

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.

class sdmx.model.common.BaseDataflow(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, structure: ~sdmx.model.common.BaseDataStructureDefinition = <factory>)[source]#

Bases: StructureUsage, ConstrainableArtefact

Common features of SDMX 2.1 DataflowDefinition and 3.0 Dataflow.

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

Iterate over keys.

class sdmx.model.common.BaseMemberSelection(values_for: ~sdmx.model.common.Component, included: bool = True, values: ~typing.List[~sdmx.model.common.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)[source]#

Bases: object

ABC for SDMX 2.1 and 3.0 MetadataSet.

action: ActionType | None = None[source]#
publication_period: date | None = None[source]#
publication_year: date | None = None[source]#
reporting_begin: date | None = None[source]#
reporting_end: date | None = None[source]#
class sdmx.model.common.BaseMetadataStructureDefinition(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None)[source]#

Bases: Structure, ConstrainableArtefact

ABC for SDMX 2.1 and 3.0 MetadataStructureDefinition.

class sdmx.model.common.BaseMetadataflow(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None)[source]#

Bases: StructureUsage, ConstrainableArtefact

ABC for SDMX 2.1 MetadataflowDefinition and SDMX 3.0 Metadataflow.

class sdmx.model.common.BaseObservation(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: ~typing.Any | ~sdmx.model.common.Code | None = None, group_keys: ~typing.Set[~sdmx.model.common.GroupKey] = <factory>)[source]#

Bases: object

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.

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two Observations are equal if:

Parameters:

strict (bool, optional) – Passed to compare().

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.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: Optional[str] = None, valid_from: Optional[str] = None, valid_to: Optional[str] = None, is_final: Optional[bool] = None, is_external_reference: Optional[bool] = None, service_url: Optional[str] = None, structure_url: Optional[str] = None, maintainer: Optional[ForwardRef('Agency')] = None, category: Optional[sdmx.model.common.Category] = None, artefact: Optional[sdmx.model.common.IdentifiableArtefact] = None)[source]#

Bases: MaintainableArtefact

artefact: IdentifiableArtefact | None = None[source]#
category: Category | None = None[source]#
class sdmx.model.common.Category(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: ~sdmx.model.common.IT | ~sdmx.model.common.ItemScheme | None = None, child: ~typing.List[~sdmx.model.common.IT] = <factory>)[source]#

Bases: Item[Category]

SDMX-IM Category.

class sdmx.model.common.CategoryScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[Category]

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: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: ~sdmx.model.common.IT | ~sdmx.model.common.ItemScheme | None = None, child: ~typing.List[~sdmx.model.common.IT] = <factory>)[source]#

Bases: Item[Code]

SDMX Code.

class sdmx.model.common.Codelist(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[IT]

SDMX Codelist.

class sdmx.model.common.CodingFormat[source]#

Bases: object

SDMX CodingFormat.

coding_format: Facet[source]#
class sdmx.model.common.Component(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, concept_identity: Optional[sdmx.model.common.Concept] = None, local_representation: Optional[sdmx.model.common.Representation] = None)[source]#

Bases: IdentifiableArtefact

concept_identity: Concept | None = None[source]#
local_representation: Representation | None = None[source]#
class sdmx.model.common.ComponentList(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, 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.

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two ComponentLists are the same if:

Parameters:

strict (bool, optional) – Passed to compare() and IdentifiableArtefact.compare().

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.

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: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: ~sdmx.model.common.IT | ~sdmx.model.common.ItemScheme | None = None, child: ~typing.List[~sdmx.model.common.IT] = <factory>)[source]#

Bases: Item[Concept]

core_representation: Representation | None = None[source]#
iso_concept: ISOConceptReference | None = None[source]#
class sdmx.model.common.ConceptScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[Concept]

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(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

actual = 2[source]#
allowable = 1[source]#
class sdmx.model.common.Contact(name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, org_unit: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, telephone: str | None = None, responsibility: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, email: ~typing.List[str] = <factory>, fax: ~typing.List[str] = <factory>, uri: ~typing.List[str] = <factory>, x400: ~typing.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.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, 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: Optional[str] = None, null_value: Optional[str] = None, output_format: Optional[str] = None, vtl_literal_format: Optional[str] = None, vtl_scalar_type: Optional[str] = None)[source]#

Bases: Item[CustomType]

data_type: str | None = None[source]#
null_value: str | None = None[source]#
output_format: str | None = None[source]#
vtl_literal_format: str | None = None[source]#
vtl_scalar_type: str | None = None[source]#
class sdmx.model.common.CustomTypeScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[CustomType]

class sdmx.model.common.DataAttribute(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, concept_identity: Optional[sdmx.model.common.Concept] = None, local_representation: Optional[sdmx.model.common.Representation] = None, related_to: Optional[sdmx.model.common.AttributeRelationship] = None, usage_status: Optional[sdmx.model.common.UsageStatus] = None, concept_role: Optional[sdmx.model.common.Concept] = None)[source]#

Bases: Component

concept_role: Concept | None = None[source]#
related_to: AttributeRelationship | None = None[source]#
usage_status: UsageStatus | None = None[source]#
class sdmx.model.common.DataConsumer(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: ~sdmx.model.common.IT | ~sdmx.model.common.ItemScheme | None = None, child: ~typing.List[~sdmx.model.common.IT] = <factory>, contact: ~typing.List[~sdmx.model.common.Contact] = <factory>)[source]#

Bases: Organisation, ConstrainableArtefact

SDMX DataConsumer.

class sdmx.model.common.DataConsumerScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: OrganisationScheme[DataConsumer]

class sdmx.model.common.DataProvider(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: ~sdmx.model.common.IT | ~sdmx.model.common.ItemScheme | None = None, child: ~typing.List[~sdmx.model.common.IT] = <factory>, contact: ~typing.List[~sdmx.model.common.Contact] = <factory>)[source]#

Bases: Organisation, ConstrainableArtefact

SDMX DataProvider.

class sdmx.model.common.DataProviderScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: OrganisationScheme[DataProvider]

class sdmx.model.common.Datasource[source]#

Bases: object

url: str[source]#
class sdmx.model.common.Dimension(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None, order: int | None = None, concept_role: ~sdmx.model.common.Concept | None = None)[source]#

Bases: DimensionComponent

SDMX Dimension.

concept_role: Concept | None = None[source]#
class sdmx.model.common.DimensionComponent(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None, order: int | None = None)[source]#

Bases: Component

SDMX DimensionComponent (abstract class).

order: int | None = None[source]#
class sdmx.model.common.DimensionDescriptor(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, components: ~typing.List[~sdmx.model.common.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)

order_key(key)[source]#

Return a key ordered according to the DSD.

class sdmx.model.common.DimensionRelationship(dimensions: List[sdmx.model.common.DimensionComponent] = <factory>, group_key: Optional[ForwardRef('GroupDimensionDescriptor')] = 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(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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: Optional[str] = None, value_type: Optional[sdmx.model.common.FacetValueType] = 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(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, components: ~typing.List[~sdmx.model.common.CT] = <factory>)[source]#

Bases: DimensionDescriptor

assign_order()[source]#

assign_order() has no effect for GroupDimensionDescriptor.

attachment_constraint: bool | None = None[source]#
class sdmx.model.common.GroupKey(arg: 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: Optional[ForwardRef('GroupDimensionDescriptor')] = 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: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, valid_from: str | None = None, valid_to: str | None = None, code: ~sdmx.model.common.Code | None = None, level: ~sdmx.model.common.Level | None = None, parent: ~sdmx.model.common.HierarchicalCode | ~typing.Any | None = None, child: ~typing.List[~sdmx.model.common.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.

level: Level | None = None[source]#
parent: HierarchicalCode | Any | None = None[source]#
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.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>)[source]#

Bases: AnnotableArtefact

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two IdentifiableArtefacts are the same if they have the same id, uri, and urn.

Parameters:

strict (bool, optional) – Passed to compare().

id: str = ''[source]#

Unique identifier of the object.

uri: str | None = None[source]#

Universal resource identifier that may or may not be resolvable.

urn: str | None = None[source]#

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

urn_group: Dict[source]#
class sdmx.model.common.Item(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, 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’.

parent: IT | ItemScheme | None = None[source]#
class sdmx.model.common.ItemScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.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 (same class as :attr:`items`) – Item to add.

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two ItemSchemes are the same if:

Parameters:

strict (bool, optional) – Passed to compare() and MaintainableArtefact.compare().

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

Extend the ItemScheme with members of items.

Parameters:

items (iterable of Item) – Elements must be of the same class as items.

get_hierarchical(id: str) IT[source]#

Get an Item by its hierarchical_id.

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.

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: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: ~sdmx.model.common.Level | ~typing.Any | None = None, child: ~sdmx.model.common.Level | None = None, code_format: ~sdmx.model.common.CodingFormat = <factory>)[source]#

Bases: NameableArtefact

SDMX Level.

child: Level | None = None[source]#
code_format: CodingFormat[source]#
parent: Level | Any | None = None[source]#
class sdmx.model.common.MaintainableArtefact(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: Optional[str] = None, valid_from: Optional[str] = None, valid_to: Optional[str] = None, is_final: Optional[bool] = None, is_external_reference: Optional[bool] = None, service_url: Optional[str] = None, structure_url: Optional[str] = None, maintainer: Optional[ForwardRef('Agency')] = None)[source]#

Bases: VersionableArtefact

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two MaintainableArtefacts are the same if:

Parameters:

strict (bool, optional) – Passed to compare() and VersionableArtefact.compare().

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.

class sdmx.model.common.MetadataAttribute(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None, is_presentational: bool | None = None, max_occurs: int | None = None, min_occurs: int | None = None, parent: ~sdmx.model.common.MetadataAttribute | None = None, child: ~typing.List[~sdmx.model.common.MetadataAttribute] = <factory>)[source]#

Bases: AttributeComponent

SDMX MetadataAttribute.

child: List[MetadataAttribute][source]#
is_presentational: bool | None = None[source]#
max_occurs: int | None = None[source]#
min_occurs: int | None = None[source]#
parent: MetadataAttribute | None = None[source]#
class sdmx.model.common.MetadataTargetRegion(is_included: bool = True)[source]#

Bases: object

is_included: bool = True[source]#
class sdmx.model.common.NamePersonalisation(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, 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: Optional[str] = None)[source]#

Bases: Item[NamePersonalisation]

vtl_default_name: str | None = None[source]#
class sdmx.model.common.NamePersonalisationScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[NamePersonalisation]

class sdmx.model.common.NameableArtefact(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None)[source]#

Bases: IdentifiableArtefact

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two NameableArtefacts are the same if:

Parameters:

strict (bool, optional) – Passed to compare() and IdentifiableArtefact.compare().

description: InternationalStringDescriptor = None[source]#

Multi-lingual description of the object.

name: InternationalStringDescriptor = None[source]#

Multi-lingual name of the object.

class sdmx.model.common.Organisation(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, 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]#
class sdmx.model.common.OrganisationScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[IT]

SDMX OrganisationScheme (abstract class).

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', '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'}[source]#

The SDMX-IM defines ‘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.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: Optional[str] = None, valid_from: Optional[str] = None, valid_to: Optional[str] = None, is_final: Optional[bool] = None, is_external_reference: Optional[bool] = None, service_url: Optional[str] = None, structure_url: Optional[str] = None, maintainer: Optional[ForwardRef('Agency')] = None, structure_usage: Optional[sdmx.model.common.StructureUsage] = None, data_provider: Optional[sdmx.model.common.DataProvider] = None)[source]#

Bases: MaintainableArtefact, ConstrainableArtefact

data_provider: DataProvider | None = None[source]#
structure_usage: StructureUsage | None = None[source]#
class sdmx.model.common.QueryDatasource[source]#

Bases: Datasource

class sdmx.model.common.RESTDatasource[source]#

Bases: QueryDatasource

class sdmx.model.common.Representation(enumerated: Optional[sdmx.model.common.ItemScheme] = 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.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType] = None, child: List[~IT] = <factory>, definition: Optional[str] = None, scope: Optional[str] = None, type: Optional[str] = None)[source]#

Bases: Item[Ruleset]

definition: str | None = None[source]#
scope: str | None = None[source]#
type: str | None = None[source]#
class sdmx.model.common.RulesetScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[Ruleset]

class sdmx.model.common.SeriesKey(attrib: sdmx.dictlike.DictLikeDescriptor[str, sdmx.model.common.AttributeValue] = None, described_by: Optional[sdmx.model.common.DimensionDescriptor] = 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.Structure(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: Optional[str] = None, valid_from: Optional[str] = None, valid_to: Optional[str] = None, is_final: Optional[bool] = None, is_external_reference: Optional[bool] = None, service_url: Optional[str] = None, structure_url: Optional[str] = None, maintainer: Optional[ForwardRef('Agency')] = None)[source]#

Bases: MaintainableArtefact

compare(other: Structure, strict: bool = True) bool[source]#

Return True if self is the same as other.

Two MaintainableArtefacts are the same if:

Parameters:

strict (bool, optional) – Passed to compare() and VersionableArtefact.compare().

property grouping: Sequence[ComponentList][source]#

A collection of all the ComponentLists associated with a subclass.

replace_grouping(cl: ComponentList) None[source]#

Replace existing component list with cl.

class sdmx.model.common.StructureUsage(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None)[source]#

Bases: MaintainableArtefact

structure: Structure | None = None[source]#
class sdmx.model.common.TimeDimension(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None, order: int | None = None)[source]#

Bases: DimensionComponent

SDMX TimeDimension.

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.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: Union[~IT, ForwardRef('ItemScheme'), NoneType] = None, child: List[~IT] = <factory>, expression: Optional[str] = None, result: Optional[str] = None)[source]#

Bases: Item[Transformation]

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

Bases: ItemScheme[Transformation]

custom_type_scheme: CustomTypeScheme | None = None[source]#
name_personalisation_scheme: NamePersonalisationScheme | None = None[source]#
ruleset_scheme: RulesetScheme | None = None[source]#
update_ref(ref)[source]#
user_defined_operator_scheme: UserDefinedOperatorScheme | None = None[source]#
vtl_mapping_scheme: VTLMappingScheme | None = None[source]#
class sdmx.model.common.UsageStatus(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

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

Bases: Item[UserDefinedOperator]

definition: str | None = None[source]#
class sdmx.model.common.UserDefinedOperatorScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[UserDefinedOperator]

class sdmx.model.common.VTLConceptMapping(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, 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: Optional[sdmx.model.common.Concept] = None)[source]#

Bases: VTLMapping

concept_alias: Concept | None = None[source]#
class sdmx.model.common.VTLDataflowMapping(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, 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: Optional[sdmx.model.common.BaseDataflow] = None, from_vtl_method: Sequence[sdmx.model.common.VTLSpaceKey] = <factory>, from_vtl_superspace: Optional[sdmx.model.common.VTLSpaceKey] = None, to_vtl_method: Optional[sdmx.model.common.SDMXtoVTL] = None, to_vtl_subspace: 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]#
to_vtl_method: SDMXtoVTL | None = None[source]#
to_vtl_subspace: Sequence[VTLSpaceKey][source]#
class sdmx.model.common.VTLMapping(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, parent: ~sdmx.model.common.IT | ~sdmx.model.common.ItemScheme | None = None, child: ~typing.List[~sdmx.model.common.IT] = <factory>)[source]#

Bases: Item[VTLMapping]

class sdmx.model.common.VTLMappingScheme(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.Agency | None = None, is_partial: bool | None = None, items: ~typing.Dict[str, ~sdmx.model.common.IT] = <factory>)[source]#

Bases: ItemScheme[VTLMapping]

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

Bases: object

key: str[source]#
class sdmx.model.common.VersionableArtefact(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: Optional[str] = None, valid_from: Optional[str] = None, valid_to: Optional[str] = None)[source]#

Bases: NameableArtefact

compare(other, strict=True)[source]#

Return True if self is the same as other.

Two VersionableArtefacts are the same if:

Parameters:

strict (bool, optional) – Passed to compare() and NameableArtefact.compare().

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 | 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.BeforePeriod(is_inclusive: bool, period: datetime)[source]#

Bases: TimeRangeValue, Period

class sdmx.model.v21.CodeMap(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, source: ~sdmx.model.common.IT | None = None, target: ~sdmx.model.common.IT | None = None)[source]#

Bases: ItemAssociation[Code]

SDMX 2.1 CodeMap.

class sdmx.model.v21.CodelistMap(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, source: ~sdmx.model.v21.IST | None = None, target: ~sdmx.model.v21.IST | None = None, item_association: ~typing.List[~sdmx.model.v21.IAT] = <factory>)[source]#

Bases: ItemSchemeMap[Codelist, CodeMap]

SDMX 2.1 CodelistMap.

class sdmx.model.v21.Constraint(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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)[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.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: Optional[str] = None, valid_from: Optional[str] = None, valid_to: Optional[str] = None, is_final: Optional[bool] = None, is_external_reference: Optional[bool] = None, service_url: Optional[str] = None, structure_url: Optional[str] = None, maintainer: Optional[ForwardRef('Agency')] = None, role: Optional[sdmx.model.common.ConstraintRole] = None, data_content_keys: Optional[sdmx.model.v21.DataKeySet] = None, data_content_region: List[sdmx.model.common.CubeRegion] = <factory>, content: Set[sdmx.model.common.ConstrainableArtefact] = <factory>, metadata_content_region: Optional[sdmx.model.common.MetadataTargetRegion] = 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: ~typing.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: ~typing.List[~sdmx.model.common.BaseDataKey] = <factory>)[source]#

Bases: BaseDataKeySet

SDMX 2.1 DataKeySet.

Identical to its parent class.

class sdmx.model.v21.DataSetTarget(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None)[source]#

Bases: TargetObject

SDMX 2.1 DataSetTarget.

class sdmx.model.v21.DataStructureDefinition(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.model.common.AttributeDescriptor = <factory>, dimensions: ~sdmx.model.common.DimensionDescriptor = <factory>, group_dimensions: ~sdmx.dictlike.DictLikeDescriptor[str, ~sdmx.model.common.GroupDimensionDescriptor] = None, measures: ~sdmx.model.v21.MeasureDescriptor = <factory>)[source]#

Bases: BaseDataStructureDefinition

SDMX 2.1 DataStructureDefinition (‘DSD’).

ConstraintType[source]#

alias of ContentConstraint

class MemberSelection(values_for: ~sdmx.model.common.Component, included: bool = True, values: ~typing.List[~sdmx.model.common.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.

measures: MeasureDescriptor[source]#

A MeasureDescriptor.

class sdmx.model.v21.DataflowDefinition(annotations: List[sdmx.model.common.Annotation] = <factory>, id: str = '', uri: Optional[str] = None, urn: Optional[str] = None, urn_group: Dict = <factory>, name: sdmx.model.internationalstring.InternationalStringDescriptor = None, description: sdmx.model.internationalstring.InternationalStringDescriptor = None, version: Optional[str] = None, valid_from: Optional[str] = None, valid_to: Optional[str] = None, is_final: Optional[bool] = None, is_external_reference: Optional[bool] = None, service_url: Optional[str] = None, structure_url: Optional[str] = None, maintainer: Optional[ForwardRef('Agency')] = None, structure: sdmx.model.v21.DataStructureDefinition = <factory>)[source]#

Bases: BaseDataflow

class sdmx.model.v21.DimensionDescriptorValuesTarget(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None)[source]#

Bases: TargetObject

SDMX 2.1 DimensionDescriptorValuesTarget.

class sdmx.model.v21.EnumeratedAttributeValue(value_for: ~sdmx.model.common.MetadataAttribute, parent: ~sdmx.model.v21.ReportedAttribute | None = None, child: ~typing.List[~sdmx.model.v21.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: ~typing.List[~sdmx.model.common.Annotation] = <factory>, action: ~sdmx.model.common.ActionType | None = None, valid_from: str | None = None, described_by: ~sdmx.model.common.BaseDataflow | None = None, structured_by: ~sdmx.model.common.BaseDataStructureDefinition | None = None, obs: ~typing.List[~sdmx.model.common.BaseObservation] = <factory>, series: ~sdmx.dictlike.DictLikeDescriptor[~sdmx.model.common.SeriesKey, ~typing.List[~sdmx.model.common.BaseObservation]] = None, group: ~sdmx.dictlike.DictLikeDescriptor[~sdmx.model.common.GroupKey, ~typing.List[~sdmx.model.common.BaseObservation]] = None, attrib: ~sdmx.dictlike.DictLikeDescriptor[str, ~sdmx.model.common.AttributeValue] = None)[source]#

Bases: DataSet

SDMX 2.1 GenericDataSet.

This subclass has no additional functionality compared to DataSet.

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

Bases: DataSet

SDMX 2.1 GenericTimeSeriesDataSet.

This subclass has no additional functionality compared to DataSet.

class sdmx.model.v21.HierarchicalCodelist(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~typing.List[~sdmx.model.v21.Hierarchy] = <factory>)[source]#

Bases: MaintainableArtefact

SDMX 2.1 HierarchicalCodelist.

hierarchy: List[Hierarchy][source]#
class sdmx.model.v21.Hierarchy(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, has_formal_levels: bool = False, codes: ~typing.Dict[str, ~sdmx.model.common.HierarchicalCode] = <factory>, level: ~sdmx.model.common.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]#
level: Level | None = None[source]#
class sdmx.model.v21.IdentifiableObjectTarget(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None)[source]#

Bases: TargetObject

SDMX 2.1 IdentifiableObjectTarget.

class sdmx.model.v21.ItemAssociation(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, source: ~sdmx.model.common.IT | None = None, target: ~sdmx.model.common.IT | None = None)[source]#

Bases: AnnotableArtefact, Generic[IT]

SDMX 2.1 ItemAssociation.

source: IT | None = None[source]#
target: IT | None = None[source]#
class sdmx.model.v21.ItemSchemeMap(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, source: ~sdmx.model.v21.IST | None = None, target: ~sdmx.model.v21.IST | None = None, item_association: ~typing.List[~sdmx.model.v21.IAT] = <factory>)[source]#

Bases: NameableArtefact, Generic[IST, IAT]

SDMX 2.1 ItemSchemeMap.

item_association: List[IAT][source]#
source: IST | None = None[source]#
target: IST | None = None[source]#
class sdmx.model.v21.MeasureDescriptor(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, components: ~typing.List[~sdmx.model.common.CT] = <factory>)[source]#

Bases: ComponentList[PrimaryMeasure]

SDMX 2.1 MeasureDescriptor.

For SDMX 3.0 see instead v30.MeasureDescriptor.

class sdmx.model.v21.MeasureDimension(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None, order: int | None = None, concept_role: ~sdmx.model.common.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]#
class sdmx.model.v21.MemberSelection(values_for: ~sdmx.model.common.Component, included: bool = True, values: ~typing.List[~sdmx.model.common.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(metadata: ~typing.List[~sdmx.model.v21.ReportedAttribute] = <factory>, target: ~sdmx.model.v21.MetadataTarget | None = None, attaches_to: ~sdmx.model.v21.TargetObjectKey | None = None)[source]#

Bases: object

SDMX 2.1 MetadataReport.

attaches_to: TargetObjectKey | None = None[source]#
metadata: List[ReportedAttribute][source]#
target: MetadataTarget | None = None[source]#
class sdmx.model.v21.MetadataSet(action: ~sdmx.model.common.ActionType | None = None, reporting_begin: ~datetime.date | None = None, reporting_end: ~datetime.date | None = None, publication_period: ~datetime.date | None = None, publication_year: ~datetime.date | None = None, annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, described_by: ~sdmx.model.v21.MetadataflowDefinition | None = None, structured_by: ~sdmx.model.v21.MetadataStructureDefinition | None = None, published_by: ~sdmx.model.common.DataProvider | None = None, report: ~typing.List[~sdmx.model.v21.MetadataReport] = <factory>)[source]#

Bases: NameableArtefact, BaseMetadataSet

SDMX 2.1 MetadataSet.

Note

Contrast v30.MetadataSet, which is a MaintainableArtefact.

described_by: MetadataflowDefinition | None = None[source]#
published_by: DataProvider | None = None[source]#

Analogous to v30.MetadataSet.provided_by.

report: List[MetadataReport][source]#
structured_by: MetadataStructureDefinition | None = None[source]#
class sdmx.model.v21.MetadataStructureDefinition(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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: ~sdmx.dictlike.DictLikeDescriptor[str, ~sdmx.model.v21.ReportStructure] = None, target: ~sdmx.dictlike.DictLikeDescriptor[str, ~sdmx.model.v21.MetadataTarget] = None)[source]#

Bases: BaseMetadataStructureDefinition

SDMX 2.1 MetadataStructureDefinition.

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

Association to 1 or more MetadataTarget

class sdmx.model.v21.MetadataTarget(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, components: ~typing.List[~sdmx.model.common.CT] = <factory>)[source]#

Bases: ComponentList

SDMX 2.1 MetadataTarget.

class sdmx.model.v21.MetadataflowDefinition(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, name: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, description: ~sdmx.model.internationalstring.InternationalStringDescriptor = None, version: str | 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.MetadataStructureDefinition | None = None)[source]#

Bases: BaseMetadataflow

SDMX 2.1 MetadataflowDefinition.

structure: MetadataStructureDefinition | None = None[source]#
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: ~sdmx.model.common.MetadataAttribute, parent: ~sdmx.model.v21.ReportedAttribute | None = None, child: ~typing.List[~sdmx.model.v21.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: Optional[sdmx.model.common.SeriesKey] = None, dimension: Optional[sdmx.model.common.Key] = None, value: Union[Any, sdmx.model.common.Code, NoneType] = None, group_keys: Set[sdmx.model.common.GroupKey] = <factory>, value_for: Optional[sdmx.model.v21.PrimaryMeasure] = None)[source]#

Bases: BaseObservation

value_for: PrimaryMeasure | None = None[source]#
class sdmx.model.v21.OtherNonEnumeratedAttributeValue(value_for: ~sdmx.model.common.MetadataAttribute, parent: ~sdmx.model.v21.ReportedAttribute | None = None, child: ~typing.List[~sdmx.model.v21.ReportedAttribute] = <factory>)[source]#

Bases: NonEnumeratedAttributeValue

SDMX 2.1 OtherNonEnumeratedAttributeValue.

value: str[source]#
class sdmx.model.v21.PrimaryMeasure(annotations: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None)[source]#

Bases: Component

SDMX 2.1 PrimaryMeasure.

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

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: ~typing.List[~sdmx.model.common.Annotation] = <factory>, id: str = '', uri: str | None = None, urn: str | None = None, urn_group: ~typing.Dict = <factory>, concept_identity: ~sdmx.model.common.Concept | None = None, local_representation: ~sdmx.model.common.Representation | None = None)[source]#

Bases: TargetObject

SDMX 2.1 ReportPeriodTarget.

class sdmx.model.v21.ReportStructure(annotations: ~typing.List[~sdmx.model.common.Annotation]