SDMX Information Model
SDMX Information Model¶
SDMX Information Model (SDMX-IM).
This module implements many of the classes described in the SDMX-IM specification (‘spec’), which is available from:
- https://sdmx.org/wp-content/uploads/
SDMX_2-1-1_SECTION_2_InformationModel_201108.pdf
Details of the implementation:
Python typing and pydantic are used to enforce the types of attributes that reference instances of other classes.
Some classes have convenience attributes not mentioned in the spec, to ease navigation between related objects. These are marked “
sdmx
extension not in the IM.”Class definitions are grouped by section of the spec, but these sections appear out of order so that dependent classes are defined first.
- class sdmx.model.KeyValue(*args, id: str, value: Any = None, value_for: sdmx.model.Dimension = 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
orComponentValue
; if so, and both self and other havevalue_for
, these must refer to the same object.
- value: Any¶
The actual value.
- value_for: Optional[sdmx.model.Dimension]¶
- class sdmx.model.ActionType(value)¶
Bases:
enum.Enum
An enumeration.
- append = 3¶
- delete = 1¶
- information = 4¶
- replace = 2¶
- class sdmx.model.Agency(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, parent: Optional[Union[sdmx.model.IT, ItemScheme]] = None, child: List[sdmx.model.IT] = [], contact: List[sdmx.model.Contact] = [])[source]¶
Bases:
sdmx.model.Organisation
- contact: List[sdmx.model.Contact]¶
- class sdmx.model.AgencyScheme(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, is_partial: bool = None, items: Dict[str, sdmx.model.IT] = {})[source]¶
Bases:
sdmx.model.ItemScheme
[sdmx.model.Agency
],sdmx.model.OrganisationScheme
- class sdmx.model.AnnotableArtefact(*, annotations: List[sdmx.model.Annotation] = [])[source]¶
Bases:
sdmx.util.BaseModel
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- 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.Annotation(*, id: str = None, title: str = None, type: str = None, url: str = None, text: sdmx.model.InternationalString =)[source]¶
Bases:
sdmx.util.BaseModel
- text: sdmx.model.InternationalString¶
Content of the annotation.
- class sdmx.model.AttachmentConstraint(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, data_content_keys: sdmx.model.DataKeySet = None, role: sdmx.model.ConstraintRole, attachment: Set[sdmx.model.ConstrainableArtefact] = {})[source]¶
Bases:
sdmx.model.Constraint
- attachment: Set[sdmx.model.ConstrainableArtefact]¶
- class sdmx.model.AttributeDescriptor(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, components: List[sdmx.model.CT] = [], auto_order: int = 1)[source]¶
Bases:
sdmx.model.ComponentList
[sdmx.model.DataAttribute
]- components: List[sdmx.model.CT]¶
- class sdmx.model.AttributeValue(*args, value: Union[str, sdmx.model.Code], value_for: sdmx.model.DataAttribute = None, start_date: datetime.date = None)[source]¶
Bases:
sdmx.util.BaseModel
SDMX-IM 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.
- start_date: Optional[datetime.date]¶
- value: Union[str, sdmx.model.Code]¶
- value_for: Optional[sdmx.model.DataAttribute]¶
- class sdmx.model.Categorisation(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, category: sdmx.model.Category = None, artefact: sdmx.model.IdentifiableArtefact = None)[source]¶
Bases:
sdmx.model.MaintainableArtefact
- artefact: Optional[sdmx.model.IdentifiableArtefact]¶
- category: Optional[sdmx.model.Category]¶
- class sdmx.model.Category(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, parent: Optional[Union[sdmx.model.IT, ItemScheme]] = None, child: List[sdmx.model.IT] = [])[source]¶
Bases:
sdmx.model.Item
[Category
]SDMX-IM Category.
- child: List[sdmx.model.IT]¶
- parent: Optional[Union[sdmx.model.IT, sdmx.model.ItemScheme]]¶
- class sdmx.model.CategoryScheme(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, is_partial: bool = None, items: Dict[str, sdmx.model.IT] = {})[source]¶
- class sdmx.model.Code(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, parent: Optional[Union[sdmx.model.IT, ItemScheme]] = None, child: List[sdmx.model.IT] = [])[source]¶
Bases:
sdmx.model.Item
[Code
]SDMX-IM Code.
- child: List[sdmx.model.IT]¶
- parent: Optional[Union[sdmx.model.IT, sdmx.model.ItemScheme]]¶
- class sdmx.model.Codelist(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, is_partial: bool = None, items: Dict[str, sdmx.model.IT] = {})[source]¶
Bases:
sdmx.model.ItemScheme
[sdmx.model.Code
]
- class sdmx.model.Component(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, concept_identity: sdmx.model.Concept = None, local_representation: sdmx.model.Representation = None)[source]¶
Bases:
sdmx.model.IdentifiableArtefact
- concept_identity: Optional[sdmx.model.Concept]¶
- local_representation: Optional[sdmx.model.Representation]¶
- class sdmx.model.ComponentList(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, components: List[sdmx.model.CT] = [], auto_order: int = 1)[source]¶
Bases:
sdmx.model.IdentifiableArtefact
,Generic
[sdmx.model.CT
]- append(value: sdmx.model.CT)[source]¶
Append value to
components
.
- auto_order¶
- compare(other, strict=True)[source]¶
Return
True
if self is the same as other.Two ComponentLists are the same if:
IdentifiableArtefact.compare()
isTrue
, andcorresponding
components
compare equal.
- Parameters
strict (bool, optional) – Passed to
compare()
andIdentifiableArtefact.compare()
.
- components: List[sdmx.model.CT]¶
- getdefault(id, cls=None, **kwargs) sdmx.model.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 ofauto_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 ifcomponents
is overridden in a subclass of ComponentList.
- class sdmx.model.ComponentValue(*, value_for: sdmx.model.Component, value: Any = None)[source]¶
Bases:
sdmx.util.BaseModel
- value: Any¶
- value_for: sdmx.model.Component¶
- class sdmx.model.Concept(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, parent: Optional[Union[sdmx.model.IT, ItemScheme]] = None, child: List[sdmx.model.IT] = [], core_representation: sdmx.model.Representation = None, iso_concept: sdmx.model.ISOConceptReference = None)[source]¶
Bases:
sdmx.model.Item
[Concept
]- core_representation: Optional[sdmx.model.Representation]¶
- iso_concept: Optional[sdmx.model.ISOConceptReference]¶
- class sdmx.model.ConceptScheme(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, is_partial: bool = None, items: Dict[str, sdmx.model.IT] = {})[source]¶
- class sdmx.model.ConstrainableArtefact[source]¶
Bases:
sdmx.util.BaseModel
SDMX-IM ConstrainableArtefact.
- class sdmx.model.Constraint(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, data_content_keys: sdmx.model.DataKeySet = None, role: sdmx.model.ConstraintRole)[source]¶
Bases:
sdmx.model.MaintainableArtefact
- data_content_keys: Optional[sdmx.model.DataKeySet]¶
DataKeySet
included in the Constraint.
- class sdmx.model.ConstraintRole(*, role: sdmx.model.ConstraintRoleType)[source]¶
Bases:
sdmx.util.BaseModel
- class sdmx.model.ConstraintRoleType(value)¶
Bases:
enum.Enum
An enumeration.
- actual = 2¶
- allowable = 1¶
- class sdmx.model.Contact(*, name: sdmx.model.InternationalString = , org_unit: sdmx.model.InternationalString = , telephone: str = None, responsibility: sdmx.model.InternationalString = , email: List[str], uri: List[str])[source]¶
Bases:
sdmx.util.BaseModel
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.
‘uri’ may be a list of URIs, rather than a single URI.
- org_unit: sdmx.model.InternationalString¶
- responsibility: sdmx.model.InternationalString¶
- class sdmx.model.ContentConstraint(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, data_content_keys: sdmx.model.DataKeySet = None, role: sdmx.model.ConstraintRole, data_content_region: List[sdmx.model.CubeRegion] = [], content: Set[sdmx.model.ConstrainableArtefact] = {})[source]¶
Bases:
sdmx.model.Constraint
- content: Set[sdmx.model.ConstrainableArtefact]¶
- data_content_region: List[sdmx.model.CubeRegion]¶
CubeRegions
included in the ContentConstraint.
- iter_keys(obj: Union[sdmx.model.DataStructureDefinition, sdmx.model.DataflowDefinition], dims: List[str] = []) Generator[sdmx.model.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
- class sdmx.model.CubeRegion(*, included: bool = True, member: Dict[sdmx.model.Dimension, sdmx.model.MemberSelection] = {})[source]¶
Bases:
sdmx.util.BaseModel
- member: Dict[sdmx.model.Dimension, sdmx.model.MemberSelection]¶
- class sdmx.model.DataAttribute(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, concept_identity: sdmx.model.Concept = None, local_representation: sdmx.model.Representation = None, related_to: sdmx.model.AttributeRelationship = None, usage_status: sdmx.model.UsageStatus = None)[source]¶
Bases:
sdmx.model.Component
- usage_status: Optional[sdmx.model.UsageStatus]¶
- class sdmx.model.DataConsumer(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, parent: Optional[Union[sdmx.model.IT, ItemScheme]] = None, child: List[sdmx.model.IT] = [], contact: List[sdmx.model.Contact] = [])[source]¶
Bases:
sdmx.model.Organisation
,sdmx.model.ConstrainableArtefact
SDMX-IM DataConsumer.
- contact: List[sdmx.model.Contact]¶
- class sdmx.model.DataConsumerScheme(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, is_partial: bool = None, items: Dict[str, sdmx.model.IT] = {})[source]¶
Bases:
sdmx.model.ItemScheme
[sdmx.model.DataConsumer
],sdmx.model.OrganisationScheme
- class sdmx.model.DataKey(*, included: bool, key_value: Dict[sdmx.model.Component, sdmx.model.ComponentValue])[source]¶
Bases:
sdmx.util.BaseModel
- key_value: Dict[sdmx.model.Component, sdmx.model.ComponentValue]¶
Mapping from
Component
toComponentValue
comprising the key.
- class sdmx.model.DataKeySet(*, included: bool, keys: List[sdmx.model.DataKey] = [])[source]¶
Bases:
sdmx.util.BaseModel
- keys: List[sdmx.model.DataKey]¶
DataKeys
appearing in the set.
- class sdmx.model.DataProvider(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, parent: Optional[Union[sdmx.model.IT, ItemScheme]] = None, child: List[sdmx.model.IT] = [], contact: List[sdmx.model.Contact] = [])[source]¶
Bases:
sdmx.model.Organisation
,sdmx.model.ConstrainableArtefact
SDMX-IM DataProvider.
- contact: List[sdmx.model.Contact]¶
- class sdmx.model.DataProviderScheme(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, is_partial: bool = None, items: Dict[str, sdmx.model.IT] = {})[source]¶
Bases:
sdmx.model.ItemScheme
[sdmx.model.DataProvider
],sdmx.model.OrganisationScheme
- class sdmx.model.DataSet(*, annotations: List[sdmx.model.Annotation] = [], action: sdmx.model.ActionType = None, attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, valid_from: str = None, described_by: sdmx.model.DataflowDefinition = None, structured_by: sdmx.model.DataStructureDefinition = None, obs: List[sdmx.model.Observation] = [], series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]] = None, group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]] = None)[source]¶
Bases:
sdmx.model.AnnotableArtefact
- action: Optional[sdmx.model.ActionType]¶
- add_obs(observations, series_key=None)[source]¶
Add observations to a series with series_key.
Checks consistency and adds group associations.
- attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue]¶
- 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.
- described_by: Optional[sdmx.model.DataflowDefinition]¶
- group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]]¶
Map of group key → list of observations.
sdmx
extension not in the IM.
- obs: List[sdmx.model.Observation]¶
All observations in the DataSet.
- series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]]¶
Map of series key → list of observations.
sdmx
extension not in the IM.
- structured_by: Optional[sdmx.model.DataStructureDefinition]¶
- class sdmx.model.DataStructureDefinition(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, grouping: sdmx.model.ComponentList = None, attributes: sdmx.model.AttributeDescriptor = <AttributeDescriptor: >, dimensions: sdmx.model.DimensionDescriptor = <DimensionDescriptor: >, measures: sdmx.model.MeasureDescriptor = <MeasureDescriptor: >, group_dimensions: sdmx.util.DictLike[str, sdmx.model.GroupDimensionDescriptor] = None)[source]¶
Bases:
sdmx.model.Structure
,sdmx.model.ConstrainableArtefact
SDMX-IM DataStructureDefinition (‘DSD’).
- attributes: sdmx.model.AttributeDescriptor¶
A
AttributeDescriptor
that describes the attributes of the data structure.
- compare(other, strict=True)[source]¶
Return
True
if self is the same as other.Two DataStructureDefinitions are the same if each of
attributes
,dimensions
,measures
, andgroup_dimensions
compares equal.- Parameters
strict (bool, optional) – Passed to
ComponentList.compare()
.
- dimensions: sdmx.model.DimensionDescriptor¶
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 newConcepts
andCodelists
, created to represent all the values observed across keys for each dimension.
- group_dimensions: sdmx.util.DictLike[str, sdmx.model.GroupDimensionDescriptor]¶
Mapping from
GroupDimensionDescriptor.id
toGroupDimensionDescriptor
.
- iter_keys(constraint: Optional[sdmx.model.Constraint] = None, dims: List[str] = []) Generator[sdmx.model.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’sdimensions
, andvalues are ‘+’-delimited
str
containing allowable values, or iterables ofstr
, 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 itsdata_content_region
, including only the values appearing in key.- Return type
- 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
key_cls (Key or SeriesKey or GroupKey) – Class of Key to create.
values (dict) – Used to construct
Key.values
.extend (bool, optional) – If
True
, make_key will not returnKeyError
on missing dimensions. Insteaddimensions
(key_cls is Key or SeriesKey) orgroup_dimensions
(key_cls is GroupKey) will be extended by creating new Dimension objects.group_id (str, optional) – When key_cls is :class`.GroupKey`, the ID of the
GroupDimensionDescriptor
that structures the key.
- Returns
An instance of key_cls.
- Return type
- Raises
KeyError – If any of the keys of values is not a Dimension or Attribute in the DSD.
- measures: sdmx.model.MeasureDescriptor¶
- class sdmx.model.DataflowDefinition(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, structure: sdmx.model.DataStructureDefinition = <DataStructureDefinition (missing id)>)[source]¶
Bases:
sdmx.model.StructureUsage
,sdmx.model.ConstrainableArtefact
- iter_keys(constraint: Optional[sdmx.model.Constraint] = None, dims: List[str] = []) Generator[sdmx.model.Key, None, None] [source]¶
Iterate over keys.
See also
- structure: sdmx.model.DataStructureDefinition¶
- class sdmx.model.Dimension(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, concept_identity: sdmx.model.Concept = None, local_representation: sdmx.model.Representation = None, order: int = None)[source]¶
Bases:
sdmx.model.DimensionComponent
SDMX-IM Dimension.
- class sdmx.model.DimensionComponent(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, concept_identity: sdmx.model.Concept = None, local_representation: sdmx.model.Representation = None, order: int = None)[source]¶
Bases:
sdmx.model.Component
- class sdmx.model.DimensionDescriptor(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, components: List[sdmx.model.CT] = [], auto_order: int = 1)[source]¶
Bases:
sdmx.model.ComponentList
[sdmx.model.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 alist
(ordered) ofDimension
,MeasureDimension
, and/orTimeDimension
.- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- assign_order()[source]¶
Assign the
DimensionComponent.order
attribute.The Dimensions in
components
are numbered, starting from 1.
- components: List[sdmx.model.CT]¶
- classmethod from_key(key)[source]¶
Create a new DimensionDescriptor from a key.
For each
KeyValue
in the key:A new
Dimension
is created.A new
Codelist
is created, containing theKeyValue.value
.
- urn: Optional[str]¶
Universal resource name. For use in SDMX registries; all registered objects have a URN.
- urn_group: Dict¶
- class sdmx.model.DimensionRelationship(*, dimensions: List[sdmx.model.DimensionComponent] = [], group_key: GroupDimensionDescriptor = None)[source]¶
Bases:
sdmx.model.AttributeRelationship
- dimensions: List[sdmx.model.DimensionComponent]¶
- group_key: Optional[sdmx.model.GroupDimensionDescriptor]¶
NB the IM says “0..*” here in a diagram, but the text does not match.
- class sdmx.model.Facet(*, type: sdmx.model.FacetType = FacetType(is_sequence=None, min_length=None, max_length=None, min_value=None, max_value=None, start_value=None, end_value=None, interval=None, time_interval=None, decimals=None, pattern=None, start_time=None, end_time=None), value: str = None, value_type: sdmx.model.FacetValueType = None)[source]¶
Bases:
sdmx.util.BaseModel
- type: sdmx.model.FacetType¶
- value_type: Optional[sdmx.model.FacetValueType]¶
- class sdmx.model.FacetType(*, is_sequence: bool = None, min_length: int = None, max_length: int = None, min_value: float = None, max_value: float = None, start_value: float = None, end_value: str = None, interval: float = None, time_interval: datetime.timedelta = None, decimals: int = None, pattern: str = None, start_time: datetime.datetime = None, end_time: datetime.datetime = None)[source]¶
Bases:
sdmx.util.BaseModel
- end_time: Optional[datetime.datetime]¶
- start_time: Optional[datetime.datetime]¶
- time_interval: Optional[datetime.timedelta]¶
- class sdmx.model.FacetValueType(value)¶
Bases:
enum.Enum
An enumeration.
- alpha = 13¶
- alphaNumeric = 14¶
- basicTimePeriod = 20¶
- bigInteger = 2¶
- boolean = 9¶
- count = 11¶
- dataSetReference = 43¶
- dateTime = 34¶
- day = 38¶
- decimal = 6¶
- double = 8¶
- duration = 40¶
- exclusiveValueRange = 16¶
- float = 7¶
- gregorianDay = 25¶
- gregorianMonth = 23¶
- gregorianTimePeriod = 21¶
- gregorianYear = 22¶
- gregorianYearMonth = 24¶
- identifiableReference = 42¶
- inclusiveValueRange = 12¶
- incremental = 17¶
- integer = 3¶
- keyValues = 41¶
- long = 4¶
- month = 36¶
- monthDay = 37¶
- numeric = 15¶
- observationalTimePeriod = 18¶
- reportingDay = 33¶
- reportingMonth = 31¶
- reportingQuarter = 30¶
- reportingSemester = 28¶
- reportingTimePeriod = 26¶
- reportingTrimester = 29¶
- reportingWeek = 32¶
- reportingYear = 27¶
- short = 5¶
- standardTimePeriod = 19¶
- string = 1¶
- time = 39¶
- timesRange = 35¶
- uri = 10¶
- class sdmx.model.GenericDataSet(*, annotations: List[sdmx.model.Annotation] = [], action: sdmx.model.ActionType = None, attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, valid_from: str = None, described_by: sdmx.model.DataflowDefinition = None, structured_by: sdmx.model.DataStructureDefinition = None, obs: List[sdmx.model.Observation] = [], series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]] = None, group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]] = None)[source]¶
Bases:
sdmx.model.DataSet
SDMX-IM GenericDataSet.
- action: Optional[sdmx.model.ActionType]¶
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue]¶
- described_by: Optional[sdmx.model.DataflowDefinition]¶
- group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]]¶
Map of group key → list of observations.
sdmx
extension not in the IM.
- obs: List[sdmx.model.Observation]¶
All observations in the DataSet.
- series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]]¶
Map of series key → list of observations.
sdmx
extension not in the IM.
- structured_by: Optional[sdmx.model.DataStructureDefinition]¶
- class sdmx.model.GenericTimeSeriesDataSet(*, annotations: List[sdmx.model.Annotation] = [], action: sdmx.model.ActionType = None, attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, valid_from: str = None, described_by: sdmx.model.DataflowDefinition = None, structured_by: sdmx.model.DataStructureDefinition = None, obs: List[sdmx.model.Observation] = [], series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]] = None, group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]] = None)[source]¶
Bases:
sdmx.model.DataSet
SDMX-IM GenericTimeSeriesDataSet.
- action: Optional[sdmx.model.ActionType]¶
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue]¶
- described_by: Optional[sdmx.model.DataflowDefinition]¶
- group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]]¶
Map of group key → list of observations.
sdmx
extension not in the IM.
- obs: List[sdmx.model.Observation]¶
All observations in the DataSet.
- series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]]¶
Map of series key → list of observations.
sdmx
extension not in the IM.
- structured_by: Optional[sdmx.model.DataStructureDefinition]¶
- class sdmx.model.GroupDimensionDescriptor(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, components: List[sdmx.model.CT] = [], auto_order: int = 1, attachment_constraint: bool = None, constraint: sdmx.model.AttachmentConstraint = None)[source]¶
Bases:
sdmx.model.DimensionDescriptor
- assign_order()[source]¶
assign_order()
has no effect for GroupDimensionDescriptor.
- constraint: Optional[sdmx.model.AttachmentConstraint]¶
- class sdmx.model.GroupKey(arg: Mapping = None, *, attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, described_by: sdmx.model.GroupDimensionDescriptor = None, values: sdmx.util.DictLike[str, sdmx.model.KeyValue] = None, id: str = None)[source]¶
Bases:
sdmx.model.Key
- described_by: Optional[sdmx.model.GroupDimensionDescriptor]¶
- class sdmx.model.GroupRelationship(*, group_key: GroupDimensionDescriptor = None)[source]¶
Bases:
sdmx.model.AttributeRelationship
- group_key: Optional[sdmx.model.GroupDimensionDescriptor]¶
- class sdmx.model.ISOConceptReference(*, agency: str, id: str, scheme_id: str)[source]¶
Bases:
sdmx.util.BaseModel
- class sdmx.model.IdentifiableArtefact(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {})[source]¶
Bases:
sdmx.model.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
, andurn
.
- urn: Optional[str]¶
Universal resource name. For use in SDMX registries; all registered objects have a URN.
- urn_group: Dict¶
- class sdmx.model.InternationalString(value=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:
class Foo(BaseModel): name: InternationalString = InternationalString() # 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.
- class sdmx.model.Item(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, parent: Optional[Union[sdmx.model.IT, ItemScheme]] = None, child: List[sdmx.model.IT] = [])[source]¶
Bases:
sdmx.model.NameableArtefact
,Generic
[sdmx.model.IT
]- child: List[sdmx.model.IT]¶
- get_scheme()[source]¶
Return the
ItemScheme
to which the Item belongs, if any.
- property hierarchical_id¶
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’.
See also
- parent: Optional[Union[sdmx.model.IT, sdmx.model.ItemScheme]]¶
- class sdmx.model.ItemScheme(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, is_partial: bool = None, items: Dict[str, sdmx.model.IT] = {})[source]¶
Bases:
sdmx.model.MaintainableArtefact
,Generic
[sdmx.model.IT
]SDMX-IM Item Scheme.
The IM states that ItemScheme “defines a set of
Items
…” To simplify indexing/retrieval, this implementation uses adict
for theitems
attribute, in which the keys are theid
of the Item.Because this may change in future versions of pandaSDMX, user code should not access
items
directly. Instead, use thegetattr()
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: sdmx.model.IT)[source]¶
Add item to the ItemScheme.
- Parameters
item (same class as
items
) – Item to add.
- compare(other, strict=True)[source]¶
Return
True
if self is the same as other.Two ItemSchemes are the same if:
MaintainableArtefact.compare()
isTrue
, andtheir
items
have the same keys, and correspondingItems
compare equal.
- Parameters
strict (bool, optional) – Passed to
compare()
andMaintainableArtefact.compare()
.
- get_hierarchical(id: str) sdmx.model.IT [source]¶
Get an Item by its
hierarchical_id
.
- class sdmx.model.Key(arg: Union[Mapping, Sequence[sdmx.model.KeyValue]] = None, *, attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, described_by: sdmx.model.DimensionDescriptor = None, values: sdmx.util.DictLike[str, sdmx.model.KeyValue] = None)[source]¶
Bases:
sdmx.util.BaseModel
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 convience, the values of the key may be accessed directly:
>>> k = Key(foo=1, bar=2) >>> k.values['foo'] 1 >>> k['foo'] 1
- Parameters
dsd (DataStructureDefinition) – If supplied, the
dimensions
andattributes
are used to separate the kwargs intoKeyValues
andAttributeValues
. The kwargs fordescribed_by
, if any, must bedimensions
or appear ingroup_dimensions
.kwargs – Dimension and Attribute IDs, and/or the class properties.
- attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue]¶
- copy(arg=None, **kwargs)[source]¶
Duplicate a model, optionally choose which fields to include, exclude and change.
- Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data
deep – set to True to make a deep copy of the model
- Returns
new model instance
- described_by: Optional[sdmx.model.DimensionDescriptor]¶
- values: sdmx.util.DictLike[str, sdmx.model.KeyValue]¶
Individual KeyValues that describe the key.
- class sdmx.model.MaintainableArtefact(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None)[source]¶
Bases:
sdmx.model.VersionableArtefact
- compare(other, strict=True)[source]¶
Return
True
if self is the same as other.Two MaintainableArtefacts are the same if:
VersionableArtefact.compare()
isTrue
, andthey have the same
maintainer
.
- Parameters
strict (bool, optional) – Passed to
compare()
andVersionableArtefact.compare()
.
- is_external_reference: Optional[bool]¶
True
if the content of the object is held externally; i.e., not the currentMessage
.
- maintainer: Optional[sdmx.model.Agency]¶
Association to the Agency responsible for maintaining the object.
- class sdmx.model.MeasureDescriptor(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, components: List[sdmx.model.CT] = [], auto_order: int = 1)[source]¶
Bases:
sdmx.model.ComponentList
[sdmx.model.PrimaryMeasure
]- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- components: List[sdmx.model.CT]¶
- urn: Optional[str]¶
Universal resource name. For use in SDMX registries; all registered objects have a URN.
- urn_group: Dict¶
- class sdmx.model.MeasureDimension(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, concept_identity: sdmx.model.Concept = None, local_representation: sdmx.model.Representation = None, order: int = None)[source]¶
Bases:
sdmx.model.DimensionComponent
SDMX-IM MeasureDimension.
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- concept_identity: Optional[sdmx.model.Concept]¶
- local_representation: Optional[sdmx.model.Representation]¶
- urn: Optional[str]¶
Universal resource name. For use in SDMX registries; all registered objects have a URN.
- urn_group: Dict¶
- class sdmx.model.MemberSelection(*, included: bool = True, values_for: sdmx.model.Component, values: List[sdmx.model.SelectionValue] = [])[source]¶
Bases:
sdmx.util.BaseModel
- values: List[sdmx.model.SelectionValue]¶
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: sdmx.model.Component¶
- class sdmx.model.MemberValue(*, value: str, cascade_values: bool = None)[source]¶
Bases:
sdmx.model.SelectionValue
- class sdmx.model.NameableArtefact(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =)[source]¶
Bases:
sdmx.model.IdentifiableArtefact
- compare(other, strict=True)[source]¶
Return
True
if self is the same as other.Two NameableArtefacts are the same if:
IdentifiableArtefact.compare()
isTrue
, andthey have the same
name
anddescription
.
- Parameters
strict (bool, optional) – Passed to
compare()
andIdentifiableArtefact.compare()
.
- description: sdmx.model.InternationalString¶
Multi-lingual description of the object.
- name: sdmx.model.InternationalString¶
Multi-lingual name of the object.
- class sdmx.model.Observation(*, attached_attribute: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, series_key: sdmx.model.SeriesKey = None, dimension: sdmx.model.Key = None, value: Optional[Union[Any, sdmx.model.Code]] = None, value_for: sdmx.model.PrimaryMeasure = None, group_keys: Set[sdmx.model.GroupKey] = {})[source]¶
Bases:
sdmx.util.BaseModel
SDMX-IM Observation.
This class also implements the spec classes ObservationValue, UncodedObservationValue, and CodedObservation.
- attached_attribute: sdmx.util.DictLike[str, sdmx.model.AttributeValue]¶
- property attrib¶
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:
their
dimension
,value
,series_key
, andvalue_for
are all equal,their corresponding
attached_attribute
andgroup_keys
are all equal.
- property dim¶
- dimension: Optional[sdmx.model.Key]¶
Key for dimension(s) varying at the observation level.
- group_keys: Set[sdmx.model.GroupKey]¶
sdmx
extension not in the IM.
- property key¶
Return the entire key, including KeyValues at the series level.
- series_key: Optional[sdmx.model.SeriesKey]¶
- value: Optional[Union[Any, sdmx.model.Code]]¶
Data value.
- value_for: Optional[sdmx.model.PrimaryMeasure]¶
- class sdmx.model.Organisation(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, parent: Optional[Union[sdmx.model.IT, ItemScheme]] = None, child: List[sdmx.model.IT] = [], contact: List[sdmx.model.Contact] = [])[source]¶
Bases:
sdmx.model.Item
[Organisation
]- contact: List[sdmx.model.Contact]¶
- sdmx.model.PACKAGE = {<class 'sdmx.model.DataProviderScheme'>: 'base', <class 'sdmx.model.Agency'>: 'base', <class 'sdmx.model.AgencyScheme'>: 'base', <class 'sdmx.model.DataProvider'>: 'base', <class 'sdmx.model.Category'>: 'categoryscheme', <class 'sdmx.model.CategoryScheme'>: 'categoryscheme', <class 'sdmx.model.Categorisation'>: 'categoryscheme', <class 'sdmx.model.Codelist'>: 'codelist', <class 'sdmx.model.Code'>: 'codelist', <class 'sdmx.model.ConceptScheme'>: 'conceptscheme', <class 'sdmx.model.Concept'>: 'conceptscheme', <class 'sdmx.model.DataflowDefinition'>: 'datastructure', <class 'sdmx.model.StructureUsage'>: 'datastructure', <class 'sdmx.model.DataStructureDefinition'>: 'datastructure', <class 'sdmx.model.ProvisionAgreement'>: 'registry', <class 'sdmx.model.ContentConstraint'>: 'registry'}¶
The SDMX-IM defines ‘packages’; these are used in URNs.
- class sdmx.model.Period(*, is_inclusive: bool, period: datetime.datetime)[source]¶
Bases:
sdmx.util.BaseModel
- period: datetime.datetime¶
- class sdmx.model.PrimaryMeasure(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, concept_identity: sdmx.model.Concept = None, local_representation: sdmx.model.Representation = None)[source]¶
Bases:
sdmx.model.Component
SDMX-IM PrimaryMeasure.
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- concept_identity: Optional[sdmx.model.Concept]¶
- local_representation: Optional[sdmx.model.Representation]¶
- urn: Optional[str]¶
Universal resource name. For use in SDMX registries; all registered objects have a URN.
- urn_group: Dict¶
- class sdmx.model.ProvisionAgreement(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, structure_usage: sdmx.model.StructureUsage = None, data_provider: sdmx.model.DataProvider = None)[source]¶
Bases:
sdmx.model.MaintainableArtefact
,sdmx.model.ConstrainableArtefact
- data_provider: Optional[sdmx.model.DataProvider]¶
- structure_usage: Optional[sdmx.model.StructureUsage]¶
- class sdmx.model.RangePeriod(*, start: sdmx.model.Period, end: sdmx.model.Period)[source]¶
Bases:
sdmx.model.TimeRangeValue
- end: sdmx.model.Period¶
- start: sdmx.model.Period¶
- class sdmx.model.ReportingYearStartDay(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, concept_identity: sdmx.model.Concept = None, local_representation: sdmx.model.Representation = None, related_to: sdmx.model.AttributeRelationship = None, usage_status: sdmx.model.UsageStatus = None)[source]¶
Bases:
sdmx.model.DataAttribute
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- concept_identity: Optional[sdmx.model.Concept]¶
- local_representation: Optional[sdmx.model.Representation]¶
- urn: Optional[str]¶
Universal resource name. For use in SDMX registries; all registered objects have a URN.
- urn_group: Dict¶
- usage_status: Optional[sdmx.model.UsageStatus]¶
- class sdmx.model.Representation(*, enumerated: sdmx.model.ItemScheme = None, non_enumerated: List[sdmx.model.Facet] = [])[source]¶
Bases:
sdmx.util.BaseModel
- enumerated: Optional[sdmx.model.ItemScheme]¶
- non_enumerated: List[sdmx.model.Facet]¶
- class sdmx.model.SeriesKey(arg: Union[Mapping, Sequence[sdmx.model.KeyValue]] = None, *, attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, described_by: sdmx.model.DimensionDescriptor = None, values: sdmx.util.DictLike[str, sdmx.model.KeyValue] = None, group_keys: Set[sdmx.model.GroupKey] = {})[source]¶
Bases:
sdmx.model.Key
- property group_attrib¶
Return a view of combined group attributes.
- group_keys: Set[sdmx.model.GroupKey]¶
sdmx
extension not in the IM.
- class sdmx.model.Structure(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, grouping: sdmx.model.ComponentList = None)[source]¶
Bases:
sdmx.model.MaintainableArtefact
- grouping: Optional[sdmx.model.ComponentList]¶
- class sdmx.model.StructureSpecificDataSet(*, annotations: List[sdmx.model.Annotation] = [], action: sdmx.model.ActionType = None, attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, valid_from: str = None, described_by: sdmx.model.DataflowDefinition = None, structured_by: sdmx.model.DataStructureDefinition = None, obs: List[sdmx.model.Observation] = [], series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]] = None, group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]] = None)[source]¶
Bases:
sdmx.model.DataSet
SDMX-IM StructureSpecificDataSet.
- action: Optional[sdmx.model.ActionType]¶
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue]¶
- described_by: Optional[sdmx.model.DataflowDefinition]¶
- group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]]¶
Map of group key → list of observations.
sdmx
extension not in the IM.
- obs: List[sdmx.model.Observation]¶
All observations in the DataSet.
- series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]]¶
Map of series key → list of observations.
sdmx
extension not in the IM.
- structured_by: Optional[sdmx.model.DataStructureDefinition]¶
- class sdmx.model.StructureSpecificTimeSeriesDataSet(*, annotations: List[sdmx.model.Annotation] = [], action: sdmx.model.ActionType = None, attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue] = None, valid_from: str = None, described_by: sdmx.model.DataflowDefinition = None, structured_by: sdmx.model.DataStructureDefinition = None, obs: List[sdmx.model.Observation] = [], series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]] = None, group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]] = None)[source]¶
Bases:
sdmx.model.DataSet
SDMX-IM StructureSpecificTimeSeriesDataSet.
- action: Optional[sdmx.model.ActionType]¶
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- attrib: sdmx.util.DictLike[str, sdmx.model.AttributeValue]¶
- described_by: Optional[sdmx.model.DataflowDefinition]¶
- group: sdmx.util.DictLike[sdmx.model.GroupKey, List[sdmx.model.Observation]]¶
Map of group key → list of observations.
sdmx
extension not in the IM.
- obs: List[sdmx.model.Observation]¶
All observations in the DataSet.
- series: sdmx.util.DictLike[sdmx.model.SeriesKey, List[sdmx.model.Observation]]¶
Map of series key → list of observations.
sdmx
extension not in the IM.
- structured_by: Optional[sdmx.model.DataStructureDefinition]¶
- class sdmx.model.StructureUsage(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None, is_final: bool = None, is_external_reference: bool = None, service_url: str = None, structure_url: str = None, maintainer: Agency = None, structure: sdmx.model.Structure = None)[source]¶
Bases:
sdmx.model.MaintainableArtefact
- structure: Optional[sdmx.model.Structure]¶
- class sdmx.model.TimeDimension(*args, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, concept_identity: sdmx.model.Concept = None, local_representation: sdmx.model.Representation = None, order: int = None)[source]¶
Bases:
sdmx.model.DimensionComponent
SDMX-IM TimeDimension.
- annotations: List[sdmx.model.Annotation]¶
Annotations
of the object.pandaSDMX
implementation: The IM does not specify the name of this feature.
- concept_identity: Optional[sdmx.model.Concept]¶
- local_representation: Optional[sdmx.model.Representation]¶
- urn: Optional[str]¶
Universal resource name. For use in SDMX registries; all registered objects have a URN.
- urn_group: Dict¶
- sdmx.model.TimeKeyValue¶
alias of
sdmx.model.KeyValue
- class sdmx.model.TimeRangeValue[source]¶
Bases:
sdmx.model.SelectionValue
SDMX-IM TimeRangeValue.
- class sdmx.model.UsageStatus(value)¶
Bases:
enum.Enum
An enumeration.
- conditional = 2¶
- mandatory = 1¶
- class sdmx.model.VersionableArtefact(*, annotations: List[sdmx.model.Annotation] = [], id: str = '', uri: str = None, urn: str = None, urn_group: Dict = {}, name: sdmx.model.InternationalString =, description: sdmx.model.InternationalString =, version: str = None, valid_from: str = None, valid_to: str = None)[source]¶
Bases:
sdmx.model.NameableArtefact
- compare(other, strict=True)[source]¶
Return
True
if self is the same as other.Two VersionableArtefacts are the same if:
NameableArtefact.compare()
isTrue
, andthey have the same
version
.
- Parameters
strict (bool, optional) – Passed to
compare()
andNameableArtefact.compare()
.
- sdmx.model.get_class(name: Union[str, sdmx.rest.Resource], package=None) Optional[Type] [source]¶
Return a class for name and (optional) package names.
- sdmx.model.parent_class(cls)[source]¶
Return the class that contains objects of type cls.
E.g. if cls is
PrimaryMeasure
, returnsMeasureDescriptor
.