transport_data.util.ckan.ModelProxy¶
- class transport_data.util.ckan.ModelProxy(data: dict | None = None, **kwargs)[source]¶
Bases:
objectSimple proxy for a CKAN object/model.
ckanitself is a Python package, but is a ‘heavy’ dependency—a large package with many dependencies. ModelProxy allows to interact with the different classes of CKAN objects based on the JSON data returned by the CKAN Action API, without a dependency onckanitself.Methods
__init__([data])asdict()Return the original dictionary of object data.
from_file(path)Construct a new instance from a file path.
get(name)Return the value of a single field.
get_item(name[, index])Get a member of a collection.
update(data)Update part or all of the object data.
Attributes
- classmethod from_file(path: pathlib.Path) T¶
Construct a new instance from a file path.