pysdmx 1.10.0__tar.gz → 1.10.0rc1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/PKG-INFO +1 -1
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/pyproject.toml +1 -1
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/__init__.py +1 -1
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/fmr/__init__.py +2 -3
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/__init__.py +0 -4
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/code.py +6 -16
- pysdmx-1.10.0rc1/src/pysdmx/io/json/sdmxjson2/messages/constraint.py +53 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/dsd.py +7 -35
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/map.py +4 -5
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/metadataflow.py +0 -1
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/msd.py +10 -18
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/schema.py +2 -2
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/structure.py +44 -81
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/vtl.py +9 -13
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/reader/doc_validation.py +0 -4
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/__base.py +1 -46
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/__init__.py +0 -18
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/category.py +0 -17
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/message.py +71 -80
- pysdmx-1.10.0/src/pysdmx/io/json/sdmxjson2/messages/constraint.py +0 -272
- pysdmx-1.10.0/src/pysdmx/model/constraint.py +0 -69
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/LICENSE +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/README.rst +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/__extras_check.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/_api.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/query/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/query/_model.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/query/_parsing_model.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/query/_parsing_util.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/query/_py_parser.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/query/_sql_parser.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/dc/query/util.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/fmr/maintenance.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/gds/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/availability.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/data.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/gds.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/refmeta.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/registration.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/schema.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/service.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/api/qb/util.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/errors.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/__csv_aux_reader.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/__csv_aux_writer.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx10/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx10/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx10/writer/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx20/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx20/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx20/writer/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx21/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx21/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/csv/sdmx21/writer/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/format.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/input_processor.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/category.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/code.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/concept.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/constraint.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/core.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/dataflow.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/dsd.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/map.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/metadataflow.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/mpa.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/msd.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/org.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/pa.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/report.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/schema.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/messages/vtl.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/fusion/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/gds/messages/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/gds/messages/agencies.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/gds/messages/catalog.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/gds/messages/sdmx_api.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/gds/messages/services.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/gds/messages/urn_resolver.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/gds/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/agency.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/category.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/concept.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/core.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/dataflow.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/mpa.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/pa.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/provider.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/messages/report.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/reader/metadata.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/reader/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/writer/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/writer/metadata.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/json/sdmxjson2/writer/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/pd.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/reader.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/serde.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/writer.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__allowed_lxml_errors.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__data_aux.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__parse_xml.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__ss_aux_reader.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__structure_aux_reader.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__structure_aux_writer.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__tokens.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__write_aux.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__write_data_aux.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/__write_structure_specific_aux.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/config.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/doc_validation.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/header.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/reader/error.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/reader/generic.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/reader/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/reader/structure_specific.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/reader/submission.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/writer/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/writer/error.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/writer/generic.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/writer/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx21/writer/structure_specific.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx30/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx30/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx30/reader/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx30/reader/structure_specific.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx30/writer/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx30/writer/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx30/writer/structure_specific.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx31/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx31/reader/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx31/reader/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx31/reader/structure_specific.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx31/writer/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx31/writer/structure.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/sdmx31/writer/structure_specific.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/io/xml/utils.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/code.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/concept.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/dataflow.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/dataset.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/gds.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/map.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/metadata.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/organisation.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/submission.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/model/vtl.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/py.typed +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/toolkit/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/toolkit/pd/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/toolkit/pd/_data_utils.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/toolkit/vtl/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/toolkit/vtl/_validations.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/toolkit/vtl/convert.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/toolkit/vtl/script_generation.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/toolkit/vtl/validation.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/util/__init__.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/util/_date_pattern_map.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/util/_model_utils.py +0 -0
- {pysdmx-1.10.0 → pysdmx-1.10.0rc1}/src/pysdmx/util/_net_utils.py +0 -0
|
@@ -44,7 +44,6 @@ from pysdmx.model import (
|
|
|
44
44
|
Metadataflow,
|
|
45
45
|
MetadataProvisionAgreement,
|
|
46
46
|
MetadataReport,
|
|
47
|
-
MetadataStructure,
|
|
48
47
|
MultiRepresentationMap,
|
|
49
48
|
ProvisionAgreement,
|
|
50
49
|
RepresentationMap,
|
|
@@ -768,7 +767,7 @@ class RegistryClient(__BaseRegistryClient):
|
|
|
768
767
|
agency: str = "*",
|
|
769
768
|
id: str = "*",
|
|
770
769
|
version: str = "+",
|
|
771
|
-
) -> Sequence[
|
|
770
|
+
) -> Sequence[Dataflow]:
|
|
772
771
|
"""Get the metadata structures (MSD) matching the supplied parameters.
|
|
773
772
|
|
|
774
773
|
Args:
|
|
@@ -1342,7 +1341,7 @@ class AsyncRegistryClient(__BaseRegistryClient):
|
|
|
1342
1341
|
agency: str = "*",
|
|
1343
1342
|
id: str = "*",
|
|
1344
1343
|
version: str = "+",
|
|
1345
|
-
) -> Sequence[
|
|
1344
|
+
) -> Sequence[Dataflow]:
|
|
1346
1345
|
"""Get the metadata structures (MSD) matching the supplied parameters.
|
|
1347
1346
|
|
|
1348
1347
|
Args:
|
|
@@ -12,9 +12,6 @@ from pysdmx.io.json.sdmxjson2.messages.code import (
|
|
|
12
12
|
JsonHierarchyMessage,
|
|
13
13
|
)
|
|
14
14
|
from pysdmx.io.json.sdmxjson2.messages.concept import JsonConceptSchemeMessage
|
|
15
|
-
from pysdmx.io.json.sdmxjson2.messages.constraint import (
|
|
16
|
-
JsonDataConstraintMessage,
|
|
17
|
-
)
|
|
18
15
|
from pysdmx.io.json.sdmxjson2.messages.dataflow import (
|
|
19
16
|
JsonDataflowMessage,
|
|
20
17
|
JsonDataflowsMessage,
|
|
@@ -53,7 +50,6 @@ __all__ = [
|
|
|
53
50
|
"JsonCategorySchemeMessage",
|
|
54
51
|
"JsonCodelistMessage",
|
|
55
52
|
"JsonConceptSchemeMessage",
|
|
56
|
-
"JsonDataConstraintMessage",
|
|
57
53
|
"JsonDataflowMessage",
|
|
58
54
|
"JsonDataflowsMessage",
|
|
59
55
|
"JsonDataStructuresMessage",
|
|
@@ -231,7 +231,7 @@ class JsonCodelists(Struct, frozen=True, omit_defaults=True):
|
|
|
231
231
|
"""SDMX-JSON payload for lists of codes."""
|
|
232
232
|
|
|
233
233
|
codelists: Sequence[JsonCodelist] = ()
|
|
234
|
-
|
|
234
|
+
valuelists: Sequence[JsonValuelist] = ()
|
|
235
235
|
|
|
236
236
|
|
|
237
237
|
class JsonCodelistMessage(Struct, frozen=True, omit_defaults=True):
|
|
@@ -244,7 +244,7 @@ class JsonCodelistMessage(Struct, frozen=True, omit_defaults=True):
|
|
|
244
244
|
if self.data.codelists:
|
|
245
245
|
return self.data.codelists[0].to_model()
|
|
246
246
|
else:
|
|
247
|
-
return self.data.
|
|
247
|
+
return self.data.valuelists[0].to_model()
|
|
248
248
|
|
|
249
249
|
|
|
250
250
|
class JsonHierarchicalCode(Struct, frozen=True, omit_defaults=True):
|
|
@@ -329,10 +329,10 @@ class JsonHierarchicalCode(Struct, frozen=True, omit_defaults=True):
|
|
|
329
329
|
code=code.urn,
|
|
330
330
|
validFrom=code.rel_valid_from,
|
|
331
331
|
validTo=code.rel_valid_to,
|
|
332
|
-
annotations=tuple(annotations)
|
|
333
|
-
hierarchicalCodes=
|
|
334
|
-
|
|
335
|
-
|
|
332
|
+
annotations=tuple(annotations),
|
|
333
|
+
hierarchicalCodes=[
|
|
334
|
+
JsonHierarchicalCode.from_model(c) for c in code.codes
|
|
335
|
+
],
|
|
336
336
|
)
|
|
337
337
|
|
|
338
338
|
|
|
@@ -475,15 +475,6 @@ class JsonHierarchyAssociation(
|
|
|
475
475
|
"SDMX-JSON hierarchy associations must reference a context",
|
|
476
476
|
{"hierarchy_association": ha.id},
|
|
477
477
|
)
|
|
478
|
-
lnk = (
|
|
479
|
-
JsonLink(
|
|
480
|
-
rel="UserDefinedOperator",
|
|
481
|
-
type="sdmx_artefact",
|
|
482
|
-
urn=ha.operator,
|
|
483
|
-
)
|
|
484
|
-
if ha.operator
|
|
485
|
-
else None
|
|
486
|
-
)
|
|
487
478
|
return JsonHierarchyAssociation(
|
|
488
479
|
agency=(
|
|
489
480
|
ha.agency.id if isinstance(ha.agency, Agency) else ha.agency
|
|
@@ -501,7 +492,6 @@ class JsonHierarchyAssociation(
|
|
|
501
492
|
linkedHierarchy=href,
|
|
502
493
|
linkedObject=ha.component_ref,
|
|
503
494
|
contextObject=ha.context_ref,
|
|
504
|
-
links=[lnk] if lnk else (),
|
|
505
495
|
)
|
|
506
496
|
|
|
507
497
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Collection of SDMX-JSON schemas for content constraints."""
|
|
2
|
+
|
|
3
|
+
from typing import Dict, Literal, Optional, Sequence
|
|
4
|
+
|
|
5
|
+
from msgspec import Struct
|
|
6
|
+
|
|
7
|
+
from pysdmx.io.json.sdmxjson2.messages.core import MaintainableType
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class JsonValue(Struct, frozen=True, omit_defaults=True):
|
|
11
|
+
"""SDMX-JSON payload for an allowed value."""
|
|
12
|
+
|
|
13
|
+
value: str
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class JsonKeyValue(Struct, frozen=True, omit_defaults=True):
|
|
17
|
+
"""SDMX-JSON payload for the list of allowed values per component."""
|
|
18
|
+
|
|
19
|
+
id: str
|
|
20
|
+
values: Sequence[JsonValue]
|
|
21
|
+
|
|
22
|
+
def to_model(self) -> Sequence[str]:
|
|
23
|
+
"""Returns the requested list of values."""
|
|
24
|
+
return [v.value for v in self.values]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class JsonCubeRegion(Struct, frozen=True, omit_defaults=True):
|
|
28
|
+
"""SDMX-JSON payload for a cube region."""
|
|
29
|
+
|
|
30
|
+
keyValues: Sequence[JsonKeyValue]
|
|
31
|
+
|
|
32
|
+
def to_map(self) -> Dict[str, Sequence[str]]:
|
|
33
|
+
"""Gets the list of allowed values for a component."""
|
|
34
|
+
return {kv.id: kv.to_model() for kv in self.keyValues}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class JsonConstraintAttachment(Struct, frozen=True, omit_defaults=True):
|
|
38
|
+
"""SDMX-JSON payload for a constraint attachment."""
|
|
39
|
+
|
|
40
|
+
dataProvider: Optional[str]
|
|
41
|
+
simpleDataSources: Optional[Sequence[str]] = None
|
|
42
|
+
dataStructures: Optional[Sequence[str]] = None
|
|
43
|
+
dataflows: Optional[Sequence[str]] = None
|
|
44
|
+
provisionAgreements: Optional[Sequence[str]] = None
|
|
45
|
+
queryableDataSources: Optional[Sequence[str]] = None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class JsonDataConstraint(MaintainableType, frozen=True, omit_defaults=True):
|
|
49
|
+
"""SDMX-JSON payload for a content constraint."""
|
|
50
|
+
|
|
51
|
+
role: Optional[Literal["Allowed", "Actual"]] = None
|
|
52
|
+
constraintAttachment: Optional[JsonConstraintAttachment] = None
|
|
53
|
+
cubeRegions: Optional[Sequence[JsonCubeRegion]] = None
|
|
@@ -265,17 +265,12 @@ class JsonAttribute(Struct, frozen=True, omit_defaults=True):
|
|
|
265
265
|
attribute.attachment_level # type: ignore[arg-type]
|
|
266
266
|
)
|
|
267
267
|
repr = _get_json_representation(attribute)
|
|
268
|
-
# The line below will need to be changed when we work on
|
|
269
|
-
# Measure Relationship (cf. issue #467)
|
|
270
|
-
mr = ["OBS_VALUE"] if attribute.attachment_level == "O" else None
|
|
271
|
-
|
|
272
268
|
return JsonAttribute(
|
|
273
269
|
id=attribute.id,
|
|
274
270
|
conceptIdentity=concept,
|
|
275
271
|
attributeRelationship=level,
|
|
276
272
|
usage=usage,
|
|
277
273
|
localRepresentation=repr,
|
|
278
|
-
measureRelationship=mr,
|
|
279
274
|
)
|
|
280
275
|
|
|
281
276
|
|
|
@@ -452,42 +447,19 @@ class JsonComponents(Struct, frozen=True, omit_defaults=True):
|
|
|
452
447
|
enums = [cl.to_model() for cl in cls]
|
|
453
448
|
enums.extend([vl.to_model() for vl in vls])
|
|
454
449
|
comps = []
|
|
455
|
-
if constraints:
|
|
456
|
-
|
|
457
|
-
for const in constraints:
|
|
458
|
-
incl_cubes.extend(
|
|
459
|
-
[cr for cr in (const.cubeRegions or []) if cr.include]
|
|
460
|
-
)
|
|
461
|
-
if len(incl_cubes) == 1:
|
|
462
|
-
cons = {
|
|
463
|
-
kv.id: [v.value for v in kv.values]
|
|
464
|
-
for kv in incl_cubes[0].keyValues
|
|
465
|
-
}
|
|
466
|
-
else:
|
|
467
|
-
cons = {}
|
|
450
|
+
if constraints and constraints[0].cubeRegions:
|
|
451
|
+
cons = constraints[0].cubeRegions[0].to_map()
|
|
468
452
|
else:
|
|
469
453
|
cons = {}
|
|
470
|
-
comps.extend(
|
|
471
|
-
self.dimensionList.to_model(
|
|
472
|
-
cs,
|
|
473
|
-
enums,
|
|
474
|
-
cons, # type: ignore[arg-type]
|
|
475
|
-
)
|
|
476
|
-
)
|
|
454
|
+
comps.extend(self.dimensionList.to_model(cs, enums, cons))
|
|
477
455
|
if self.measureList:
|
|
478
|
-
comps.extend(
|
|
479
|
-
self.measureList.to_model(
|
|
480
|
-
cs,
|
|
481
|
-
enums,
|
|
482
|
-
cons, # type: ignore[arg-type]
|
|
483
|
-
)
|
|
484
|
-
)
|
|
456
|
+
comps.extend(self.measureList.to_model(cs, enums, cons))
|
|
485
457
|
if self.attributeList:
|
|
486
458
|
comps.extend(
|
|
487
459
|
self.attributeList.to_model(
|
|
488
460
|
cs,
|
|
489
461
|
enums,
|
|
490
|
-
cons,
|
|
462
|
+
cons,
|
|
491
463
|
self.groups,
|
|
492
464
|
)
|
|
493
465
|
)
|
|
@@ -584,7 +556,7 @@ class JsonDataStructures(Struct, frozen=True, omit_defaults=True):
|
|
|
584
556
|
conceptSchemes: Sequence[JsonConceptScheme] = ()
|
|
585
557
|
valuelists: Sequence[JsonValuelist] = ()
|
|
586
558
|
codelists: Sequence[JsonCodelist] = ()
|
|
587
|
-
|
|
559
|
+
contentConstraints: Sequence[JsonDataConstraint] = ()
|
|
588
560
|
|
|
589
561
|
def to_model(self) -> Sequence[DataStructureDefinition]:
|
|
590
562
|
"""Returns the requested dsds."""
|
|
@@ -593,7 +565,7 @@ class JsonDataStructures(Struct, frozen=True, omit_defaults=True):
|
|
|
593
565
|
self.conceptSchemes,
|
|
594
566
|
self.codelists,
|
|
595
567
|
self.valuelists,
|
|
596
|
-
self.
|
|
568
|
+
self.contentConstraints,
|
|
597
569
|
)
|
|
598
570
|
for dsd in self.dataStructures
|
|
599
571
|
]
|
|
@@ -87,20 +87,19 @@ class JsonRepresentationMapping(Struct, frozen=True, omit_defaults=True):
|
|
|
87
87
|
self, vm: Union[MultiValueMap, ValueMap]
|
|
88
88
|
) -> "JsonRepresentationMapping":
|
|
89
89
|
"""Converts a value map to an SDMX-JSON JsonRepresentationMapping."""
|
|
90
|
-
fmt = r"%Y-%m-%dT%H:%M:%S"
|
|
91
90
|
if isinstance(vm, ValueMap):
|
|
92
91
|
return JsonRepresentationMapping(
|
|
93
92
|
[JsonSourceValue.from_model(vm.source)],
|
|
94
93
|
[vm.target],
|
|
95
|
-
vm.valid_from.strftime(
|
|
96
|
-
vm.valid_to.strftime(
|
|
94
|
+
vm.valid_from.strftime("%Y-%m-%d") if vm.valid_from else None,
|
|
95
|
+
vm.valid_to.strftime("%Y-%m-%d") if vm.valid_to else None,
|
|
97
96
|
)
|
|
98
97
|
else:
|
|
99
98
|
return JsonRepresentationMapping(
|
|
100
99
|
[JsonSourceValue.from_model(s) for s in vm.source],
|
|
101
100
|
vm.target,
|
|
102
|
-
vm.valid_from.strftime(
|
|
103
|
-
vm.valid_to.strftime(
|
|
101
|
+
vm.valid_from.strftime("%Y-%m-%d") if vm.valid_from else None,
|
|
102
|
+
vm.valid_to.strftime("%Y-%m-%d") if vm.valid_to else None,
|
|
104
103
|
)
|
|
105
104
|
|
|
106
105
|
|
|
@@ -15,6 +15,7 @@ from pysdmx.io.json.sdmxjson2.messages.core import (
|
|
|
15
15
|
from pysdmx.io.json.sdmxjson2.messages.dsd import (
|
|
16
16
|
_find_concept,
|
|
17
17
|
_get_concept_reference,
|
|
18
|
+
_get_json_representation,
|
|
18
19
|
_get_representation,
|
|
19
20
|
)
|
|
20
21
|
from pysdmx.model import (
|
|
@@ -27,13 +28,6 @@ from pysdmx.model import (
|
|
|
27
28
|
from pysdmx.util import parse_item_urn
|
|
28
29
|
|
|
29
30
|
|
|
30
|
-
def _get_attr_repr(comp: MetadataComponent) -> Optional[JsonRepresentation]:
|
|
31
|
-
enum = comp.local_enum_ref if comp.local_enum_ref else None
|
|
32
|
-
return JsonRepresentation.from_model(
|
|
33
|
-
comp.local_dtype, enum, comp.local_facets, None
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
37
31
|
class JsonMetadataAttribute(Struct, frozen=True, omit_defaults=True):
|
|
38
32
|
"""SDMX-JSON payload for an attribute."""
|
|
39
33
|
|
|
@@ -86,13 +80,11 @@ class JsonMetadataAttribute(Struct, frozen=True, omit_defaults=True):
|
|
|
86
80
|
def from_model(self, cmp: MetadataComponent) -> "JsonMetadataAttribute":
|
|
87
81
|
"""Converts a pysdmx metadata attribute to an SDMX-JSON one."""
|
|
88
82
|
concept = _get_concept_reference(cmp)
|
|
89
|
-
repr =
|
|
83
|
+
repr = _get_json_representation(cmp)
|
|
90
84
|
|
|
91
85
|
min_occurs = cmp.array_def.min_size if cmp.array_def else 0
|
|
92
|
-
if cmp.array_def is None:
|
|
93
|
-
max_occurs: Union[int, Literal["unbounded"]] =
|
|
94
|
-
elif cmp.array_def.max_size is None:
|
|
95
|
-
max_occurs = "unbounded"
|
|
86
|
+
if cmp.array_def is None or cmp.array_def.max_size is None:
|
|
87
|
+
max_occurs: Union[int, Literal["unbounded"]] = "unbounded"
|
|
96
88
|
else:
|
|
97
89
|
max_occurs = cmp.array_def.max_size
|
|
98
90
|
|
|
@@ -103,9 +95,9 @@ class JsonMetadataAttribute(Struct, frozen=True, omit_defaults=True):
|
|
|
103
95
|
minOccurs=min_occurs,
|
|
104
96
|
maxOccurs=max_occurs,
|
|
105
97
|
isPresentational=cmp.is_presentational,
|
|
106
|
-
metadataAttributes=
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
metadataAttributes=[
|
|
99
|
+
JsonMetadataAttribute.from_model(c) for c in cmp.components
|
|
100
|
+
],
|
|
109
101
|
)
|
|
110
102
|
|
|
111
103
|
|
|
@@ -127,9 +119,9 @@ class JsonMetadataAttributes(Struct, frozen=True, omit_defaults=True):
|
|
|
127
119
|
) -> "JsonMetadataAttributes":
|
|
128
120
|
"""Converts a pysdmx list of metadata attributes to SDMX-JSON."""
|
|
129
121
|
return JsonMetadataAttributes(
|
|
130
|
-
metadataAttributes=
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
metadataAttributes=[
|
|
123
|
+
JsonMetadataAttribute.from_model(a) for a in attributes
|
|
124
|
+
]
|
|
133
125
|
)
|
|
134
126
|
|
|
135
127
|
|
|
@@ -21,7 +21,7 @@ class JsonSchemas(msgspec.Struct, frozen=True, omit_defaults=True):
|
|
|
21
21
|
dataStructures: Sequence[JsonDataStructure]
|
|
22
22
|
valuelists: Sequence[JsonValuelist] = ()
|
|
23
23
|
codelists: Sequence[JsonCodelist] = ()
|
|
24
|
-
|
|
24
|
+
contentConstraints: Sequence[JsonDataConstraint] = ()
|
|
25
25
|
|
|
26
26
|
def to_model(
|
|
27
27
|
self,
|
|
@@ -32,7 +32,7 @@ class JsonSchemas(msgspec.Struct, frozen=True, omit_defaults=True):
|
|
|
32
32
|
self.conceptSchemes,
|
|
33
33
|
self.codelists,
|
|
34
34
|
self.valuelists,
|
|
35
|
-
self.
|
|
35
|
+
self.contentConstraints,
|
|
36
36
|
)
|
|
37
37
|
return comps, grps # type: ignore[return-value]
|
|
38
38
|
|
|
@@ -17,7 +17,6 @@ from pysdmx.io.json.sdmxjson2.messages.code import (
|
|
|
17
17
|
JsonValuelist,
|
|
18
18
|
)
|
|
19
19
|
from pysdmx.io.json.sdmxjson2.messages.concept import JsonConceptScheme
|
|
20
|
-
from pysdmx.io.json.sdmxjson2.messages.constraint import JsonDataConstraint
|
|
21
20
|
from pysdmx.io.json.sdmxjson2.messages.core import JsonHeader
|
|
22
21
|
from pysdmx.io.json.sdmxjson2.messages.dataflow import JsonDataflow
|
|
23
22
|
from pysdmx.io.json.sdmxjson2.messages.dsd import JsonDataStructure
|
|
@@ -50,95 +49,90 @@ from pysdmx.model.message import StructureMessage
|
|
|
50
49
|
class JsonStructures(Struct, frozen=True, omit_defaults=True):
|
|
51
50
|
"""The allowed strutures."""
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
categorisations: Sequence[JsonCategorisation] = ()
|
|
52
|
+
dataStructures: Sequence[JsonDataStructure] = ()
|
|
55
53
|
categorySchemes: Sequence[JsonCategoryScheme] = ()
|
|
56
|
-
codelists: Sequence[JsonCodelist] = ()
|
|
57
54
|
conceptSchemes: Sequence[JsonConceptScheme] = ()
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
dataflows: Sequence[JsonDataflow] = ()
|
|
61
|
-
dataProviderSchemes: Sequence[JsonDataProviderScheme] = ()
|
|
62
|
-
dataStructures: Sequence[JsonDataStructure] = ()
|
|
55
|
+
codelists: Sequence[JsonCodelist] = ()
|
|
56
|
+
valueLists: Sequence[JsonValuelist] = ()
|
|
63
57
|
hierarchies: Sequence[JsonHierarchy] = ()
|
|
64
58
|
hierarchyAssociations: Sequence[JsonHierarchyAssociation] = ()
|
|
65
|
-
|
|
59
|
+
agencySchemes: Sequence[JsonAgencyScheme] = ()
|
|
60
|
+
dataProviderSchemes: Sequence[JsonDataProviderScheme] = ()
|
|
66
61
|
metadataProviderSchemes: Sequence[JsonMetadataProviderScheme] = ()
|
|
62
|
+
dataflows: Sequence[JsonDataflow] = ()
|
|
63
|
+
provisionAgreements: Sequence[JsonProvisionAgreement] = ()
|
|
64
|
+
metadataflows: Sequence[JsonMetadataflow] = ()
|
|
67
65
|
metadataProvisionAgreements: Sequence[JsonMetadataProvisionAgreement] = ()
|
|
68
66
|
metadataStructures: Sequence[JsonMetadataStructure] = ()
|
|
69
|
-
|
|
70
|
-
provisionAgreements: Sequence[JsonProvisionAgreement] = ()
|
|
67
|
+
structureMaps: Sequence[JsonStructureMap] = ()
|
|
71
68
|
representationMaps: Sequence[JsonRepresentationMap] = ()
|
|
69
|
+
categorisations: Sequence[JsonCategorisation] = ()
|
|
70
|
+
customTypeSchemes: Sequence[JsonCustomTypeScheme] = ()
|
|
71
|
+
vtlMappingSchemes: Sequence[JsonVtlMappingScheme] = ()
|
|
72
|
+
namePersonalisationSchemes: Sequence[JsonNamePersonalisationScheme] = ()
|
|
72
73
|
rulesetSchemes: Sequence[JsonRulesetScheme] = ()
|
|
73
|
-
structureMaps: Sequence[JsonStructureMap] = ()
|
|
74
74
|
transformationSchemes: Sequence[JsonTransformationScheme] = ()
|
|
75
75
|
userDefinedOperatorSchemes: Sequence[JsonUserDefinedOperatorScheme] = ()
|
|
76
|
-
valueLists: Sequence[JsonValuelist] = ()
|
|
77
|
-
vtlMappingSchemes: Sequence[JsonVtlMappingScheme] = ()
|
|
78
76
|
|
|
79
77
|
def to_model(self) -> Sequence[MaintainableArtefact]:
|
|
80
78
|
"""Map to pysdmx artefacts."""
|
|
81
79
|
structures = [] # type: ignore[var-annotated]
|
|
82
80
|
structures.extend(
|
|
83
|
-
i.to_model(
|
|
81
|
+
i.to_model(
|
|
82
|
+
self.conceptSchemes, self.codelists, self.valueLists, ()
|
|
83
|
+
)
|
|
84
|
+
for i in self.dataStructures
|
|
84
85
|
)
|
|
85
|
-
structures.extend(i.to_model() for i in self.categorisations)
|
|
86
86
|
structures.extend(i.to_model() for i in self.categorySchemes)
|
|
87
|
-
structures.extend(i.to_model() for i in self.codelists)
|
|
88
87
|
structures.extend(
|
|
89
88
|
i.to_model(self.codelists) for i in self.conceptSchemes
|
|
90
89
|
)
|
|
91
|
-
structures.extend(i.to_model() for i in self.
|
|
92
|
-
structures.extend(i.to_model() for i in self.
|
|
93
|
-
structures.extend(
|
|
94
|
-
i.to_model(
|
|
95
|
-
self.dataStructures,
|
|
96
|
-
self.conceptSchemes,
|
|
97
|
-
self.valueLists,
|
|
98
|
-
self.codelists,
|
|
99
|
-
)
|
|
100
|
-
for i in self.dataflows
|
|
101
|
-
)
|
|
90
|
+
structures.extend(i.to_model() for i in self.codelists)
|
|
91
|
+
structures.extend(i.to_model() for i in self.valueLists)
|
|
92
|
+
structures.extend(i.to_model(self.codelists) for i in self.hierarchies)
|
|
102
93
|
structures.extend(
|
|
103
|
-
i.to_model(self.
|
|
104
|
-
for i in self.
|
|
94
|
+
i.to_model(self.hierarchies, self.codelists)
|
|
95
|
+
for i in self.hierarchyAssociations
|
|
105
96
|
)
|
|
106
97
|
structures.extend(
|
|
107
|
-
i.to_model(
|
|
108
|
-
self.conceptSchemes, self.codelists, self.valueLists, ()
|
|
109
|
-
)
|
|
110
|
-
for i in self.dataStructures
|
|
98
|
+
i.to_model(self.dataflows) for i in self.agencySchemes
|
|
111
99
|
)
|
|
112
|
-
structures.extend(i.to_model(self.codelists) for i in self.hierarchies)
|
|
113
100
|
structures.extend(
|
|
114
|
-
i.to_model(self.
|
|
115
|
-
for i in self.
|
|
101
|
+
i.to_model(self.provisionAgreements)
|
|
102
|
+
for i in self.dataProviderSchemes
|
|
116
103
|
)
|
|
117
|
-
|
|
118
|
-
structures.extend(i.to_model() for i in self.metadataflows)
|
|
119
104
|
structures.extend(
|
|
120
105
|
i.to_model(self.metadataProvisionAgreements)
|
|
121
106
|
for i in self.metadataProviderSchemes
|
|
122
107
|
)
|
|
123
|
-
structures.extend(
|
|
124
|
-
i.to_model() for i in self.metadataProvisionAgreements
|
|
125
|
-
)
|
|
126
108
|
structures.extend(
|
|
127
109
|
i.to_model(self.conceptSchemes, self.codelists, self.valueLists)
|
|
128
110
|
for i in self.metadataStructures
|
|
129
111
|
)
|
|
130
112
|
structures.extend(
|
|
131
|
-
i.to_model(
|
|
113
|
+
i.to_model(
|
|
114
|
+
self.dataStructures,
|
|
115
|
+
self.conceptSchemes,
|
|
116
|
+
self.valueLists,
|
|
117
|
+
self.codelists,
|
|
118
|
+
)
|
|
119
|
+
for i in self.dataflows
|
|
132
120
|
)
|
|
133
121
|
structures.extend(i.to_model() for i in self.provisionAgreements)
|
|
122
|
+
structures.extend(i.to_model() for i in self.metadataflows)
|
|
134
123
|
structures.extend(
|
|
135
|
-
i.to_model(
|
|
136
|
-
for i in self.representationMaps
|
|
124
|
+
i.to_model() for i in self.metadataProvisionAgreements
|
|
137
125
|
)
|
|
138
|
-
structures.extend(i.to_model() for i in self.rulesetSchemes)
|
|
139
126
|
structures.extend(
|
|
140
127
|
i.to_model(self.representationMaps) for i in self.structureMaps
|
|
141
128
|
)
|
|
129
|
+
structures.extend(i.to_model() for i in self.categorisations)
|
|
130
|
+
structures.extend(i.to_model() for i in self.customTypeSchemes)
|
|
131
|
+
structures.extend(i.to_model() for i in self.vtlMappingSchemes)
|
|
132
|
+
structures.extend(
|
|
133
|
+
i.to_model() for i in self.namePersonalisationSchemes
|
|
134
|
+
)
|
|
135
|
+
structures.extend(i.to_model() for i in self.rulesetSchemes)
|
|
142
136
|
structures.extend(
|
|
143
137
|
i.to_model(
|
|
144
138
|
self.customTypeSchemes,
|
|
@@ -152,8 +146,9 @@ class JsonStructures(Struct, frozen=True, omit_defaults=True):
|
|
|
152
146
|
structures.extend(
|
|
153
147
|
i.to_model() for i in self.userDefinedOperatorSchemes
|
|
154
148
|
)
|
|
155
|
-
|
|
156
|
-
|
|
149
|
+
for rm in self.representationMaps:
|
|
150
|
+
multi = bool(len(rm.source) > 1 or len(rm.target) > 1)
|
|
151
|
+
structures.append(rm.to_model(multi))
|
|
157
152
|
return structures
|
|
158
153
|
|
|
159
154
|
@classmethod
|
|
@@ -269,33 +264,6 @@ class JsonStructures(Struct, frozen=True, omit_defaults=True):
|
|
|
269
264
|
hierarchies = tuple(
|
|
270
265
|
[JsonHierarchy.from_model(h) for h in msg.get_hierarchies()]
|
|
271
266
|
)
|
|
272
|
-
constraints = tuple(
|
|
273
|
-
[
|
|
274
|
-
JsonDataConstraint.from_model(c)
|
|
275
|
-
for c in msg.get_data_constraints()
|
|
276
|
-
]
|
|
277
|
-
)
|
|
278
|
-
mpas = tuple(
|
|
279
|
-
[
|
|
280
|
-
JsonMetadataProvisionAgreement.from_model(c)
|
|
281
|
-
for c in msg.get_metadata_provision_agreements()
|
|
282
|
-
]
|
|
283
|
-
)
|
|
284
|
-
mprvs = tuple(
|
|
285
|
-
[
|
|
286
|
-
JsonMetadataProviderScheme.from_model(c)
|
|
287
|
-
for c in msg.get_metadata_provider_schemes()
|
|
288
|
-
]
|
|
289
|
-
)
|
|
290
|
-
mdfs = tuple(
|
|
291
|
-
[JsonMetadataflow.from_model(c) for c in msg.get_metadataflows()]
|
|
292
|
-
)
|
|
293
|
-
msds = tuple(
|
|
294
|
-
[
|
|
295
|
-
JsonMetadataStructure.from_model(c)
|
|
296
|
-
for c in msg.get_metadata_structures()
|
|
297
|
-
]
|
|
298
|
-
)
|
|
299
267
|
return JsonStructures(
|
|
300
268
|
agencySchemes=agencies,
|
|
301
269
|
categorisations=categorisations,
|
|
@@ -303,16 +271,11 @@ class JsonStructures(Struct, frozen=True, omit_defaults=True):
|
|
|
303
271
|
codelists=codelists,
|
|
304
272
|
conceptSchemes=concept_schemes,
|
|
305
273
|
customTypeSchemes=custom_types,
|
|
306
|
-
dataConstraints=constraints,
|
|
307
274
|
dataflows=dataflows,
|
|
308
275
|
dataProviderSchemes=data_providers,
|
|
309
276
|
dataStructures=data_structures,
|
|
310
277
|
hierarchies=hierarchies,
|
|
311
278
|
hierarchyAssociations=hier_associations,
|
|
312
|
-
metadataflows=mdfs,
|
|
313
|
-
metadataProviderSchemes=mprvs,
|
|
314
|
-
metadataProvisionAgreements=mpas,
|
|
315
|
-
metadataStructures=msds,
|
|
316
279
|
namePersonalisationSchemes=name_personalisations,
|
|
317
280
|
provisionAgreements=agreements,
|
|
318
281
|
representationMaps=representations_maps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Collection of SDMX-JSON schemas for VTL artefacts."""
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Literal, Optional, Sequence
|
|
4
4
|
|
|
5
5
|
from msgspec import Struct
|
|
6
6
|
|
|
@@ -506,37 +506,33 @@ class JsonRulesetScheme(ItemSchemeType, frozen=True, omit_defaults=True):
|
|
|
506
506
|
class JsonToVtlMapping(Struct, frozen=True, omit_defaults=True):
|
|
507
507
|
"""SDMX-JSON payload for To VTL mappings."""
|
|
508
508
|
|
|
509
|
-
toVtlSubSpace:
|
|
510
|
-
|
|
509
|
+
toVtlSubSpace: Sequence[str]
|
|
510
|
+
type: Optional[str] = None
|
|
511
511
|
|
|
512
512
|
def to_model(self) -> ToVtlMapping:
|
|
513
513
|
"""Converts deserialized class to pysdmx model class."""
|
|
514
|
-
return ToVtlMapping(self.toVtlSubSpace
|
|
514
|
+
return ToVtlMapping(self.toVtlSubSpace, self.type)
|
|
515
515
|
|
|
516
516
|
@classmethod
|
|
517
517
|
def from_model(cls, mapping: ToVtlMapping) -> "JsonToVtlMapping":
|
|
518
518
|
"""Converts a pysdmx "to VTL" mapping to an SDMX-JSON one."""
|
|
519
|
-
return JsonToVtlMapping(
|
|
520
|
-
{"keys": mapping.to_vtl_sub_space}, mapping.method
|
|
521
|
-
)
|
|
519
|
+
return JsonToVtlMapping(mapping.to_vtl_sub_space, mapping.method)
|
|
522
520
|
|
|
523
521
|
|
|
524
522
|
class JsonFromVtlMapping(Struct, frozen=True, omit_defaults=True):
|
|
525
523
|
"""SDMX-JSON payload for from VTL mappings."""
|
|
526
524
|
|
|
527
|
-
fromVtlSuperSpace:
|
|
528
|
-
|
|
525
|
+
fromVtlSuperSpace: Sequence[str]
|
|
526
|
+
type: Optional[str] = None
|
|
529
527
|
|
|
530
528
|
def to_model(self) -> FromVtlMapping:
|
|
531
529
|
"""Converts deserialized class to pysdmx model class."""
|
|
532
|
-
return FromVtlMapping(self.fromVtlSuperSpace
|
|
530
|
+
return FromVtlMapping(self.fromVtlSuperSpace, self.type)
|
|
533
531
|
|
|
534
532
|
@classmethod
|
|
535
533
|
def from_model(cls, mapping: FromVtlMapping) -> "JsonFromVtlMapping":
|
|
536
534
|
"""Converts a pysdmx "from VTL" mapping to an SDMX-JSON one."""
|
|
537
|
-
return JsonFromVtlMapping(
|
|
538
|
-
{"keys": mapping.from_vtl_sub_space}, mapping.method
|
|
539
|
-
)
|
|
535
|
+
return JsonFromVtlMapping(mapping.from_vtl_sub_space, mapping.method)
|
|
540
536
|
|
|
541
537
|
|
|
542
538
|
class JsonVtlMapping(NameableType, frozen=True, omit_defaults=True):
|