ClientData

class ClientDataAPIMixIn(host=None, port=None, username=None, password=None, api_key=None, EXTRA_HEADERS=None, REQUESTS_ARGS=None, HTTPADAPTER_ARGS=None, VERIFY_WEBUI_CERTIFICATE=True, FORCE_SCHEME_FROM_HOST=False, RAISE_NOTIMPLEMENTEDERROR_FOR_UNIMPLEMENTED_API_ENDPOINTS=False, RAISE_ERROR_FOR_UNSUPPORTED_QBITTORRENT_VERSIONS=False, VERBOSE_RESPONSE_LOGGING=False, SIMPLE_RESPONSES=False, DISABLE_LOGGING_DEBUG_OUTPUT=False) → None

Bases: AppAPIMixIn

Implementation of all ClientData API methods.

qBittorrent persists arbitrary key/value data on behalf of a Web API client; the WebUI uses it to store its own preferences.

Usage:
>>> from qbittorrentapi import Client
>>> client = Client(host="localhost:8080", username="admin", password="adminadmin")
>>> client.clientdata_store(data={"my_app": {"theme": "dark"}})
>>> stored = client.clientdata_load(keys=["my_app"])
clientdata_load(keys=None, **kwargs) → ClientDataDictionary

Retrieve stored client data.

This method was introduced with qBittorrent v5.2.0 (Web API v2.13.1).

Raises:

InvalidRequest400Error – if keys is not a list of strings

Parameters:

keys (Iterable[str] | None) – keys to retrieve; omit for all stored data

Return type:

ClientDataDictionary

clientdata_store(data=None, **kwargs) → None

Store client data.

This method was introduced with qBittorrent v5.2.0 (Web API v2.13.1).

Raises:
Parameters:

data (Mapping[str, Any] | None) – mapping of keys to values to store

Return type:

None

class ClientData(*args, client, **kwargs)

Allows interaction with ClientData API endpoints.

Usage:
>>> from qbittorrentapi import Client
>>> client = Client(host="localhost:8080", username="admin", password="adminadmin")
>>> client.clientdata.store(data={"my_app": {"theme": "dark"}})
>>> stored = client.clientdata.load(keys=["my_app"])
load(keys=None, **kwargs) → ClientDataDictionary

Implements clientdata_load().

Return type:

ClientDataDictionary

store(data=None, **kwargs) → None

Implements clientdata_store().

Return type:

None

class ClientDataDictionary(data=None, **kwargs)

Bases: Dictionary[None | int | str | bool | Sequence[JsonValueT] | Mapping[str, JsonValueT]]

Response for clientdata_load()