Asynchronous client
This is the client to be used for retrieving metadata from an SDMX Registry or SDMX service in an asynchronous (i.e. non-blocking fashion).
>>> import asyncio
>>> from pysdmx.fmr import AsyncRegistryClient
>>> async def main():
>>> gr = AsyncRegistryClient("https://registry.sdmx.org/sdmx/v2/")
>>> mapping = await gr.get_schema("dataflow", "UIS", "EDUCAT_CLASS_A", "1.0")
>>> print(mapping)
>>> asyncio.run(main())
- class pysdmx.fmr.AsyncRegistryClient(api_endpoint, format=Format.SDMX_JSON, pem=None)
A client to be used to retrieve metadata from the FMR.
With this client, metadata will be retrieved in a asynchronous fashion.
- async get_agencies(agency)
Get the list of sub-agencies for the supplied agency.
- Parameters:
agency (
str
) – The agency maintaining the agency scheme from which sub-agencies must be returned.- Return type:
Sequence
[Organisation
]- Returns:
The requested list of agencies.
- async get_categories(agency, id, version='+')
Get the category scheme matching the supplied parameters.
- Parameters:
agency (
str
) – The agency maintaining the category scheme.id (
str
) – The ID of the category scheme to be returned.version (
str
) – The version of the category scheme to be returned. The most recent version will be returned, unless specified otherwise.
- Return type:
- Returns:
The requested category scheme.
- async get_code_map(agency, id, version='+')
Get a code map (aka representation map).
- Parameters:
agency (
str
) – The agency maintaining the representation map.id (
str
) – The ID of the representation map to be returned.version (
str
) – The version of the representation map to be returned. The most recent version will be returned, unless specified otherwise.
- Return type:
Union
[MultiRepresentationMap
,RepresentationMap
]- Returns:
The requested mappings in the representation map.
- async get_codes(agency, id, version='+')
Get the codes from the codelist matching the supplied parameters.
- Parameters:
agency (
str
) – The agency maintaining the codelist.id (
str
) – The ID of the codelist to be returned.version (
str
) – The version of the codelist to be returned. The most recent version will be returned, unless specified otherwise.
- Return type:
- Returns:
The requested codelist.
- async get_concepts(agency, id, version='+')
Get the concept scheme matching the supplied parameters.
- Parameters:
agency (
str
) – The agency maintaining the concept scheme.id (
str
) – The ID of the concept scheme to be returned.version (
str
) – The version of the concept scheme to be returned. The most recent version will be returned, unless specified otherwise.
- Return type:
- Returns:
The requested concept scheme.
- async get_dataflow_details(agency, id, version='+', detail=DataflowDetails.ALL)
Get detailed information about a dataflow.
- Parameters:
agency (
str
) – The agency maintaining the dataflow.id (
str
) – The ID of the dataflow to be returned.version (
str
) – The version of the dataflow to be returned. The most recent version will be returned, unless specified otherwise.detail (
Union
[DataflowDetails
,Literal
['all'
,'core'
,'providers'
,'schema'
]]) – The amount of detail to be returned. “core” means only core information (ID, name, etc.) will be returned. “providers” means core information will be returned, as well as the list of organizations providing data for the dataflow. “schema” means core information will be returned, as well as the schema describing the expected/allowed structure of data to be reported against the dataflow. “all” combines all 3 other options.
- Return type:
- Returns:
The requested information about a dataflow.
- async get_hierarchy(agency, id, version='+')
Get a hierarchical list of codes.
- Parameters:
agency (
str
) – The agency maintaining the hierarchy.id (
str
) – The ID of the hierarchy to be returned.version (
str
) – The version of the hierarchy to be returned. The most recent version will be returned, unless specified otherwise.
- Return type:
- Returns:
The requested hierarchical list of codes.
- async get_mapping(agency, id, version='+')
Get a mapping definition (aka structure map).
- Parameters:
agency (
str
) – The agency maintaining the structure map.id (
str
) – The ID of the structure map to be returned.version (
str
) – The version of the structure map to be returned. The most recent version will be returned, unless specified otherwise.
- Return type:
- Returns:
The requested mapping definition (aka Structure Map).
- async get_providers(agency, with_flows=False)
Get the list of data providers for the supplied agency.
- Parameters:
agency (
str
) – The agency maintaining the data provider scheme from which data providers must be returned.with_flows (
bool
) – Whether the data providers should contain the list of dataflows for which the data provider provides data.
- Return type:
Sequence
[Organisation
]- Returns:
The requested list of data providers.
- async get_report(provider, id, version='+')
Get a reference metadata report.
- Parameters:
provider (
str
) – The organization which provided the report.id (
str
) – The ID of the report to be returned.version (
str
) – The version of the report to be returned. The most recent version will be returned, unless specified otherwise.
- Return type:
- Returns:
The requested metadata report.
- async get_reports(artefact_type, agency, id, version='+')
Get the reference metadata reports for the supplied structure.
- Parameters:
artefact_type (
str
) – The type of the structure for which reports must be returned.agency (
str
) – The agency maintaining the hierarchy for which reports must be returned.id (
str
) – The ID of the structure for which reports must be returned.version (
str
) – The version of the structure for which reports must be returned.
- Return type:
Sequence
[MetadataReport
]- Returns:
The metadata reports about the supplied structure.
- async get_schema(context, agency, id, version)
Get the schema matching the supplied parameters.
- Parameters:
context (
Union
[Context
,Literal
['dataflow'
,'datastructure'
,'provisionagreement'
]]) – The context for which the schema should be generated (dataflow, datastructure or provisionagreement). This defines the constraints to be applied when generating the schema.agency (
str
) – The ID of the agency maintaining the context.id (
str
) – The ID of the context to be considered.version (
str
) – The version of the context to be considered.
- Return type:
- Returns:
The requested schema.