dsss.store#

Storage of SDMX artefacts.

Store facilitates use of keys derived from the SDMX Information Model and its class hierarchy. Any artefact handled by key() can be stored or retrieved, including:

…using standard ‘CRUD’ operations, following the semantics of Python dict:

In general, for set() and update() operations, it is not necessary to explicitly give the key; one is computed from the object to be stored, and returned.

Convenience methods are also provided, including assign_version(), list(), list_versions(), resolve(), update_from().

Store is abstract with respect to how artefacts are stored. Subclasses may use different methods of storage. Concrete subclasses include DictStore, FlatFileStore, StructuredFileStore, GitStore, and UnionStore.

Module data

DATA_KEY_PATTERN

Regular expression matching keys for (Meta)DataSet.

dsss.store.DATA_KEY_PATTERN = re.compile('(meta|)data-(?P<agency>[^:]+):(?P<id>[^-]+)-(?P<hash>.+)')#

Regular expression matching keys for (Meta)DataSet.

Functions

dataset_kind(klass)

Return a ‘kind’ for a BaseDataSet or BaseMetadataSet type.

hashable_metadata()

Recursively generate a hashable collection from obj.

dsss.store.dataset_kind(klass: type) Literal['data', 'metadata']#

Return a ‘kind’ for a BaseDataSet or BaseMetadataSet type.

dsss.store.hashable_metadata(obj) Tuple | str#
dsss.store.hashable_metadata(obj: MetadataSet)
dsss.store.hashable_metadata(obj: MetadataReport)
dsss.store.hashable_metadata(obj: ReportedAttribute)
dsss.store.hashable_metadata(obj: MetadataSet)
dsss.store.hashable_metadata(obj: _Element)
dsss.store.hashable_metadata(obj: str)

Recursively generate a hashable collection from obj.

Classes

DataType(*args, **kwargs)

DictStore(**kwargs)

FileStore(path, **kwargs)

Abstract class for a store using SDMX-ML files in a local directory.

FlatFileStore(path, **kwargs)

FileStore as a flat collection of files, with names identical to keys.

GitStore(path[, remote_url, clone])

A store that uses an underlying Git repository.

Store([hook])

Abstract class for key-value storage of SDMX artefacts.

StructuredFileStore(path, **kwargs)

FileStore arranged in directories by maintainer, with more readable names.

UnionStore([store])

A Store that unites 1 or more underlying Stores.