8.1.1.1. pandasdmx.reader package
8.1.1.1.1. Submodules
8.1.1.1.2. pandasdmx.reader.sdmxjson module
This module contains a reader for SDMXML v2.1.
-
class
pandasdmx.reader.sdmxjson.Reader(request, dsd, **kwargs)[source]
Bases: pandasdmx.reader.BaseReader
Read SDMXJSON 2.1 and expose it as instances from pandasdmx.model
-
dataset_attrib(sdmxobj)[source]
-
dim_at_obs(sdmxobj)[source]
-
generic_groups(sdmxobj)[source]
-
getitem0 = operator.itemgetter(0)
-
getitem_key = operator.itemgetter('_key')
-
group_key(sdmxobj)[source]
-
header_error(sdmxobj)[source]
-
initialize(source)[source]
-
international_str(name, sdmxobj)[source]
return DictLike of xml:lang attributes. If node has no attributes,
assume that language is ‘en’.
-
iter_generic_obs(sdmxobj, with_value, with_attributes)[source]
-
iter_generic_series_obs(sdmxobj, with_value, with_attributes, reverse_obs=False)[source]
-
iter_series(sdmxobj)[source]
-
read_as_str(name, sdmxobj, first_only=True)[source]
-
series_attrib(sdmxobj)[source]
-
series_key(sdmxobj)[source]
-
structured_by(sdmxobj)[source]
-
write_source(filename)[source]
Save source to file by calling write on the root element.
-
class
pandasdmx.reader.sdmxjson.XPath(path)[source]
Bases: object
8.1.1.1.3. pandasdmx.reader.sdmxml module
This module contains a reader for SDMXML v2.1.
-
class
pandasdmx.reader.sdmxml.Reader(request, dsd, **kwargs)[source]
Bases: pandasdmx.reader.BaseReader
Read SDMX-ML 2.1 and expose it as instances from pandasdmx.model
-
dataset_attrib(sdmxobj)
-
dim_at_obs(sdmxobj)[source]
-
generic_groups(sdmxobj)[source]
-
group_key(sdmxobj)[source]
-
header_error(sdmxobj)[source]
-
initialize(source)[source]
-
international_str(name, sdmxobj)[source]
return DictLike of xml:lang attributes. If node has no attributes,
assume that language is ‘en’.
-
iter_generic_obs(sdmxobj, with_value, with_attributes)[source]
-
iter_generic_series_obs(sdmxobj, with_value, with_attributes, reverse_obs=False)[source]
-
iter_series(sdmxobj)[source]
-
series_attrib(sdmxobj)[source]
-
series_key(sdmxobj)[source]
-
structured_by(sdmxobj)[source]
-
write_source(filename)[source]
Save XML source to file by calling write on the root element.
8.1.1.1.4. Module contents
This module contains the base class for readers.
-
class
pandasdmx.reader.BaseReader(request, dsd, **kwargs)[source]
Bases: object
-
initialize(source)[source]
-
read_as_str(name, sdmxobj, first_only=True)[source]
-
read_identifiables(cls, sdmxobj, offset=None)[source]
If sdmxobj inherits from dict: update it with modelized elements.
These must be instances of model.IdentifiableArtefact,
i.e. have an ‘id’ attribute. This will be used as dict keys.
If sdmxobj does not inherit from dict: return a new DictLike.
-
read_instance(cls, sdmxobj, offset=None, first_only=True)[source]
If cls in _paths and matches,
return an instance of cls with the first XML element,
or, if first_only is False, a list of cls instances
for all elements found,
If no matches were found, return None.