nc-py-api 0.22.0__tar.gz → 0.23.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/CHANGELOG.md +22 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/PKG-INFO +1 -1
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_version.py +1 -1
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/integration_fastapi.py +8 -1
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/providers/task_processing.py +34 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/talk_bot.py +6 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/.gitignore +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/AUTHORS +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/LICENSE.txt +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/README.md +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/__init__.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_deffered_error.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_exceptions.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_misc.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_preferences.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_preferences_ex.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_session.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_talk_api.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/_theming.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/activity.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/apps.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/calendar_api.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/__init__.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/defs.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/logger.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/misc.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/occ_commands.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/persist_transformers_cache.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/providers/__init__.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/providers/providers.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/ui/__init__.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/ui/files_actions.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/ui/resources.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/ui/settings.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/ui/top_menu.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/ui/ui.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/ex_app/uvicorn_fastapi.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/files/__init__.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/files/_files.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/files/files.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/files/files_async.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/files/sharing.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/loginflow_v2.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/nextcloud.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/notes.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/notifications.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/options.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/talk.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/user_status.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/users.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/users_groups.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/weather_status.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/nc_py_api/webhooks.py +0 -0
- {nc_py_api-0.22.0 → nc_py_api-0.23.1}/pyproject.toml +0 -0
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.23.1 - 2026-01-16]
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fix custom progress bar with huggingface_hub >= 1.1.0. #391 Thanks to @danxuliu
|
|
10
|
+
|
|
11
|
+
## [0.23.0 - 2025-11-25]
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- TaskProcessing: Add next_task_batch endpoint (#383)
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Handle bot join messages properly to get conversation id and name (#385)
|
|
20
|
+
|
|
21
|
+
## [0.22.0 - 2025-10-24]
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- TaskProcessing: Add trigger_handler to set_handlers() (#382)
|
|
26
|
+
|
|
5
27
|
## [0.21.1 - 2025-08-27]
|
|
6
28
|
|
|
7
29
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nc-py-api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.23.1
|
|
4
4
|
Summary: Nextcloud Python Framework
|
|
5
5
|
Project-URL: Changelog, https://github.com/cloud-py-api/nc_py_api/blob/main/CHANGELOG.md
|
|
6
6
|
Project-URL: Documentation, https://cloud-py-api.github.io/nc_py_api/
|
|
@@ -252,8 +252,15 @@ def __fetch_model_as_snapshot(
|
|
|
252
252
|
from tqdm import tqdm # noqa isort:skip pylint: disable=C0415 disable=E0401
|
|
253
253
|
|
|
254
254
|
class TqdmProgress(tqdm):
|
|
255
|
+
def __init__(self, *args, **kwargs):
|
|
256
|
+
# huggingface may provide a name, but tqdm rejects a "name"
|
|
257
|
+
# argument, so it needs to be removed
|
|
258
|
+
kwargs.pop("name", None)
|
|
259
|
+
super().__init__(*args, **kwargs)
|
|
260
|
+
|
|
255
261
|
def display(self, msg=None, pos=None):
|
|
256
|
-
|
|
262
|
+
if self.total:
|
|
263
|
+
nc.set_init_status(min(current_progress + int(progress_for_task * self.n / self.total), 99))
|
|
257
264
|
return super().display(msg, pos)
|
|
258
265
|
|
|
259
266
|
workers = download_options.pop("max_workers", 2)
|
|
@@ -142,6 +142,23 @@ class _TaskProcessingProviderAPI:
|
|
|
142
142
|
return r
|
|
143
143
|
return {}
|
|
144
144
|
|
|
145
|
+
def next_task_batch(
|
|
146
|
+
self, provider_ids: list[str], task_types: list[str], number_of_tasks: int
|
|
147
|
+
) -> dict[str, typing.Any]:
|
|
148
|
+
"""Get the next n task processing tasks from Nextcloud.
|
|
149
|
+
|
|
150
|
+
Available starting with Nextcloud 33
|
|
151
|
+
Returns: {tasks: [{task: Task, provider: string}], has_more: bool}
|
|
152
|
+
"""
|
|
153
|
+
with contextlib.suppress(NextcloudException):
|
|
154
|
+
if r := self._session.ocs(
|
|
155
|
+
"GET",
|
|
156
|
+
"/ocs/v2.php/taskprocessing/tasks_provider/next_batch",
|
|
157
|
+
json={"providerIds": provider_ids, "taskTypeIds": task_types, "numberOfTasks": number_of_tasks},
|
|
158
|
+
):
|
|
159
|
+
return r
|
|
160
|
+
return {"tasks": [], "has_more": False}
|
|
161
|
+
|
|
145
162
|
def set_progress(self, task_id: int, progress: float) -> dict[str, typing.Any]:
|
|
146
163
|
"""Report new progress value of the task to Nextcloud. Progress should be in range from 0.0 to 100.0."""
|
|
147
164
|
with contextlib.suppress(NextcloudException):
|
|
@@ -220,6 +237,23 @@ class _AsyncTaskProcessingProviderAPI:
|
|
|
220
237
|
return r
|
|
221
238
|
return {}
|
|
222
239
|
|
|
240
|
+
async def next_task_batch(
|
|
241
|
+
self, provider_ids: list[str], task_types: list[str], number_of_tasks: int
|
|
242
|
+
) -> dict[str, typing.Any]:
|
|
243
|
+
"""Get the next n task processing tasks from Nextcloud.
|
|
244
|
+
|
|
245
|
+
Available starting with Nextcloud 33
|
|
246
|
+
Returns: {tasks: [{task: Task, provider: string}], has_more: bool}
|
|
247
|
+
"""
|
|
248
|
+
with contextlib.suppress(NextcloudException):
|
|
249
|
+
if r := await self._session.ocs(
|
|
250
|
+
"GET",
|
|
251
|
+
"/ocs/v2.php/taskprocessing/tasks_provider/next_batch",
|
|
252
|
+
json={"providerIds": provider_ids, "taskTypeIds": task_types, "numberOfTasks": number_of_tasks},
|
|
253
|
+
):
|
|
254
|
+
return r
|
|
255
|
+
return {"tasks": [], "has_more": False}
|
|
256
|
+
|
|
223
257
|
async def set_progress(self, task_id: int, progress: float) -> dict[str, typing.Any]:
|
|
224
258
|
"""Report new progress value of the task to Nextcloud. Progress should be in range from 0.0 to 100.0."""
|
|
225
259
|
with contextlib.suppress(NextcloudException):
|
|
@@ -76,11 +76,17 @@ class TalkBotMessage:
|
|
|
76
76
|
|
|
77
77
|
It can be used to react or reply to the given message.
|
|
78
78
|
"""
|
|
79
|
+
# bot join
|
|
80
|
+
if self.message_type == "Join":
|
|
81
|
+
return self._raw_data["object"]["id"]
|
|
79
82
|
return self._raw_data["target"]["id"]
|
|
80
83
|
|
|
81
84
|
@property
|
|
82
85
|
def conversation_name(self) -> str:
|
|
83
86
|
"""The name of the conversation in which the message was posted."""
|
|
87
|
+
# bot join
|
|
88
|
+
if self.message_type == "Join":
|
|
89
|
+
return self._raw_data["object"]["name"]
|
|
84
90
|
return self._raw_data["target"]["name"]
|
|
85
91
|
|
|
86
92
|
def __repr__(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|