Skip to content

Client.algorithms¤

detail ¤

detail(
    pk: Optional[str] = None,
    api_url: Optional[str] = None,
    **params: Any
) -> gcapi.models.Algorithm

Retrieve a specific resource by primary key, URL, or search parameters.

Parameters:

  • pk (Optional[str], default: None ) –

    Primary key of the resource to retrieve.

  • api_url (Optional[str], default: None ) –

    Direct API URL of the resource to retrieve.

  • **params (Any, default: {} ) –

    Search parameters to find a unique resource, such as slug="your-slug".

Returns:

  • Algorithm

    The requested resource instance.

Raises:

  • ValueError

    If more than one or none of pk, api_url, or params are specified.

  • ObjectNotFound

    If no resource is found matching the criteria.

  • MultipleObjectsReturned

    If multiple resources match the search parameters.

iterate_all ¤

iterate_all(
    params: Optional[dict[str, Any]] = None,
) -> Iterator[gcapi.models.Algorithm]

Iterate through all resources from the API endpoint across all pages.

This method automatically handles pagination and yields individual resources from all pages until all resources have been retrieved.

Parameters:

  • params (Optional[dict[str, Any]], default: None ) –

    Query parameters to include in the API requests.

Yields:

  • Algorithm

    Individual resources from the API endpoint.

list ¤

list(
    params: Optional[dict[str, Any]] = None,
) -> list[gcapi.models.Algorithm]

Retrieve a raw list of resources from the API endpoint.

Parameters:

  • params (Optional[dict[str, Any]], default: None ) –

    Query parameters to include in the API request.

Returns:

  • list[Algorithm]

    Raw JSON response from the API containing the list of resources.

page ¤

page(
    offset: int = 0,
    limit: int = 100,
    params: Optional[dict[str, Any]] = None,
) -> PageResult[gcapi.models.Algorithm]

Retrieve a paginated set of resources from the API endpoint.

Parameters:

  • offset (int, default: 0 ) –

    The starting index for pagination (zero-based).

  • limit (int, default: 100 ) –

    The maximum number of results to return in this page.

  • params (Optional[dict[str, Any]], default: None ) –

    Additional query parameters to include in the API request.

Returns:

  • PageResult[Algorithm]

    A paginated result containing the requested resources and metadata.