transport_data.util.ckan.Client¶
- class transport_data.util.ckan.Client(address: str, id: str)[source]¶
Bases:
objectWrapper around
ckanapi.RemoteCKAN.This provides features such as:
Iterating over calls with rate limits.
Caching results, including combined results from multiple calls.
Converting return values to instances of
ModelProxysubclasses.
Methods
__init__(address, id)group_list([limit, max])license_list([limit, max])list_action(kind[, limit, max])Call the
{kind}_listAPI endpoint.member_roles_list([limit, max])organization_list([limit, max])organization_show(obj_or_id, *, _cls, **kwargs)package_list(*[, kind, limit, max])package_show(obj_or_id, *, _cls, **kwargs)show_action(obj_or_id, _cls, **kwargs)Call the
{kind}_showAPI endpoint.tag_list(*[, kind, limit, max])tag_show(obj_or_id, *, _cls, **kwargs)user_list(*[, kind, limit, max])Attributes
id- list_action(kind: str, limit: int | None = None, max: int | None = None, **kwargs) list¶
Call the
{kind}_listAPI endpoint.- Parameters:
kind – String identifying the kind of CKAN object to fetch.
limit – Number of results to fetch in a single query.
max – Maximum number of results to fetch.
- show_action(obj_or_id: str | dict | T, _cls: type[T], **kwargs) T¶
Call the
{kind}_showAPI endpoint.If obj_or_id is an instance of
ModelProxy, itsnameoridis used for the query, and the same instance is updated with the response data and returned. If obj_or_id isstrordicta new instance of aModelProxysubclass is returned.The return value is cached.