[docs]defget_sdmx(source:Optional[str]=None,**args)->pd.DataFrame:"""Retrieve data from *source* using :mod:`sdmx`. Arguments --------- source : str Name of a data source recognized by ``sdmx1``, e.g. 'OECD'. args Other arguments to :meth:`sdmx.Request.get`. Returns ------- pandas.DataFrame """# SDMX client for the data sourcereq=sdmx.Client(source=source)# commented: for debugging# args.setdefault('tofile', 'debug.json')# Retrieve the datamsg=req.get(resource_type="data",**args)# Convert to pd.DataFrame, preserving attributesdf=sdmx.to_pandas(msg,attributes="dgso")index_cols=df.index.names# Reset index, use categoricalsreturndf.reset_index().astype({c:"category"forcinindex_cols})