mgnipy.V2.query_set module#
- class mgnipy.V2.query_set.QuerySet(resource, *, config=None, params=None, **param_kwargs)[source]#
Bases:
objectBuilds and stores the current state of a query, including the resource type, parameters, and results.
- Parameters:
- clear_cache()[source]#
Clear the cached results for the current resource and parameters. This will delete any cached files associated with the current query parameters.
- config: MGnipyConfig#
- emgapi_handler: DescribeEmgapiModule#
- filter(**filters)[source]#
Update the parameters for the API call to filter results.
- Parameters:
**filters – Keyword arguments corresponding to the supported parameters for the current resource. These will be used to filter the results returned by the API.
- Returns:
A new QuerySet instance with updated parameters for filtering results.
- Return type:
- list_urls()[source]#
Generate and return a list of URLs for all the API requests that would be made to retrieve the data based on the current parameters. This allows the user to see exactly which endpoints and query parameters will be used in the API calls before executing them.
- queries(**httpx_kwargs)[source]#
Generate a list of query parameter dictionaries for each API request that would be made based on the current parameters. This allows the user to see the specific query parameters for each request before executing them.
- property records: chain | None #
Get an iterator of individual metadata records from the retrieved results, if available. This property provides a convenient way to access the metadata records without needing to handle pagination.
- Returns:
An iterator that yields individual metadata records if results are available, otherwise None.
- Return type:
chain or None
- property request_url: str #
Get the URL for the API request based on the current resource and parameters. This is a single URL that represents the request for the current page of results.
- Returns:
The constructed URL for the API request.
- Return type:
- property resource: SupportedEndpoints#