API reference
client
- class zgw_consumers.client.APIKeyAuth(header: str, key: str)[source]
API Key based
requests.auth.AuthBaseimplementation.
- class zgw_consumers.client.OAuth2Auth(service: Service, _token: dict[str, Any] | None = None)[source]
OAuth2 bearer token auth using requests-oauthlib (client credentials).
- class zgw_consumers.client.ServiceConfigAdapter(service: Service)[source]
An implementation of
ape_pie.ConfigAdapterthat will extract session kwargs from a givenzgw_consumers.models.Service.
- class zgw_consumers.client.ZGWAuth(service: Service)[source]
requests.auth.AuthBaseimplementation for ZGW APIs auth.
- zgw_consumers.client.build_client(service: Service, client_factory: type[ClientT] = <class 'zgw_consumers.nlx.NLXClient'>, **kwargs) ClientT[source]
Build a client for a given
zgw_consumers.models.Service.
nlx
- class zgw_consumers.nlx.NLXClient(*args, nlx_base_url: str = '', **kwargs)[source]
A
ape_pie.APIClientimplementation that will take care of rewriting URLs with an event hook.
utils
- class zgw_consumers.utils.cache_on_request(request: HttpRequest, key: str, callback: Callable[[], T])[source]
- zgw_consumers.utils.pagination_helper(client: APIClient, paginated_data: PaginatedResponseData, max_requests: int | None = None, **kwargs)[source]
Fetch results from a paginated API endpoint, and optionally limit the number of requests to perform when fetching new pages by specifying the
max_requestsargument