das-cli 1.0.4__py3-none-any.whl → 1.2.4__py3-none-any.whl

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.
@@ -0,0 +1,32 @@
1
+ das/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ das/app.py,sha256=kKxN4Vn84SA5Ph3zY13avMG2vrUp-ffpdDkhwYR9Bho,1475
3
+ das/cli.py,sha256=RiometuuRNK4UZm17f7bfej8xhtS2yYufnKXOJsA4jw,50462
4
+ das/ai/plugins/dasai.py,sha256=1P-0q4ReAnmJxliGAPMxR1aij9RWKxyTIHJzWTwLZLo,2459
5
+ das/ai/plugins/entries/entries_plugin.py,sha256=Dhv6PrguQj5mzxBW6DlCzkmwucszazLQfzwlp9EhIGk,608
6
+ das/authentication/auth.py,sha256=DTtH66Ft6nuuMe7EYvrr3GqGVEGGxE7GmD2fO7vRv4s,1501
7
+ das/authentication/secure_input.py,sha256=P-NpbFeHrp2uIOMqip55cGn_NqqpswhnknAF1t7c2_U,1911
8
+ das/common/api.py,sha256=GNY1nF5B8JgFDAGifC2jR2ZTtKt4GLd7W20ARky4wcY,4501
9
+ das/common/config.py,sha256=VQi_tJ7hvIa--gvx9VCBkfVI9p0ptOvifIu08tc8kEs,6127
10
+ das/common/entry_fields_constants.py,sha256=5Yh4Ujt70HEF-FsnwVBPBm3DB3HHzQWSWR-9Upt7C5I,93
11
+ das/common/enums.py,sha256=jS0frv6717duG_wZNockXMTZ-VfsGu_f8_-lgYGnrcY,1745
12
+ das/common/file_utils.py,sha256=-zePjYsj8iRpQssVQMHDK3Mh5q8FooKJCUCKCXKS6_Y,7006
13
+ das/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ das/managers/digital_objects_manager.py,sha256=v7VAYfKoDpmWJGVgpVoSyk6hqGMiQJeOX5rgm65xE5U,3677
15
+ das/managers/download_manager.py,sha256=bZuRX5yoKC_n00Tbjn_aRHgHLeq6SjI0TqDqgjttOQU,5431
16
+ das/managers/entries_manager.py,sha256=UVJdAjLfqPcMYIuOcFH51jhlhd-Y_qHy2u1LDvyCi3E,20523
17
+ das/managers/search_manager.py,sha256=vXf0JmK5oW-xEGUdDnppfc1-6HdH1hfiZR7L2bCz9u0,4263
18
+ das/services/attributes.py,sha256=78E9f1wNZYxG9Hg5HfX_h1CFmACaMjwD2Y6Ilb7PJGY,2616
19
+ das/services/cache.py,sha256=g-vY51gqGV_1Vpza476PkMqGpuDNo1NbTwQWIIsvO0s,1932
20
+ das/services/digital_objects.py,sha256=ww1KHVLNmm_ffzgqP4Jt4wCbHMVfhD2FJWahlSPFaes,4935
21
+ das/services/downloads.py,sha256=cn2eoiKEDRcINlzoLgw6mpN3VVLBBiccdFyuCO7TB2I,3709
22
+ das/services/entries.py,sha256=Dzvzx4wOljfumjBBg4sboXmgDTQf3FNbTQp-sl9hAn0,5755
23
+ das/services/entry_fields.py,sha256=x2wUDkKNduj9pf4s56hRo0UW-eBhipkU9gFMEjFw5DA,1290
24
+ das/services/hangfire.py,sha256=hidmVP9yb4znzBaJJRyKawYx7oYaBv5OVL-t0BhvN_A,818
25
+ das/services/search.py,sha256=3X_KPb9fs024FhxoTr4j-xY5ymm5rvvzlekxuh8tLdg,1374
26
+ das/services/users.py,sha256=iNijO2UPIEtcpPy8Tkemdxxym9rYLCUyckQHIQj68W0,795
27
+ das_cli-1.2.4.dist-info/licenses/LICENSE,sha256=4EDhysVgQWBlzo0rdUl_k89s-iVfgCcSa1gUx1TM1vA,1124
28
+ das_cli-1.2.4.dist-info/METADATA,sha256=SAesRnYIdcNA1LUpbnaLAisw9kzdy-KUNJhH27-xK_4,26209
29
+ das_cli-1.2.4.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
30
+ das_cli-1.2.4.dist-info/entry_points.txt,sha256=ZrdMae7NcvogQhzM1zun8E8n_QwYq-LpZvoJCr2_I4g,36
31
+ das_cli-1.2.4.dist-info/top_level.txt,sha256=OJsPEeJyJ2rJlpEn2DTPgbMSvYG-6FeD13_m5qLpw3E,4
32
+ das_cli-1.2.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,408 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: das-cli
3
- Version: 1.0.4
4
- Summary: DAS api client.
5
- Author: Royal Netherlands Institute for Sea Research
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://git.nioz.nl/ict-projects/das-cli
8
- Project-URL: Bug Tracker, https://git.nioz.nl/ict-projects/das-cli/-/issues
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.9
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE
14
- Requires-Dist: click>=8.2.1
15
- Requires-Dist: requests>=2.32.3
16
- Requires-Dist: python-dotenv>=1.0.0
17
- Provides-Extra: excel
18
- Requires-Dist: pandas>=2.2.3; extra == "excel"
19
- Requires-Dist: openpyxl>=3.1.5; extra == "excel"
20
- Provides-Extra: ai
21
- Requires-Dist: semantic-kernel>=1.37.0; extra == "ai"
22
- Dynamic: license-file
23
-
24
- # DAS Python Client
25
-
26
- A Python library and CLI for interacting with the Data Archive System (DAS) API.
27
-
28
- ## Table of Contents
29
-
30
- - Quickstart
31
- - Installation
32
- - CLI Usage
33
- - Python API
34
- - Configuration
35
- - Examples
36
- - Troubleshooting
37
- - Development
38
- - Contributing
39
- - License
40
-
41
- ## Quickstart
42
-
43
- ```bash
44
- # Install
45
- pip install das-cli
46
-
47
- # Login (prompts for credentials if omitted)
48
- das login --api-url https://your-das-instance/api
49
-
50
- # Search entries
51
- das search entries --attribute Name --query 'name(*core*)' --format table
52
-
53
- # Get an entry
54
- das entry get --code 7b.b.4c
55
- ```
56
-
57
- ## Installation
58
-
59
- ### Requirements
60
-
61
- - Python 3.13 or higher
62
-
63
- ### Install from PyPI
64
-
65
- ```bash
66
- pip install das-cli
67
- ```
68
-
69
- ### Install from Source
70
-
71
- ```bash
72
- git clone https://git.nioz.nl/ict-projects/das-cli.git
73
- cd das-cli
74
- pip install -e .
75
- ```
76
-
77
- ## CLI Usage
78
-
79
- The package installs a `das` executable for interacting with the DAS API.
80
-
81
- ### Authentication
82
-
83
- ```bash
84
- das login --api-url https://your-das-instance/api --username your_username --password your_password
85
- ```
86
-
87
- - Omit `--username`/`--password` to be prompted securely.
88
-
89
- ### Search
90
-
91
- ```bash
92
- das search entries --attribute <AttributeName> --query '<SearchQuery>' \
93
- --max-results 10 --page 1 --sort-by Name --sort-order asc --format table
94
- ```
95
-
96
- Options:
97
-
98
- - `--max-results <n>`: Maximum results per page (default: 10)
99
- - `--page <num>`: Page number (default: 1)
100
- - `--sort-by <field>`: Field to sort by (default: Name)
101
- - `--sort-order <order>`: `asc` or `desc` (default: asc)
102
- - `--format <format>`: `table`, `json`, or `compact` (default: table)
103
- - `--raw`: Print raw API response
104
-
105
- Get a specific entry by ID:
106
-
107
- ```bash
108
- das search entry <ID> --format table
109
- ```
110
-
111
- Help for query syntax:
112
-
113
- ```bash
114
- das search help
115
- ```
116
-
117
- Example queries:
118
-
119
- - Name contains pattern: `name(*pattern*)`
120
- - Multiple conditions: `name(*pattern*);code(*ABC*)`
121
- - Date comparison: `Created at(>2023-01-01)`
122
-
123
- ### Entries
124
-
125
- ```bash
126
- # Get entry by code
127
- das entry get --code CODE
128
-
129
- # Get entry by ID
130
- das entry get --id ID
131
-
132
- # Delete an entry
133
- das entry delete CODE
134
-
135
- # Create entries from file or data
136
- das entry create --attribute <AttributeName> <file_path>
137
- # Examples:
138
- # JSON file (can contain a list of entries)
139
- # das entry create --attribute core c:\data\entries.json
140
- # CSV file (rows become entries)
141
- # das entry create --attribute core c:\data\entries.csv
142
- # Excel file (rows become entries)
143
- # das entry create --attribute core c:\data\entries.xls
144
- # Single entry from data string
145
- # das entry create --attribute core --data { 'Name': 'Entry 1', ... }
146
- # Multiple entries from data string
147
- # das entry create --attribute core --data [{ 'Name': 'Entry 1' }, { 'Name': 'Entry 2' }]
148
-
149
- # Update entries from file or data
150
- das entry update --attribute <AttributeName> [--code CODE] <file_path>
151
- # Notes:
152
- # - For bulk updates, each entry must include a Code field
153
- # - For single updates via --data, you can pass --code or include Code in data
154
- # Examples:
155
- # JSON file (each object must include Code)
156
- # das entry update --attribute core c:\data\entries.json
157
- # CSV file (must have Code column)
158
- # das entry update --attribute core c:\data\entries.csv
159
- # Excel file (must have Code column)
160
- # das entry update --attribute core c:\data\entries.xls
161
- # Single entry with explicit code
162
- # das entry update --attribute core --code ENT001 --data { 'Grant Public Access': Yes }
163
- # Single entry with Code in data
164
- # das entry update --attribute core --data { 'Code': 'ENT001', 'Grant Public Access': Yes }
165
- # Multiple entries from data string (each must include Code)
166
- # das entry update --attribute core --data [{ 'Code': 'ENT001' }, { 'Code': 'ENT002' }]
167
- ```
168
-
169
- ### Hangfire
170
-
171
- ```bash
172
- das hangfire sync-doi ID
173
- ```
174
-
175
- ### Attributes
176
-
177
- ```bash
178
- # By ID
179
- das attribute get --id 123
180
-
181
- # By name
182
- das attribute get --name "temperature"
183
-
184
- # By alias
185
- das attribute get --alias "temp"
186
-
187
- # By table name
188
- das attribute get --table-name "measurements"
189
-
190
- # Converters
191
- das attribute get-name 123
192
- das attribute get-id "temperature"
193
- ```
194
-
195
- ### Cache
196
-
197
- ```bash
198
- das cache list
199
- das cache clear "cache-name"
200
- das cache clear-all
201
- ```
202
-
203
- ### Configuration
204
-
205
- ```bash
206
- # Enable SSL certificate verification (recommended)
207
- das config ssl-verify true
208
-
209
- # Disable SSL certificate verification (development/testing only)
210
- das config ssl-verify false
211
-
212
- # Show current SSL verification status
213
- das config ssl-status
214
-
215
- # Reset all configuration (clears credentials and settings)
216
- das config reset --force
217
- ```
218
-
219
- ## Python API
220
-
221
- ### Basic Usage
222
-
223
- ```python
224
- from das.app import Das
225
-
226
- client = Das("https://your-das-instance/api")
227
-
228
- # Authenticate
229
- token = client.authenticate("username", "password")
230
-
231
- # Entries
232
- entry = client.entries.get_entry("7b.b.4c") # by code
233
- entry = client.entries.get_entry(id=123) # by id
234
- client.entries.delete("7b.b.4c")
235
-
236
- # Search
237
- from das.managers.search_manager import SearchManager
238
- search_manager = SearchManager()
239
- results = search_manager.search_entries(
240
- attribute="Cores",
241
- query="name(*64*)",
242
- max_results=10,
243
- page=1,
244
- sort_by="Name",
245
- sort_order="asc",
246
- )
247
-
248
- # Downloads
249
- from das.managers.download_manager import DownloadManager
250
- download_manager = DownloadManager()
251
-
252
- # Create a download request
253
- request_data = {
254
- 'name': 'My Download Request',
255
- 'ENT001': ['FILE001', 'FILE002'],
256
- 'ENT002': [] # All files from this entry
257
- }
258
- request_id = download_manager.create_download_request(request_data)
259
-
260
- # Delete a download request
261
- download_manager.delete_download_request("6b0e68e6-00cd-43a7-9c51-d56c9c091123")
262
-
263
- # List your download requests
264
- my_requests = download_manager.get_my_requests()
265
-
266
- # Hangfire
267
- client.hangfire.sync_doi("123")
268
-
269
- # Attributes
270
- attribute = client.attributes.get_attribute(id=123)
271
- attribute = client.attributes.get_attribute(name="temperature")
272
- attribute = client.attributes.get_attribute(alias="temp")
273
- attribute = client.attributes.get_attribute(table_name="measurements")
274
- name = client.attributes.get_name(123)
275
- attr_id = client.attributes.get_id("temperature")
276
-
277
- # Cache
278
- cache_entries = client.cache.get_all()
279
- client.cache.clear_cache("cache-name")
280
- client.cache.clear_all()
281
-
282
- # SSL verification
283
- from das.common.config import save_verify_ssl, load_verify_ssl
284
- save_verify_ssl(True) # enable (recommended)
285
- save_verify_ssl(False) # disable (dev/testing)
286
- current_setting = load_verify_ssl()
287
- ```
288
-
289
- ## Configuration
290
-
291
- ### SSL certificate verification
292
-
293
- ```bash
294
- # Enable (default)
295
- das config ssl-verify true
296
-
297
- # Disable (development/testing only)
298
- das config ssl-verify false
299
-
300
- # Check status
301
- das config ssl-status
302
- ```
303
-
304
- ## Downloads
305
-
306
- ```bash
307
- # Create a download request
308
- das download request --entry ENT001 --name "My Download Request"
309
-
310
- # Create a request with specific files
311
- das download request --entry ENT001 --file FILE001 --file FILE002
312
-
313
- # Create a request with multiple entries
314
- das download request --entry ENT001 --entry ENT002 --name "Multiple Entries"
315
-
316
- # Create a request from JSON file
317
- das download request --from-file request.json
318
-
319
- # List your download requests
320
- das download my-requests --format table
321
-
322
- # Delete a download request
323
- das download delete-request 6b0e68e6-00cd-43a7-9c51-d56c9c091123
324
- ```
325
-
326
- ## Examples
327
-
328
- ```bash
329
- # List cache and clear a specific cache
330
- das cache list
331
- das cache clear "attributes"
332
-
333
- # Dump a single entry as JSON
334
- das search entry 123 --format json
335
-
336
- # Paginate through search results
337
- das search entries --attribute Name --query 'name(*core*)' --max-results 50 --page 2
338
-
339
- # List your download requests
340
- das download my-requests --format table
341
-
342
- # Reset all configuration
343
- das config reset --force
344
- ```
345
-
346
- ## Troubleshooting
347
-
348
- - Authentication failed:
349
- - Ensure `--api-url` points to the correct DAS instance base URL (often ends with `/api`).
350
- - Try re-running `das login` without passing password to be prompted.
351
- - SSL certificate errors:
352
- - Use `das config ssl-verify false` temporarily in non-production environments.
353
- - Consider configuring your corporate CA store instead of disabling verification.
354
- - Proxy/network issues:
355
- - Respect environment variables `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` if required.
356
- - Windows PowerShell quoting:
357
- - Prefer single quotes for queries, or escape `*` and `;` as needed (e.g., `\*`).
358
- - Unexpected output formatting:
359
- - Switch format with `--format json` or `--format compact`.
360
-
361
- ## Dependencies
362
-
363
- Runtime and development dependencies are declared in `requirements.txt` and `pyproject.toml`. Install via `pip install das-cli` or `pip install -e .` for development.
364
-
365
- ## Development
366
-
367
- ### Setting Up Development Environment
368
-
369
- ```bash
370
- # Clone the repository
371
- git clone https://git.nioz.nl/ict-projects/das-cli.git
372
- cd das-cli
373
-
374
- # Create and activate a virtual environment
375
- python -m venv venv
376
- .\venv\Scripts\activate # On Windows
377
- source venv/bin/activate # On Unix/macOS
378
-
379
- # Install in editable mode
380
- pip install -e .
381
-
382
- # (Optional) Install dev/test tooling
383
- pip install -e .[dev]
384
- ```
385
-
386
- ### Running Tests
387
-
388
- ```bash
389
- # Run all tests
390
- python run_tests.py
391
-
392
- # Run a specific test file
393
- python -m pytest tests/specific_test_file.py
394
- ```
395
-
396
- ## Contributing
397
-
398
- Contributions are welcome! Please open a Pull Request.
399
-
400
- Report bugs or request features via the [DAS CLI issue tracker](https://git.nioz.nl/ict-projects/das-cli/-/issues).
401
-
402
- ## License
403
-
404
- MIT License
405
-
406
- ## Maintainers
407
-
408
- This project is maintained by the Royal Netherlands Institute for Sea Research (NIOZ).
@@ -1,30 +0,0 @@
1
- das/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- das/app.py,sha256=kKxN4Vn84SA5Ph3zY13avMG2vrUp-ffpdDkhwYR9Bho,1475
3
- das/cli.py,sha256=G1i6S8AF4Bx3ZSb7ba42h7NTxKxpsydrk7IIz26QJpk,45116
4
- das/ai/plugins/dasai.py,sha256=R0X0Vey_GOAtWoqcloB-NATZFtXB_l5b9dfPXocNIbI,2165
5
- das/ai/plugins/entries/entries_plugin.py,sha256=Dhv6PrguQj5mzxBW6DlCzkmwucszazLQfzwlp9EhIGk,608
6
- das/authentication/auth.py,sha256=DTtH66Ft6nuuMe7EYvrr3GqGVEGGxE7GmD2fO7vRv4s,1501
7
- das/authentication/secure_input.py,sha256=P-NpbFeHrp2uIOMqip55cGn_NqqpswhnknAF1t7c2_U,1911
8
- das/common/api.py,sha256=9kuM8Gcw29uiYbqw9fPK4w5gTpWv9baxjK9NvHNeb5E,3905
9
- das/common/config.py,sha256=nkWN4-4xUEo6DPlTkaAnHQF_HGwulm73D4U2DyWvibU,5600
10
- das/common/entry_fields_constants.py,sha256=5Yh4Ujt70HEF-FsnwVBPBm3DB3HHzQWSWR-9Upt7C5I,93
11
- das/common/enums.py,sha256=jS0frv6717duG_wZNockXMTZ-VfsGu_f8_-lgYGnrcY,1745
12
- das/common/file_utils.py,sha256=-zePjYsj8iRpQssVQMHDK3Mh5q8FooKJCUCKCXKS6_Y,7006
13
- das/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- das/managers/download_manager.py,sha256=NqaLhmjw-4nZq8SVdN0g5MAnbMPEnu-A3A4oXxQ-IZQ,3776
15
- das/managers/entries_manager.py,sha256=Kc_PN71Bp7VICrxoP9MiDCrUzR7OdUXfX5puDDxtm08,19015
16
- das/managers/search_manager.py,sha256=6nRHSc2YosVj5NBoFp2uM09FZiMMVfchoXT8Q-b5oNY,3505
17
- das/services/attributes.py,sha256=78E9f1wNZYxG9Hg5HfX_h1CFmACaMjwD2Y6Ilb7PJGY,2616
18
- das/services/cache.py,sha256=g-vY51gqGV_1Vpza476PkMqGpuDNo1NbTwQWIIsvO0s,1932
19
- das/services/downloads.py,sha256=YBDFPmjAQHUK0OUdFprW1Ox81nzpKaJE9xQBJyyEz4Q,3060
20
- das/services/entries.py,sha256=Uspl7LZcNWEnr7ct5_Kn31jMjrkSKV7UXzrN6nb3HF0,4966
21
- das/services/entry_fields.py,sha256=x2wUDkKNduj9pf4s56hRo0UW-eBhipkU9gFMEjFw5DA,1290
22
- das/services/hangfire.py,sha256=hidmVP9yb4znzBaJJRyKawYx7oYaBv5OVL-t0BhvN_A,818
23
- das/services/search.py,sha256=3X_KPb9fs024FhxoTr4j-xY5ymm5rvvzlekxuh8tLdg,1374
24
- das/services/users.py,sha256=iNijO2UPIEtcpPy8Tkemdxxym9rYLCUyckQHIQj68W0,795
25
- das_cli-1.0.4.dist-info/licenses/LICENSE,sha256=4EDhysVgQWBlzo0rdUl_k89s-iVfgCcSa1gUx1TM1vA,1124
26
- das_cli-1.0.4.dist-info/METADATA,sha256=aOev384umltx9O1PaLA-xAx6IRZhERf7fv3t727LRZI,10469
27
- das_cli-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
- das_cli-1.0.4.dist-info/entry_points.txt,sha256=ZrdMae7NcvogQhzM1zun8E8n_QwYq-LpZvoJCr2_I4g,36
29
- das_cli-1.0.4.dist-info/top_level.txt,sha256=OJsPEeJyJ2rJlpEn2DTPgbMSvYG-6FeD13_m5qLpw3E,4
30
- das_cli-1.0.4.dist-info/RECORD,,