das-cli 1.5.17__tar.gz → 1.5.25__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 (50) hide show
  1. {das_cli-1.5.17/das_cli.egg-info → das_cli-1.5.25}/PKG-INFO +1 -1
  2. {das_cli-1.5.17 → das_cli-1.5.25}/das/managers/digital_objects_manager.py +34 -0
  3. {das_cli-1.5.17 → das_cli-1.5.25/das_cli.egg-info}/PKG-INFO +1 -1
  4. {das_cli-1.5.17 → das_cli-1.5.25}/pyproject.toml +1 -1
  5. {das_cli-1.5.17 → das_cli-1.5.25}/tests/entries_manager_test.py +1 -1
  6. {das_cli-1.5.17 → das_cli-1.5.25}/LICENSE +0 -0
  7. {das_cli-1.5.17 → das_cli-1.5.25}/MANIFEST.in +0 -0
  8. {das_cli-1.5.17 → das_cli-1.5.25}/README.md +0 -0
  9. {das_cli-1.5.17 → das_cli-1.5.25}/das/__init__.py +0 -0
  10. {das_cli-1.5.17 → das_cli-1.5.25}/das/ai/plugins/dasai.py +0 -0
  11. {das_cli-1.5.17 → das_cli-1.5.25}/das/ai/plugins/entries/entries_plugin.py +0 -0
  12. {das_cli-1.5.17 → das_cli-1.5.25}/das/app.py +0 -0
  13. {das_cli-1.5.17 → das_cli-1.5.25}/das/authentication/auth.py +0 -0
  14. {das_cli-1.5.17 → das_cli-1.5.25}/das/authentication/oauth.py +0 -0
  15. {das_cli-1.5.17 → das_cli-1.5.25}/das/authentication/secure_input.py +0 -0
  16. {das_cli-1.5.17 → das_cli-1.5.25}/das/cli.py +0 -0
  17. {das_cli-1.5.17 → das_cli-1.5.25}/das/common/api.py +0 -0
  18. {das_cli-1.5.17 → das_cli-1.5.25}/das/common/config.py +0 -0
  19. {das_cli-1.5.17 → das_cli-1.5.25}/das/common/entry_fields_constants.py +0 -0
  20. {das_cli-1.5.17 → das_cli-1.5.25}/das/common/enums.py +0 -0
  21. {das_cli-1.5.17 → das_cli-1.5.25}/das/common/file_utils.py +0 -0
  22. {das_cli-1.5.17 → das_cli-1.5.25}/das/managers/__init__.py +0 -0
  23. {das_cli-1.5.17 → das_cli-1.5.25}/das/managers/download_manager.py +0 -0
  24. {das_cli-1.5.17 → das_cli-1.5.25}/das/managers/entries_manager.py +0 -0
  25. {das_cli-1.5.17 → das_cli-1.5.25}/das/managers/search_manager.py +0 -0
  26. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/attributes.py +0 -0
  27. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/cache.py +0 -0
  28. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/das_elastic_search.py +0 -0
  29. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/digital_objects.py +0 -0
  30. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/downloads.py +0 -0
  31. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/entries.py +0 -0
  32. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/entry_fields.py +0 -0
  33. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/hangfire.py +0 -0
  34. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/search.py +0 -0
  35. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/service_base.py +0 -0
  36. {das_cli-1.5.17 → das_cli-1.5.25}/das/services/users.py +0 -0
  37. {das_cli-1.5.17 → das_cli-1.5.25}/das_cli.egg-info/SOURCES.txt +0 -0
  38. {das_cli-1.5.17 → das_cli-1.5.25}/das_cli.egg-info/dependency_links.txt +0 -0
  39. {das_cli-1.5.17 → das_cli-1.5.25}/das_cli.egg-info/entry_points.txt +0 -0
  40. {das_cli-1.5.17 → das_cli-1.5.25}/das_cli.egg-info/requires.txt +0 -0
  41. {das_cli-1.5.17 → das_cli-1.5.25}/das_cli.egg-info/top_level.txt +0 -0
  42. {das_cli-1.5.17 → das_cli-1.5.25}/setup.cfg +0 -0
  43. {das_cli-1.5.17 → das_cli-1.5.25}/tests/__init__.py +0 -0
  44. {das_cli-1.5.17 → das_cli-1.5.25}/tests/attributes_test.py +0 -0
  45. {das_cli-1.5.17 → das_cli-1.5.25}/tests/download_manager_test.py +0 -0
  46. {das_cli-1.5.17 → das_cli-1.5.25}/tests/entries_service_test.py +0 -0
  47. {das_cli-1.5.17 → das_cli-1.5.25}/tests/entries_test.py +0 -0
  48. {das_cli-1.5.17 → das_cli-1.5.25}/tests/file_utils_test.py +0 -0
  49. {das_cli-1.5.17 → das_cli-1.5.25}/tests/run_tests.py +0 -0
  50. {das_cli-1.5.17 → das_cli-1.5.25}/tests/search_manager_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: das-cli
3
- Version: 1.5.17
3
+ Version: 1.5.25
4
4
  Summary: DAS api client.
5
5
  Author: Royal Netherlands Institute for Sea Research
6
6
  License-Expression: MIT
@@ -94,6 +94,40 @@ class DigitalObjectsManager:
94
94
 
95
95
  return self._resolve_digital_object_code(upload_result)
96
96
 
97
+ def upload_file_raw(
98
+ self, file_description: str, digital_object_type: str, file_path: str
99
+ ) -> dict:
100
+ """Upload a file and return the raw result dict (including 'id') without resolving the code."""
101
+ digital_object_type_id = self._resolve_digital_object_type_id(digital_object_type)
102
+ return self.digital_objects_service.upload_digital_object(
103
+ file_description, digital_object_type_id, file_path
104
+ )
105
+
106
+ def link_digital_objects_by_id(
107
+ self, entry_code: str, digital_object_id_list: list[str], is_unlink: bool = False
108
+ ) -> bool:
109
+ """Link or unlink digital objects to an entry using their IDs directly."""
110
+ entry_response = self.entry_service.get_entry(entry_code)
111
+ if entry_response is None:
112
+ raise ValueError(f"Entry with code '{entry_code}' not found")
113
+
114
+ entry_payload = entry_response.get("entry")
115
+ if entry_payload is None:
116
+ raise ValueError(f"Entry with code '{entry_code}' not found")
117
+
118
+ return self.digital_objects_service.link_existing_digital_objects(
119
+ attribute_id=entry_response.get("attributeId"),
120
+ entry_id=entry_payload.get("id"),
121
+ digital_object_id_list=digital_object_id_list,
122
+ is_unlink=is_unlink,
123
+ )
124
+
125
+ def link_digital_objects(
126
+ self, entry_code: str, digital_object_code_list: list[str], is_unlink: bool = False
127
+ ) -> bool:
128
+ """Link or unlink digital objects to an entry using codes."""
129
+ return self.link_existing_digital_objects(entry_code, digital_object_code_list, is_unlink)
130
+
97
131
  def link_to_entry(self, entry_code: str, digital_object_codes: list[str]) -> None:
98
132
  """Link one or more uploaded digital objects to an entry using their codes."""
99
133
  if not digital_object_codes:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: das-cli
3
- Version: 1.5.17
3
+ Version: 1.5.25
4
4
  Summary: DAS api client.
5
5
  Author: Royal Netherlands Institute for Sea Research
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "das-cli"
7
- version = "1.5.17"
7
+ version = "1.5.25"
8
8
  authors = [
9
9
  { name="Royal Netherlands Institute for Sea Research" },
10
10
  ]
@@ -477,7 +477,7 @@ class TestEntriesManager(unittest.TestCase):
477
477
  "Start Date": "24/02/2025",
478
478
  "End Date": "25/02/2025",
479
479
  "Principal Investigator": "Flavio Francisco",
480
- "MFP ID": "m", # this should be a number and triggers the error
480
+ "MFP ID": "1234567890", # this should be a number and triggers the error
481
481
  "Vessel": "RV Wim Wolff",
482
482
  "Port of Departure": "ICT0022",
483
483
  "Comment": "This is a test of the DAS Python API. Delete later.",
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