KeyValueStoreClient
Hierarchy
- ResourceClient
- KeyValueStoreClient
Index
Methods
__init__
Initialize a new instance.
Parameters
keyword-onlybase_url: str
Base URL of the API server.
keyword-onlyroot_client: ApifyClient
The ApifyClient instance under which this resource client exists.
keyword-onlyhttp_client: HTTPClient
The HTTPClient instance to be used in this client.
optionalkeyword-onlyresource_id: str | None = None
ID of the manipulated resource, in case of a single-resource client.
keyword-onlyresource_path: str
Path to the resource's endpoint on the API server.
optionalkeyword-onlyparams: dict | None = None
Parameters to include in all requests from this client.
Returns None
create_keys_public_url
Generate a URL that can be used to access key-value store keys.
If the client has permission to access the key-value store's URL signing key, the URL will include a signature to verify its authenticity.
You can optionally control how long the signed URL should be valid using the
expires_in_secs
option. This value sets the expiration duration in seconds from the time the URL is generated. If not provided, the URL will not expire.Any other options (like
limit
orprefix
) will be included as query parameters in the URL.Parameters
optionalkeyword-onlylimit: int | None = None
optionalkeyword-onlyexclusive_start_key: str | None = None
optionalkeyword-onlycollection: str | None = None
optionalkeyword-onlyprefix: str | None = None
optionalkeyword-onlyexpires_in_secs: int | None = None
Returns str
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.
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.
optionalkeyword-onlycollection: str | None = None
The name of the collection in store schema to list keys from.
optionalkeyword-onlyprefix: str | None = None
The prefix of the keys to be listed.
Returns dict
record_exists
Check if given record is present in the key-value store.
Parameters
key: str
Key of the record to check.
Returns bool
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.
optionalkeyword-onlygeneral_access: StorageGeneralAccess | None = None
Determines how others can access the key-value store.
Returns dict
Sub-client for manipulating a single key-value store.