das-cli 1.2.24__tar.gz → 1.2.27__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 (47) hide show
  1. {das_cli-1.2.24 → das_cli-1.2.27}/PKG-INFO +85 -1
  2. das_cli-1.2.24/das_cli.egg-info/PKG-INFO → das_cli-1.2.27/README.md +1137 -1076
  3. {das_cli-1.2.24 → das_cli-1.2.27}/das/cli.py +1317 -1317
  4. {das_cli-1.2.24 → das_cli-1.2.27}/das/common/api.py +4 -4
  5. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/downloads.py +100 -100
  6. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/entries.py +16 -8
  7. das_cli-1.2.24/README.md → das_cli-1.2.27/das_cli.egg-info/PKG-INFO +107 -0
  8. {das_cli-1.2.24 → das_cli-1.2.27}/das_cli.egg-info/SOURCES.txt +10 -1
  9. {das_cli-1.2.24 → das_cli-1.2.27}/pyproject.toml +1 -1
  10. das_cli-1.2.27/tests/__init__.py +3 -0
  11. das_cli-1.2.27/tests/attributes_test.py +77 -0
  12. das_cli-1.2.27/tests/download_manager_test.py +34 -0
  13. das_cli-1.2.27/tests/entries_manager_test.py +425 -0
  14. das_cli-1.2.27/tests/entries_service_test.py +270 -0
  15. das_cli-1.2.27/tests/entries_test.py +37 -0
  16. das_cli-1.2.27/tests/file_utils_test.py +115 -0
  17. das_cli-1.2.27/tests/run_tests.py +18 -0
  18. das_cli-1.2.27/tests/search_manager_test.py +49 -0
  19. {das_cli-1.2.24 → das_cli-1.2.27}/LICENSE +0 -0
  20. {das_cli-1.2.24 → das_cli-1.2.27}/MANIFEST.in +0 -0
  21. {das_cli-1.2.24 → das_cli-1.2.27}/das/__init__.py +0 -0
  22. {das_cli-1.2.24 → das_cli-1.2.27}/das/ai/plugins/dasai.py +0 -0
  23. {das_cli-1.2.24 → das_cli-1.2.27}/das/ai/plugins/entries/entries_plugin.py +0 -0
  24. {das_cli-1.2.24 → das_cli-1.2.27}/das/app.py +0 -0
  25. {das_cli-1.2.24 → das_cli-1.2.27}/das/authentication/auth.py +0 -0
  26. {das_cli-1.2.24 → das_cli-1.2.27}/das/authentication/secure_input.py +0 -0
  27. {das_cli-1.2.24 → das_cli-1.2.27}/das/common/config.py +0 -0
  28. {das_cli-1.2.24 → das_cli-1.2.27}/das/common/entry_fields_constants.py +0 -0
  29. {das_cli-1.2.24 → das_cli-1.2.27}/das/common/enums.py +0 -0
  30. {das_cli-1.2.24 → das_cli-1.2.27}/das/common/file_utils.py +0 -0
  31. {das_cli-1.2.24 → das_cli-1.2.27}/das/managers/__init__.py +0 -0
  32. {das_cli-1.2.24 → das_cli-1.2.27}/das/managers/digital_objects_manager.py +0 -0
  33. {das_cli-1.2.24 → das_cli-1.2.27}/das/managers/download_manager.py +0 -0
  34. {das_cli-1.2.24 → das_cli-1.2.27}/das/managers/entries_manager.py +0 -0
  35. {das_cli-1.2.24 → das_cli-1.2.27}/das/managers/search_manager.py +0 -0
  36. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/attributes.py +0 -0
  37. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/cache.py +0 -0
  38. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/digital_objects.py +0 -0
  39. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/entry_fields.py +0 -0
  40. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/hangfire.py +0 -0
  41. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/search.py +0 -0
  42. {das_cli-1.2.24 → das_cli-1.2.27}/das/services/users.py +0 -0
  43. {das_cli-1.2.24 → das_cli-1.2.27}/das_cli.egg-info/dependency_links.txt +0 -0
  44. {das_cli-1.2.24 → das_cli-1.2.27}/das_cli.egg-info/entry_points.txt +0 -0
  45. {das_cli-1.2.24 → das_cli-1.2.27}/das_cli.egg-info/requires.txt +0 -0
  46. {das_cli-1.2.24 → das_cli-1.2.27}/das_cli.egg-info/top_level.txt +0 -0
  47. {das_cli-1.2.24 → das_cli-1.2.27}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: das-cli
3
- Version: 1.2.24
3
+ Version: 1.2.27
4
4
  Summary: DAS api client.
5
5
  Author: Royal Netherlands Institute for Sea Research
6
6
  License-Expression: MIT
@@ -74,6 +74,14 @@ cd das-cli
74
74
  pip install -e .
75
75
  ```
76
76
 
77
+ ### Upgrade
78
+
79
+ To upgrade to the latest version of das-cli:
80
+
81
+ ```bash
82
+ pip install --upgrade das-cli
83
+ ```
84
+
77
85
  ## CLI Usage
78
86
 
79
87
  The package installs a `das` executable for interacting with the DAS API.
@@ -261,6 +269,41 @@ das ai logout [--force]
261
269
 
262
270
  The DAS CLI provides three layers of interaction: CLI commands, Manager layer, and Service layer. Below are examples for each command showing usage at all three layers.
263
271
 
272
+ ### Login
273
+
274
+ Before using the Python API (e.g. `EntryManager`, `SearchManager`, `DownloadManager`), you must authenticate. The managers read the API URL and token from the stored configuration.
275
+
276
+ **Option 1 – Login via CLI first (recommended):**
277
+
278
+ ```bash
279
+ das login --api-url https://your-das-instance/api --username your_username --password your_password
280
+ # Or omit --username/--password to be prompted securely
281
+ ```
282
+
283
+ Then in Python:
284
+
285
+ ```python
286
+ from das.managers.entries_manager import EntryManager
287
+
288
+ entry_manager = EntryManager()
289
+ entry = entry_manager.get(code="7b.b.4c")
290
+ ```
291
+
292
+ **Option 2 – Login programmatically with `Das`:**
293
+
294
+ ```python
295
+ from das.app import Das
296
+ from das.managers.entries_manager import EntryManager
297
+
298
+ # Authenticate and store credentials
299
+ client = Das("https://your-das-instance/api")
300
+ client.authenticate("your_username", "your_password")
301
+
302
+ # Now EntryManager (and other managers) can use the stored config
303
+ entry_manager = EntryManager()
304
+ entry = entry_manager.get(code="7b.b.4c")
305
+ ```
306
+
264
307
  ### Entries
265
308
 
266
309
  #### Get Entry
@@ -960,6 +1003,47 @@ das config ssl-verify false
960
1003
  das config ssl-status
961
1004
  ```
962
1005
 
1006
+ ### Environment variables
1007
+
1008
+ You can use a `.env` file in the project root (or current directory) for local configuration. Copy `.env.example` to `.env` and fill in the values:
1009
+
1010
+ ```bash
1011
+ cp .env.example .env
1012
+ ```
1013
+
1014
+ Example `.env` (based on `.env.example`):
1015
+
1016
+ ```env
1017
+ # DAS API credentials (used by tests and scripts; CLI uses `das login` for interactive use)
1018
+ USER_NAME=
1019
+ USER_PASSWORD=
1020
+
1021
+ # DAS API base URL (e.g. https://api.das-dev.nioz.nl or https://localhost:44301)
1022
+ API_URL=
1023
+
1024
+ # PyPI/Twine credentials for publishing packages (deploy.ps1, etc.)
1025
+ TWINE_USERNAME=__token__
1026
+ TWINE_PASSWORD=
1027
+
1028
+ # Enable or disable SSL certificate verification (True/False). Overrides config when set.
1029
+ VERIFY_SSL=
1030
+
1031
+ # OpenAI model ID for the AI feature (e.g. gpt-4, gpt-4o-mini). Used by `das ai enable`.
1032
+ OPEN_AI_MODEL_ID=
1033
+ ```
1034
+
1035
+ | Variable | Description |
1036
+ |----------|-------------|
1037
+ | `USER_NAME` | DAS username. Used by tests and scripts for authentication. The CLI typically uses `das login` instead. |
1038
+ | `USER_PASSWORD` | DAS password. Used by tests and scripts. Never commit this to version control. |
1039
+ | `API_URL` | DAS API base URL (e.g. `https://api.das-dev.nioz.nl` or `https://localhost:44301`). Used by tests, scripts, and when no URL is stored via `das login`. |
1040
+ | `TWINE_USERNAME` | PyPI/Twine username. Use `__token__` when publishing with an API token. |
1041
+ | `TWINE_PASSWORD` | PyPI/Twine password or API token. Used by `deploy.ps1` when publishing packages. |
1042
+ | `VERIFY_SSL` | Set to `True` or `False` to control SSL certificate verification. Overrides the value from `das config ssl-verify` when set. |
1043
+ | `OPEN_AI_MODEL_ID` | OpenAI model ID (e.g. `gpt-4`, `gpt-4o-mini`). Used by the AI feature (`das ai enable`). |
1044
+
1045
+ **Note:** The `.env` file is gitignored. Do not commit credentials.
1046
+
963
1047
  ## Downloads
964
1048
 
965
1049
  ```bash