Applications Management

class nc_py_api.apps._AppsAPI(session: NcSessionBasic)[source]

The class provides the application management API on the Nextcloud server.

disable(app_id: str) None[source]

Disables the application.

Note

Does not work in NextcloudApp mode, only for Nextcloud client mode.

enable(app_id: str) None[source]

Enables the application.

Note

Does not work in NextcloudApp mode, only for Nextcloud client mode.

get_list(enabled: bool | None = None) list[str][source]

Get the list of installed applications.

Parameters:

enabled – filter to list all/only enabled/only disabled applications.

is_installed(app_id: str) bool[source]

Returns True if specified application is installed.

is_enabled(app_id: str) bool[source]

Returns True if specified application is enabled.

is_disabled(app_id: str) bool[source]

Returns True if specified application is disabled.

ex_app_disable(app_id: str) None[source]

Disables the external application.

Note

Does not work in NextcloudApp mode, only for Nextcloud client mode.

ex_app_enable(app_id: str) None[source]

Enables the external application.

Note

Does not work in NextcloudApp mode, only for Nextcloud client mode.

ex_app_get_list(enabled: bool = False) list[ExAppInfo][source]

Gets information of the enabled external applications installed on the server.

Parameters:

enabled – Flag indicating whether to return only enabled applications or all applications.

ex_app_is_enabled(app_id: str) bool[source]

Returns True if specified external application is enabled.

ex_app_is_disabled(app_id: str) bool[source]

Returns True if specified external application is disabled.

class nc_py_api.apps.ExAppInfo(raw_data: dict)[source]

Information about the External Application.

property app_id: str

ID of the application.

property name: str

Display name.

property version: str

Version of the application.

property enabled: bool

Flag indicating if the application enabled.

Preferences

class nc_py_api._preferences_ex.CfgRecord(raw_data: dict)[source]

A representation of a single key-value pair returned from the get_values method.

key: str
value: str

User specific

class nc_py_api._preferences.PreferencesAPI(session: NcSessionBasic)[source]

API for setting/removing configuration values of applications that support it.

property available: bool

Returns True if the Nextcloud instance supports this feature, False otherwise.

set_value(app_name: str, key: str, value: str) None[source]

Sets the value for the key for the specific application.

delete(app_name: str, key: str) None[source]

Removes a key and its value for a specific application.

class nc_py_api._preferences_ex.PreferencesExAPI(session: NcSessionBasic)[source]

User specific preferences API, avalaible as nc.preferences_ex.<method>.

set_value(key: str, value: str) None[source]

Sets a value for a key.

delete(keys: str | list[str], not_fail=True) None

Deletes config/preference entries by the provided keys.

get_value(key: str, default=None) str | None

Returns the value of the key, if found, or the specified default value.

get_values(keys: list[str]) list[CfgRecord]

Returns the CfgRecord for each founded key.

Non-user specific

class nc_py_api._preferences_ex.AppConfigExAPI(session: NcSessionBasic)[source]

Non-user(App) specific preferences API, avalaible as nc.appconfig_ex.<method>.

set_value(key: str, value: str, sensitive: bool | None = None) None[source]

Sets a value and if specified the sensitive flag for a key.

Note

A sensitive flag ensures key values are truncated in Nextcloud logs. Default for new records is False when sensitive is unspecified, if changes existing record and sensitive is unspecified it will not change the existing sensitive flag.

delete(keys: str | list[str], not_fail=True) None

Deletes config/preference entries by the provided keys.

get_value(key: str, default=None) str | None

Returns the value of the key, if found, or the specified default value.

get_values(keys: list[str]) list[CfgRecord]

Returns the CfgRecord for each founded key.