Base Package

Please refer to the SDMX Base Package


class sdmxthon.model.base.Annotation(id_: str | None = None, title: str | None = None, type_: str | None = None, url: str | None = None, text: InternationalString | None = None)

Bases: object

Additional descriptive information attached to an object

property id

Identifier for the Annotation. It can be used to disambiguate one Annotation from another where there are several Annotations for the same annotated object.

property text

An International String provides the multilingual text content of the annotation via this role

property title

A title used to identify an annotation.

property type

Specifies how the annotation is to be processed

property url

A link to external descriptive text

Annotable Artefact

class sdmxthon.model.base.AnnotableArtefact(annotations: List[Annotation] | None = None)

Bases: object

Superclass of all artefacts. Contains the list of annotations.

addAnnotation(annotation: Annotation)

Method to add an annotation to the list

property annotations

List of the annotations of the element

Identifiable Artefact

class sdmxthon.model.base.IdentifiableArtefact(id_: str | None = None, uri: str | None = None, urn: str | None = None, annotations: List[Annotation] | None = None)

Bases: AnnotableArtefact

Provides identity to all derived classes. It also provides annotations to derived classes because it is a subclass of AnnotableArtefact.

property id

The unique identifier of the object.

property uri

Universal resource identifier that may or may not be resolvable.

property urn

Universal resource name – this is for use in registries: all registered objects have a urn.

Nameable Artefact

class sdmxthon.model.base.NameableArtefact(id_: str | None = None, uri: str | None = None, urn=None, annotations: List[Annotation] | None = None, name: InternationalString | None = None, description: InternationalString | None = None)

Bases: IdentifiableArtefact

Provides a Name and Description to all derived classes in addition to identification and annotations.

property description

A multi-lingual description is provided by this role via the International String class.

property name

A multi-lingual name is provided by this role via the International String class

Versionable Artefact

class sdmxthon.model.base.VersionableArtefact(id_: str, uri: str | None = None, urn=None, annotations: List[Annotation] | None = None, name: str | None = None, description: str | None = None, version: str = '1.0', validFrom: datetime | None = None, validTo: datetime | None = None)

Bases: NameableArtefact

Provides versioning information for all derived objects

property validFrom

Date from which the version is valid

property validTo

Date from which version is superseded

property version

A version string following an agreed convention

Maintainable Artefact

class sdmxthon.model.base.MaintainableArtefact(id_: str | None = None, uri: str | None = None, urn=None, annotations: List[Annotation] | None = None, name: str | None = None, description: str | None = None, version: str | None = None, validFrom: datetime | None = None, validTo: datetime | None = None, isFinal: bool = False, isExternalReference: bool = False, serviceUrl: str | None = None, structureUrl: str | None = None, maintainer=None)

Bases: VersionableArtefact

An abstract class to group together primary structural metadata artefacts that are maintained by an Agency.

property agencyID

Extracts the agencyID from the maintainer

property isExternalReference

If set to “true” it indicates that the content of the object is held externally.

property isFinal

Defines whether a maintained artefact is draft or final

property maintainer

Association to the Maintenance Agency responsible for maintaining the artefact.

property serviceUrl

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

property structureUrl

The URL of an SDMX-ML document containing the external object.

property unique_id

Provides the unique id in the shape of AgencyID:ID(version)

International String

class sdmxthon.model.base.InternationalString(localisedStrings: List[LocalisedString] | None = None)

Bases: object

The International String is a collection of Localised Strings and supports the representation of text in multiple locales.

addLocalisedString(localisedString: LocalisedString)

Adds a localisedString to the International String

classmethod from_str(value)

Generates InternationalString from a str :param value: Content of the String :return: A InternationalString instance


Gets the labels of the items present in the International String

property items

Items of the InternationalString

Localised String

class sdmxthon.model.base.LocalisedString(locale: str | None = None, label: str | None = None, content: str | None = None)

Bases: object

The Localised String supports the representation of text in one locale (locale is similar to language but includes geographic variations such as Canadian French, US English etc.).

property content

Added attribute to the Information Model to specify the string itself

property label

Label present in attribute lang of the XML namespace. Uses an ISO 639-1 code to specify the country

property locale

Locale is the name of the country. Obtained from the ISO 639-1 code