KeyValueStoreClient
apify_client.clients.KeyValueStoreClient
Index
Methods
delete
Delete the key-value store.
https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/delete-store
Returns None
delete_record
Delete the specified record from the key-value store.
https://docs.apify.com/api/v2#/reference/key-value-stores/record/delete-record
Parameters
key: str
The key of the record which to delete
Returns None
get
Retrieve the key-value store.
https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/get-store
Returns Optional[Dict]
The retrieved key-value store, or None if it does not exist
get_record
Retrieve the given record from the key-value store.
https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record
Parameters
key: str
Key of the record to retrieve
as_bytes: bool = Falsekeyword-only
Deprecated, use
get_record_as_bytes()
instead. Whether to retrieve the record as raw bytes, default Falseas_file: bool = Falsekeyword-only
Deprecated, use
stream_record()
instead. Whether to retrieve the record as a file-like object, default False
Returns Optional[Dict]
The requested record, or None, if the record does not exist
get_record_as_bytes
Retrieve the given record from the key-value store, without parsing it.
https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record
Parameters
key: str
Key of the record to retrieve
Returns Optional[Dict]
The requested record, or None, if the record does not exist
list_keys
List the keys in the key-value store.
https://docs.apify.com/api/v2#/reference/key-value-stores/key-collection/get-list-of-keys
Parameters
limit: Optional[int] = Noneoptionalkeyword-only
Number of keys to be returned. Maximum value is 1000
exclusive_start_key: Optional[str] = Noneoptionalkeyword-only
All keys up to this one (including) are skipped from the result
Returns Dict
The list of keys in the key-value store matching the given arguments
set_record
Set a value to the given record in the key-value store.
https://docs.apify.com/api/v2#/reference/key-value-stores/record/put-record
Parameters
key: str
The key of the record to save the value to
value: Any
The value to save into the record
content_type: Optional[str] = Noneoptional
The content type of the saved value
Returns None
stream_record
Retrieve the given record from the key-value store, as a stream.
https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record
Parameters
key: str
Key of the record to retrieve
Returns Iterator[Optional[Dict]]
The requested record as a context-managed streaming Response, or None, if the record does not exist
update
Update the key-value store with specified fields.
https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/update-store
Parameters
name: Optional[str] = Noneoptionalkeyword-only
The new name for key-value store
Returns Dict
The updated key-value store
Sub-client for manipulating a single key-value store.