Synchronous client
This is the client to be used for retrieving the GDS information in a synchronous (i.e. blocking) fashion.
>>> from pysdmx.api.gds import GdsClient
>>> gc = GdsClient()
>>> agencies = gc.get_agencies("BIS")
- class pysdmx.api.gds.GdsClient(api_endpoint='https://gds.sdmx.io/', pem=None)
A client to be used to retrieve metadata from the GDS.
With this client, metadata will be retrieved in a synchronous fashion.
- get_agencies(agency)
Get the list of agencies for the supplied name.
- Parameters:
agency (
str
) – The agency maintaining the agency scheme from which sub-agencies must be returned.- Return type:
Sequence
[Agency
]- Returns:
The requested list of agencies.
- get_catalogs(catalog, resource='*', version='*', resource_type=None, message_format=None, api_version=None, detail=None, references=None)
Get the list of catalogs for the supplied parameters.
- Parameters:
catalog (
str
) – The agency maintaining the catalog.resource (
str
) – The resource ID(s) to query. Defaults to ‘*’.version (
str
) – The version(s) of the resource. Defaults to ‘*’.resource_type (
Optional
[Literal
['data'
,'metadata'
]]) – Filters the endpoints that support the requested resource type (eg, ‘data’, ‘metadata’)message_format (
Optional
[Literal
['json'
,'csv'
,'xml'
]]) – Filters the endpoints that support any of the requested message formats.api_version (
Optional
[str
]) – Filters the endpoints that is in a specific SDMX API version. Multiple values separated by commas are possible. By default (if nothing is sent) it returns everything.detail (
Optional
[Literal
['full'
,'raw'
]]) – The amount of information to be returned. If detail=full: All available information for all artefacts should be returned. If detail=raw: Any nested service will be referenced.references (
Optional
[Literal
['none'
,'children'
]]) – Instructs the web service to return (or not) the artefacts referenced by the artefact to be returned. If references=none: No referenced artefacts will be returned. If references=children: Returns the artefacts referenced by the artefact to be returned.
- Return type:
Sequence
[GdsCatalog
]- Returns:
A list of GdsCatalog objects.
- get_sdmx_apis(api_version='*')
Get the list of SDMX API versions.
- Parameters:
api_version (
str
) – The version of the SDMX API to be returned. Defaults to ‘*’.- Return type:
Sequence
[GdsSdmxApi
]
- get_services(service, resource='*', version='*')
Get the list of services for the supplied parameters.
- Parameters:
service (
str
) – The agency maintaining the service.resource (
str
) – The resource ID(s) to query. Defaults to ‘*’.version (
str
) – The version(s) of the resource. Defaults to ‘*’.
- Return type:
Sequence
[GdsService
]- Returns:
A list of GdsService objects.
- get_urn_resolver(urn)
Resolve a URN to its corresponding resource.
- Parameters:
urn (
str
) – The URN to resolve.- Return type:
- Returns:
A GdsUrnResolver object with the resolved information.