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 dict | None
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.
optionalkeyword-onlyas_bytes: bool = False
Deprecated, use
get_record_as_bytes()
instead. Whether to retrieve the record as raw bytes, default False.optionalkeyword-onlyas_file: bool = False
Deprecated, use
stream_record()
instead. Whether to retrieve the record as a file-like object, default False.
Returns dict | None
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 dict | None
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
optionalkeyword-onlylimit: int | None = None
Number of keys to be returned. Maximum value is 1000.
optionalkeyword-onlyexclusive_start_key: str | None = None
All keys up to this one (including) are skipped from the result.
Returns dict
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.
optionalcontent_type: str | None = None
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[dict | None]
update
Update the key-value store with specified fields.
https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/update-store
Parameters
optionalkeyword-onlyname: str | None = None
The new name for key-value store.
Returns dict
Sub-client for manipulating a single key-value store.