das-cli 1.5.19__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.
- {das_cli-1.5.19/das_cli.egg-info → das_cli-1.5.25}/PKG-INFO +1 -1
- {das_cli-1.5.19 → das_cli-1.5.25}/das/managers/digital_objects_manager.py +34 -0
- {das_cli-1.5.19 → das_cli-1.5.25/das_cli.egg-info}/PKG-INFO +1 -1
- {das_cli-1.5.19 → das_cli-1.5.25}/pyproject.toml +1 -1
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/entries_manager_test.py +1 -1
- {das_cli-1.5.19 → das_cli-1.5.25}/LICENSE +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/MANIFEST.in +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/README.md +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/__init__.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/ai/plugins/dasai.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/ai/plugins/entries/entries_plugin.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/app.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/authentication/auth.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/authentication/oauth.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/authentication/secure_input.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/cli.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/common/api.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/common/config.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/common/entry_fields_constants.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/common/enums.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/common/file_utils.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/managers/__init__.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/managers/download_manager.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/managers/entries_manager.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/managers/search_manager.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/attributes.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/cache.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/das_elastic_search.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/digital_objects.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/downloads.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/entries.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/entry_fields.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/hangfire.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/search.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/service_base.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das/services/users.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das_cli.egg-info/SOURCES.txt +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das_cli.egg-info/dependency_links.txt +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das_cli.egg-info/entry_points.txt +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das_cli.egg-info/requires.txt +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/das_cli.egg-info/top_level.txt +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/setup.cfg +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/__init__.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/attributes_test.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/download_manager_test.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/entries_service_test.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/entries_test.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/file_utils_test.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/run_tests.py +0 -0
- {das_cli-1.5.19 → das_cli-1.5.25}/tests/search_manager_test.py +0 -0
|
@@ -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:
|
|
@@ -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": "
|
|
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
|
|
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
|