nc-py-api 0.19.1__tar.gz → 0.19.2__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.
Files changed (55) hide show
  1. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/CHANGELOG.md +6 -0
  2. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/PKG-INFO +1 -1
  3. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_session.py +6 -0
  4. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_version.py +1 -1
  5. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/nextcloud.py +8 -2
  6. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/.gitignore +0 -0
  7. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/AUTHORS +0 -0
  8. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/LICENSE.txt +0 -0
  9. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/README.md +0 -0
  10. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/__init__.py +0 -0
  11. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_deffered_error.py +0 -0
  12. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_exceptions.py +0 -0
  13. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_misc.py +0 -0
  14. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_preferences.py +0 -0
  15. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_preferences_ex.py +0 -0
  16. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_talk_api.py +0 -0
  17. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/_theming.py +0 -0
  18. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/activity.py +0 -0
  19. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/apps.py +0 -0
  20. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/calendar_api.py +0 -0
  21. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/__init__.py +0 -0
  22. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/defs.py +0 -0
  23. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/events_listener.py +0 -0
  24. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/integration_fastapi.py +0 -0
  25. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/logger.py +0 -0
  26. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/misc.py +0 -0
  27. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/occ_commands.py +0 -0
  28. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/persist_transformers_cache.py +0 -0
  29. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/providers/__init__.py +0 -0
  30. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/providers/providers.py +0 -0
  31. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/providers/task_processing.py +0 -0
  32. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/ui/__init__.py +0 -0
  33. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/ui/files_actions.py +0 -0
  34. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/ui/resources.py +0 -0
  35. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/ui/settings.py +0 -0
  36. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/ui/top_menu.py +0 -0
  37. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/ui/ui.py +0 -0
  38. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/ex_app/uvicorn_fastapi.py +0 -0
  39. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/files/__init__.py +0 -0
  40. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/files/_files.py +0 -0
  41. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/files/files.py +0 -0
  42. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/files/files_async.py +0 -0
  43. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/files/sharing.py +0 -0
  44. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/loginflow_v2.py +0 -0
  45. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/notes.py +0 -0
  46. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/notifications.py +0 -0
  47. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/options.py +0 -0
  48. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/talk.py +0 -0
  49. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/talk_bot.py +0 -0
  50. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/user_status.py +0 -0
  51. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/users.py +0 -0
  52. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/users_groups.py +0 -0
  53. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/weather_status.py +0 -0
  54. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/nc_py_api/webhooks.py +0 -0
  55. {nc_py_api-0.19.1 → nc_py_api-0.19.2}/pyproject.toml +0 -0
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.19.2 - 2025-03-17]
6
+
7
+ ### Added
8
+
9
+ - Optional `response_type` parameter of `nextcloud.ocs` method for calling OCS endpoints that return raw data. #341 Thanks to @janepie
10
+
5
11
  ## [0.19.1 - 2025-03-07]
6
12
 
7
13
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nc-py-api
3
- Version: 0.19.1
3
+ Version: 0.19.2
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/
@@ -197,6 +197,7 @@ class NcSessionBasic(NcSessionBase, ABC):
197
197
  *,
198
198
  content: bytes | str | typing.Iterable[bytes] | typing.AsyncIterable[bytes] | None = None,
199
199
  json: dict | list | None = None,
200
+ response_type: str | None = None,
200
201
  params: dict | None = None,
201
202
  files: dict | None = None,
202
203
  **kwargs,
@@ -215,6 +216,8 @@ class NcSessionBasic(NcSessionBase, ABC):
215
216
  if response.status_code == 204: # NO_CONTENT
216
217
  return []
217
218
  response_data = loads(response.text)
219
+ if response_type == "json":
220
+ return response_data
218
221
  ocs_meta = response_data["ocs"]["meta"]
219
222
  if ocs_meta["status"] != "ok":
220
223
  if (
@@ -319,6 +322,7 @@ class AsyncNcSessionBasic(NcSessionBase, ABC):
319
322
  *,
320
323
  content: bytes | str | typing.Iterable[bytes] | typing.AsyncIterable[bytes] | None = None,
321
324
  json: dict | list | None = None,
325
+ response_type: str | None = None,
322
326
  params: dict | None = None,
323
327
  files: dict | None = None,
324
328
  **kwargs,
@@ -337,6 +341,8 @@ class AsyncNcSessionBasic(NcSessionBase, ABC):
337
341
  if response.status_code == 204: # NO_CONTENT
338
342
  return []
339
343
  response_data = loads(response.text)
344
+ if response_type == "json":
345
+ return response_data
340
346
  ocs_meta = response_data["ocs"]["meta"]
341
347
  if ocs_meta["status"] != "ok":
342
348
  if (
@@ -1,3 +1,3 @@
1
1
  """Version of nc_py_api."""
2
2
 
3
- __version__ = "0.19.1"
3
+ __version__ = "0.19.2"
@@ -137,11 +137,14 @@ class _NextcloudBasic(ABC): # pylint: disable=too-many-instance-attributes
137
137
  *,
138
138
  content: bytes | str | typing.Iterable[bytes] | typing.AsyncIterable[bytes] | None = None,
139
139
  json: dict | list | None = None,
140
+ response_type: str | None = None,
140
141
  params: dict | None = None,
141
142
  **kwargs,
142
143
  ):
143
144
  """Performs OCS call and returns OCS response payload data."""
144
- return self._session.ocs(method, path, content=content, json=json, params=params, **kwargs)
145
+ return self._session.ocs(
146
+ method, path, content=content, json=json, response_type=response_type, params=params, **kwargs
147
+ )
145
148
 
146
149
  def download_log(self, fp) -> None:
147
150
  """Downloads Nextcloud log file. Requires Admin privileges."""
@@ -238,11 +241,14 @@ class _AsyncNextcloudBasic(ABC): # pylint: disable=too-many-instance-attributes
238
241
  *,
239
242
  content: bytes | str | typing.Iterable[bytes] | typing.AsyncIterable[bytes] | None = None,
240
243
  json: dict | list | None = None,
244
+ response_type: str | None = None,
241
245
  params: dict | None = None,
242
246
  **kwargs,
243
247
  ):
244
248
  """Performs OCS call and returns OCS response payload data."""
245
- return await self._session.ocs(method, path, content=content, json=json, params=params, **kwargs)
249
+ return await self._session.ocs(
250
+ method, path, content=content, json=json, response_type=response_type, params=params, **kwargs
251
+ )
246
252
 
247
253
  async def download_log(self, fp) -> None:
248
254
  """Downloads Nextcloud log file. Requires Admin privileges."""
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes