ApifyKeyValueStoreClient
Index
Methods
__init__
Initialize a new instance.
Preferably use the
ApifyKeyValueStoreClient.open
class method to create a new instance.Parameters
keyword-onlyapi_client: KeyValueStoreClientAsync
keyword-onlyapi_public_base_url: str
keyword-onlylock: asyncio.Lock
Returns None
delete_value
Parameters
key: str
Returns None
drop
Returns None
get_metadata
Returns ApifyKeyValueStoreMetadata
get_public_url
Get a URL for the given key that may be used to publicly access the value in the remote key-value store.
Parameters
key: str
The key for which the URL should be generated.
Returns str
get_value
Parameters
key: str
Returns KeyValueStoreRecord | None
iterate_keys
Parameters
optionalkeyword-onlyexclusive_start_key: str | None = None
optionalkeyword-onlylimit: int | None = None
Returns AsyncIterator[KeyValueStoreRecordMetadata]
open
Open an Apify key-value store client.
This method creates and initializes a new instance of the Apify key-value store client. It handles authentication, storage lookup/creation, and metadata retrieval.
Parameters
keyword-onlyid: str | None
The ID of an existing key-value store to open. If provided, the client will connect to this specific storage. Cannot be used together with
name
.keyword-onlyname: str | None
The name of a key-value store to get or create. If a storage with this name exists, it will be opened; otherwise, a new one will be created. Cannot be used together with
id
.keyword-onlyconfiguration: Configuration
The configuration object containing API credentials and settings. Must include a valid
token
andapi_base_url
. May also contain adefault_key_value_store_id
for fallback when neitherid
norname
is provided.
Returns ApifyKeyValueStoreClient
purge
Returns None
record_exists
Parameters
key: str
Returns bool
set_value
Parameters
key: str
value: Any
optionalcontent_type: str | None = None
Returns None
An Apify platform implementation of the key-value store client.