Maintenance client

Important

The maintenance client is still EXPERIMENTAL and its API is subject to change without warnings.

This is the client to be used for maintaining metadata in an SDMX Registry.

>>> from pysdmx.api.fmr.maintenance import RegistryMaintenanceClient
>>> cd = Code("A", name="Code A")
>>> cl = Codelist("CL_TEST", agency="TEST", name="Test CL", items=[cd])
>>> target = "https://registry.sdmx.org"
>>> client = RegistryMaintenanceClient(target, "user", "password")
>>> client.put_structures([cl])
class pysdmx.api.fmr.maintenance.RegistryMaintenanceClient(api_endpoint, user=None, password=None, access_token=None, pem=None, timeout=60.0)

EXPERIMENTAL: A client to update metadata in the FMR.

The client supports two authentication modes:

  • Bearer token authentication via access_token

  • HTTP Basic authentication via user and password

If access_token is provided, it takes precedence over user and password.

The client does not obtain or refresh OIDC/OAuth2 tokens itself. It is the responsibility of the caller to acquire a valid access token from their authentication provider and pass it to this client.

put_metadata_reports(reports, header=None, action=StructureAction.Replace)

EXPERIMENTAL: Upload SDMX metadata reports to the FMR.

This method is experimental and its interface or behavior may change without notice.

Parameters:
  • reports (Sequence[MetadataReport]) – A sequence of metadata reports to upload.

  • header (Optional[Header]) – Optional SDMX Header to include in the message. If not supplied, pysdmx will generate one for you.

  • action (StructureAction) – How to apply the changes in case of already existing structures.

Return type:

None

put_structures(artefacts, header=None, action=StructureAction.Replace)

EXPERIMENTAL: Upload SDMX structures to the FMR.

This method is experimental and its interface or behavior may change without notice.

Parameters:
  • artefacts (Sequence[MaintainableArtefact]) – The sequence of SDMX maintainable artefacts to upload.

  • header (Optional[Header]) – Optional SDMX Header to include in the message. If not supplied, pysdmx will generate one for you.

  • action (StructureAction) – How to apply the changes in case of already existing structures.

Return type:

None