Catalog client#

class geonemo.client.CatalogClient(
base_url=None,
*,
transport=None,
project_id=None,
token=None,
timeout=10.0,
client=None,
headers=None,
)#

Use catalog and vector capabilities without storage implementation access.

browse(request)#

List a collection’s records in order (POST /v1/catalog/records).

Parameters:

request – Collection, filters, sort, limit and cursor.

Returns:

A CatalogBrowseResponse.

Raises:
collection_stats(collection)#

Get a collection’s record count, bounds and time range (GET /v1/catalog/collections/{collection}/stats).

Parameters:

collection – Collection name.

Returns:

The CatalogCollectionStats.

Raises:
facets(request)#

Count the values of metadata fields (POST /v1/catalog/facets).

Parameters:

request – Collection, fields, filters and limit.

Returns:

A CatalogFacetResponse.

Raises:
get_record(collection, record_id)#

Read one record (GET /v1/catalog/collections/{collection}/records/{record_id}).

Parameters:
  • collection – Collection name.

  • record_id – Record ID; any text up to 4096 bytes.

Returns:

The CatalogRecord, or None if it does not exist.

Raises:
  • ValueError – If collection or record_id is invalid.

  • ServicesClientError – On transport or HTTP failure, or an invalid response.

get_records(request)#

Read several records by ID (POST /v1/catalog/records/batch).

Parameters:

request – Collection and up to 500 record IDs.

Returns:

The found records and the IDs that were missing.

Raises:
ingest(request, *, idempotency_key=None)#

Ingest records into a collection (POST /v1/catalog/ingest).

Parameters:
  • request – Collection and records.

  • idempotency_key – Replay key (1-256 visible ASCII characters); defaults to a hash of the request, so repeating an identical ingest is a safe replay.

Returns:

The CatalogIngestReceipt.

Raises:
list_collections()#

List every collection (GET /v1/catalog/collections), following its pages.

Returns:

The CollectionInfo entries.

Raises:
list_collections_page(*, after=None, limit=64)#

List one page of collections by name (GET /v1/catalog/collections).

Parameters:
  • after – The previous page’s next_after; omit for the first page.

  • limit – Page size, 1 to 64.

Returns:

A CollectionList; its next_after is set when more collections follow.

Raises:

ServicesClientError – On transport or HTTP failure, or an invalid response.

metadata_fields(collection)#

List a collection’s metadata fields (GET /v1/catalog/collections/{collection}/metadata- fields).

Parameters:

collection – Collection name.

Returns:

The MetadataFieldList.

Raises:
scan(request)#

Read one page of a full scan of a collection (POST /v1/catalog/scan).

Parameters:

request – A CatalogScanRequest with the collection, cursor, limit and exact filters.

Returns:

A CatalogScanResponse; pass its next_cursor to continue.

Raises:
search(request)#

Search a collection (POST /v1/catalog/search).

Parameters:

request – Search criteria and limit.

Returns:

A CatalogSearchResponse.

Raises:
search_page(request)#

Search a collection and also get the total match count (POST /v1/catalog/search- page).

Parameters:

request – Search criteria, limit and cursor.

Returns:

A CatalogSearchPageResponse.

Raises: