Skip to main content

KeyValueStoreClient

An abstract class for key-value store (KVS) storage clients.

Key-value stores clients provide an interface for accessing and manipulating KVS storage. They handle operations like getting, setting, deleting KVS values across different storage backends.

Storage clients are specific to the type of storage they manage (Dataset, KeyValueStore, RequestQueue), and can operate with various storage systems including memory, file system, databases, and cloud storage solutions.

This abstract class defines the interface that all specific KVS clients must implement.

Hierarchy

Index

Methods

delete_value

  • async delete_value(*, key): None
  • Delete a value from the key-value store by its key.

    The backend method for the KeyValueStore.delete_value call.


    Parameters

    • keyword-onlykey: str

    Returns None

drop

  • async drop(): None
  • Drop the whole key-value store and remove all its values.

    The backend method for the KeyValueStore.drop call.


    Returns None

get_metadata

get_public_url

  • async get_public_url(*, key): str
  • Get the public URL for the given key.

    The backend method for the KeyValueStore.get_public_url call.


    Parameters

    • keyword-onlykey: str

    Returns str

get_value

iterate_keys

  • Iterate over all the existing keys in the key-value store.

    The backend method for the KeyValueStore.iterate_keys call.


    Parameters

    • optionalkeyword-onlyexclusive_start_key: str | None = None
    • optionalkeyword-onlylimit: int | None = None

    Returns AsyncIterator[KeyValueStoreRecordMetadata]

purge

  • async purge(): None
  • Purge all items from the key-value store.

    The backend method for the KeyValueStore.purge call.


    Returns None

record_exists

  • async record_exists(*, key): bool
  • Check if a record with the given key exists in the key-value store.

    The backend method for the KeyValueStore.record_exists call.


    Parameters

    • keyword-onlykey: str

      The key to check for existence.

    Returns bool

set_value

  • async set_value(*, key, value, content_type): None
  • Set a value in the key-value store by its key.

    The backend method for the KeyValueStore.set_value call.


    Parameters

    • keyword-onlykey: str
    • keyword-onlyvalue: Any
    • optionalkeyword-onlycontent_type: str | None = None

    Returns None