deriva 1.7.6__tar.gz → 1.7.8__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.
- {deriva-1.7.6/deriva.egg-info → deriva-1.7.8}/PKG-INFO +1 -2
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/__init__.py +1 -1
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/base_cli.py +5 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/hatrac_store.py +6 -1
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/__init__.py +2 -2
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/deriva_download.py +5 -10
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/deriva_export.py +20 -8
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/query/base_query_processor.py +5 -6
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/query/file_download_query_processor.py +1 -2
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/deriva_upload.py +15 -9
- {deriva-1.7.6 → deriva-1.7.8/deriva.egg-info}/PKG-INFO +1 -2
- {deriva-1.7.6 → deriva-1.7.8}/deriva.egg-info/requires.txt +0 -1
- {deriva-1.7.6 → deriva-1.7.8}/setup.py +0 -1
- {deriva-1.7.6 → deriva-1.7.8}/.gitignore +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/CHANGELOG.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/LICENSE +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/README.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/acl_config.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/annotation_config.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/annotation_validate.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/base_config.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/dump_catalog_annotations.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/examples/group_owner_policy.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/examples/self_serve_policy.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/config/rollback_annotation.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/annotation.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/catalog_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/datapath.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/deriva_binding.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/deriva_server.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/ermrest_catalog.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/ermrest_model.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/hatrac_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/mmo.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/polling_ermrest_catalog.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/app_links.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/asset.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/bulk_upload.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/chaise_config.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/citation.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/column_display.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/display.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/export.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/export_2019.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/foreign_key.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/generated.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/immutable.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/indexing_preferences.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/key_display.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/non_deletable.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/required.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/source_definitions.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/table_alternatives.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/table_display.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/visible_columns.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/schemas/visible_foreign_keys.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/tests/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/utils/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/utils/core_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/utils/globus_auth_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/utils/hash_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/utils/mime_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/utils/version_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/core/utils/webauthn_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/seo/README.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/seo/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/seo/sitemap_builder.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/seo/sitemap_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/backup/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/backup/__main__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/backup/deriva_backup.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/backup/deriva_backup_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/__main__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/deriva_download_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/base_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/postprocess/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/postprocess/identifier_post_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/postprocess/transfer_post_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/postprocess/url_post_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/query/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/query/bag_fetch_query_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/transform/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/transform/base_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/transform/column_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/transform/fasta_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/transform/format_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/transform/geo_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/transform/string_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test1.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test10.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test11.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test12.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test13.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test14.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test15.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test16.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test19.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test2.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test20.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test3.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test4.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test5.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test6.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test7.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test8.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/tests/test9.json +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/restore/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/restore/__main__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/restore/deriva_restore.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/restore/deriva_restore_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/__main__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/deriva_upload_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/processors/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/processors/archive_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/processors/base_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/processors/logging_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/processors/metadata_update_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/processors/rename_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/tests/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva/utils/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva.egg-info/SOURCES.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva.egg-info/dependency_links.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva.egg-info/entry_points.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/deriva.egg-info/top_level.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/BUILD.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/Makefile +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/README.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/_static/README.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.config.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.core.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.core.utils.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.seo.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.backup.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.download.processors.postprocess.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.download.processors.query.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.download.processors.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.download.processors.transform.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.download.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.restore.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/api/deriva.transfer.upload.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/commands.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/deriva-acl-config.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/deriva-annotation-config.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/deriva-annotation-validate.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/deriva-backup-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/deriva-download-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/deriva-hatrac-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/deriva-restore-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/cli/deriva-sitemap-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/conf.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/derivapy-catalog-snapshot.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/derivapy-catalog.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/derivapy-datapath-example-1.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/derivapy-datapath-example-2.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/derivapy-datapath-example-3.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/derivapy-datapath-example-4.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/derivapy-datapath-update.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/get-started.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/index.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/install.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/make.bat +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/project-tutorial.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/docs/using-r.md +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/requirements_dev.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/setup.cfg +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/mmo/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/mmo/base.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/mmo/test_mmo_drop.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/mmo/test_mmo_find.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/mmo/test_mmo_prune.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/mmo/test_mmo_rename.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/mmo/test_mmo_replace.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/test_datapath.py +0 -0
- {deriva-1.7.6 → deriva-1.7.8}/tests/deriva/core/test_ermrest_model.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: deriva
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.8
|
|
4
4
|
Summary: Python APIs and CLIs (Command-Line Interfaces) for the DERIVA platform.
|
|
5
5
|
Home-page: https://github.com/informatics-isi-edu/deriva-py
|
|
6
6
|
Author: USC Information Sciences Institute, Informatics Systems Research Division
|
|
@@ -25,7 +25,6 @@ Description-Content-Type: text/markdown
|
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
Requires-Dist: packaging
|
|
27
27
|
Requires-Dist: requests
|
|
28
|
-
Requires-Dist: certifi
|
|
29
28
|
Requires-Dist: pika
|
|
30
29
|
Requires-Dist: urllib3<3,>=1.26
|
|
31
30
|
Requires-Dist: portalocker>=1.2.1
|
|
@@ -53,6 +53,11 @@ class BaseCLI(object):
|
|
|
53
53
|
|
|
54
54
|
return args
|
|
55
55
|
|
|
56
|
+
# Function to convert comma-separated CLI input into a tuple
|
|
57
|
+
@staticmethod
|
|
58
|
+
def parse_tuple(value):
|
|
59
|
+
# Split the input by commas and convert to a tuple
|
|
60
|
+
return tuple(map(float, value.split(',')))
|
|
56
61
|
|
|
57
62
|
class KeyValuePairArgs(argparse.Action):
|
|
58
63
|
def __init__(self, option_strings, dest, nargs=None, **kwargs):
|
|
@@ -184,6 +184,7 @@ class HatracStore(DerivaBinding):
|
|
|
184
184
|
|
|
185
185
|
headers = headers.copy()
|
|
186
186
|
|
|
187
|
+
file_opened = False
|
|
187
188
|
if hasattr(data, 'read') and hasattr(data, 'seek'):
|
|
188
189
|
data.seek(0, os.SEEK_END)
|
|
189
190
|
file_size = data.tell()
|
|
@@ -192,6 +193,7 @@ class HatracStore(DerivaBinding):
|
|
|
192
193
|
else:
|
|
193
194
|
file_size = os.path.getsize(data)
|
|
194
195
|
f = open(data, 'rb')
|
|
196
|
+
file_opened = True
|
|
195
197
|
|
|
196
198
|
if not (md5 or sha256):
|
|
197
199
|
md5 = hu.compute_hashes(f, hashes=['md5'])['md5'][1]
|
|
@@ -208,7 +210,8 @@ class HatracStore(DerivaBinding):
|
|
|
208
210
|
if (md5 and r.headers.get('Content-MD5') == md5 or
|
|
209
211
|
sha256 and r.headers.get('Content-SHA256') == sha256):
|
|
210
212
|
# object already has same content so skip upload
|
|
211
|
-
|
|
213
|
+
if file_opened:
|
|
214
|
+
f.close()
|
|
212
215
|
return r.headers.get('Content-Location')
|
|
213
216
|
elif not allow_versioning:
|
|
214
217
|
raise NotModified("The data cannot be uploaded because content already exists for this object "
|
|
@@ -232,6 +235,8 @@ class HatracStore(DerivaBinding):
|
|
|
232
235
|
url = '%s%s' % (url.rstrip("/") if url.endswith("/") else url,
|
|
233
236
|
"" if not parents else "?parents=%s" % str(parents).lower())
|
|
234
237
|
r = self._session.put(url, data=f, headers=headers)
|
|
238
|
+
if file_opened:
|
|
239
|
+
f.close()
|
|
235
240
|
self._response_raise_for_status(r)
|
|
236
241
|
loc = r.text.strip() or r.url
|
|
237
242
|
if loc.startswith(self._server_uri):
|
|
@@ -4,8 +4,8 @@ from deriva.transfer.download.deriva_download import DerivaDownload, GenericDown
|
|
|
4
4
|
from deriva.transfer.download.deriva_download_cli import DerivaDownloadCLI
|
|
5
5
|
from deriva.transfer.download.deriva_export import DerivaExport, DerivaExportCLI
|
|
6
6
|
|
|
7
|
-
from deriva.transfer.upload.deriva_upload import DerivaUpload, GenericUploader,
|
|
8
|
-
DerivaUploadConfigurationError, DerivaUploadCatalogCreateError, DerivaUploadCatalogUpdateError, \
|
|
7
|
+
from deriva.transfer.upload.deriva_upload import DerivaUpload, GenericUploader, UploadState, DerivaUploadError, \
|
|
8
|
+
DerivaUploadError, DerivaUploadConfigurationError, DerivaUploadCatalogCreateError, DerivaUploadCatalogUpdateError, \
|
|
9
9
|
DerivaUploadAuthenticationError
|
|
10
10
|
from deriva.transfer.upload.deriva_upload_cli import DerivaUploadCLI
|
|
11
11
|
|
|
@@ -8,8 +8,8 @@ import requests
|
|
|
8
8
|
from requests.exceptions import HTTPError
|
|
9
9
|
from bdbag import bdbag_api as bdb, bdbag_ro as ro, BAG_PROFILE_TAG, BDBAG_RO_PROFILE_ID
|
|
10
10
|
from bdbag.bdbagit import BagValidationError
|
|
11
|
-
from deriva.core import ErmrestCatalog, HatracStore, format_exception, get_credential,
|
|
12
|
-
|
|
11
|
+
from deriva.core import DerivaServer, ErmrestCatalog, HatracStore, format_exception, get_credential, \
|
|
12
|
+
format_credential, read_config, stob, Megabyte, __version__ as VERSION
|
|
13
13
|
from deriva.core.utils.version_utils import get_installed_version
|
|
14
14
|
from deriva.transfer.download.processors import find_query_processor, find_transform_processor, find_post_processor
|
|
15
15
|
from deriva.transfer.download.processors.base_processor import LOCAL_PATH_KEY, REMOTE_PATHS_KEY, SERVICE_URL_KEY, \
|
|
@@ -76,14 +76,9 @@ class DerivaDownload(object):
|
|
|
76
76
|
password=password)
|
|
77
77
|
|
|
78
78
|
# catalog and file store initialization
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
self.
|
|
82
|
-
protocol, self.hostname, catalog_id, self.credentials, session_config=session_config)
|
|
83
|
-
if self.store:
|
|
84
|
-
del self.store
|
|
85
|
-
self.store = HatracStore(
|
|
86
|
-
protocol, self.hostname, self.credentials, session_config=session_config)
|
|
79
|
+
server = DerivaServer(protocol, self.hostname, credentials=self.credentials, session_config=session_config)
|
|
80
|
+
self.catalog = server.connect_ermrest(catalog_id)
|
|
81
|
+
self.store = HatracStore(protocol, self.hostname, self.credentials, session_config=session_config)
|
|
87
82
|
|
|
88
83
|
# init dcctx cid
|
|
89
84
|
self.set_dcctx_cid(kwargs.get("dcctx_cid", "api/" + self.__class__.__name__))
|
|
@@ -5,7 +5,6 @@ import traceback
|
|
|
5
5
|
import requests
|
|
6
6
|
import argparse
|
|
7
7
|
import logging
|
|
8
|
-
import certifi
|
|
9
8
|
import datetime
|
|
10
9
|
from collections.abc import Mapping, Iterable
|
|
11
10
|
from requests.exceptions import HTTPError, ConnectionError, Timeout
|
|
@@ -29,7 +28,8 @@ Client tool for interacting with DERIVA Export service.
|
|
|
29
28
|
:param envars (dict): A dictionary of variables used for template substitution. Optional.
|
|
30
29
|
:param output_dir (str): The directory where exported data will be stored (default: "."). Optional.
|
|
31
30
|
:param defer_download (bool): Whether to defer the actual data download. Optional.
|
|
32
|
-
:param timeout (
|
|
31
|
+
:param timeout (tuple) OR (float): Timeout value as a tuple of floats in seconds for (connect,read) export operations.
|
|
32
|
+
If a single float value is passed, it will apply to both connect and read operations. Optional.
|
|
33
33
|
:param export_type (str): The type of export to perform (default: "bdbag"). Optional.
|
|
34
34
|
|
|
35
35
|
:return: The full path to the downloaded file. If "defer_download" is True, the URL(s) where the export can be downloaded.
|
|
@@ -47,10 +47,20 @@ class DerivaExport:
|
|
|
47
47
|
self.base_server_uri = "https://" + self.host
|
|
48
48
|
self.service_url = self.base_server_uri + EXPORT_SERVICE_PATH % self.export_type
|
|
49
49
|
self.session_config = DEFAULT_SESSION_CONFIG.copy()
|
|
50
|
-
if self.timeout
|
|
51
|
-
self.
|
|
50
|
+
if isinstance(self.timeout, tuple):
|
|
51
|
+
if len(self.timeout) == 2:
|
|
52
|
+
self.session_config["timeout"] = self.timeout
|
|
53
|
+
else:
|
|
54
|
+
self.session_config["timeout"] = float(self.timeout[0])
|
|
55
|
+
elif self.timeout is not None:
|
|
56
|
+
try:
|
|
57
|
+
self.session_config["timeout"] = float(self.timeout)
|
|
58
|
+
except ValueError:
|
|
59
|
+
logger.warning("Unparseable timeout value: %r. Defaults will be used: %r." %
|
|
60
|
+
(self.timeout, self.session_config["timeout"]))
|
|
52
61
|
self.session = get_new_requests_session(self.service_url, self.session_config)
|
|
53
62
|
self.dcctx = DerivaClientContext()
|
|
63
|
+
self.dcctx['cid'] = kwargs.get("dcctx_cid", "api/" + self.__class__.__name__)
|
|
54
64
|
self.session.headers.update({'deriva-client-context': self.dcctx.encoded()})
|
|
55
65
|
|
|
56
66
|
# credential initialization
|
|
@@ -114,7 +124,7 @@ class DerivaExport:
|
|
|
114
124
|
|
|
115
125
|
filename = parse_content_disposition(content_disposition)
|
|
116
126
|
output_path = os.path.abspath(os.path.join(self.output_dir, filename))
|
|
117
|
-
with self.session.get(url, stream=True
|
|
127
|
+
with self.session.get(url, stream=True) as r:
|
|
118
128
|
if r.status_code != 200:
|
|
119
129
|
file_error = "File [%s] transfer failed." % output_path
|
|
120
130
|
url_error = 'HTTP GET Failed for url: %s' % url
|
|
@@ -190,8 +200,10 @@ class DerivaExportCLI(BaseCLI):
|
|
|
190
200
|
BaseCLI.__init__(self, description, epilog, **kwargs)
|
|
191
201
|
self.parser.add_argument("--defer-download", action="store_true",
|
|
192
202
|
help="Do not download exported file(s). Default: False")
|
|
193
|
-
self.parser.add_argument("--timeout", metavar="<
|
|
194
|
-
help="
|
|
203
|
+
self.parser.add_argument("--timeout", metavar="<connect,read>", type=BaseCLI.parse_tuple,
|
|
204
|
+
help="Timeout value(s) in seconds (int or float) for connect and read operations. "
|
|
205
|
+
"Separate using commas. If a single value is provided it will be used for both "
|
|
206
|
+
"connect and read timeouts.")
|
|
195
207
|
self.parser.add_argument("--export-type", choices=["bdbag", "file"], default="bdbag",
|
|
196
208
|
help="Export type: {bdbag|file}. Default is bdbag.",)
|
|
197
209
|
self.parser.add_argument("--output-dir", metavar="<output dir>", default=".",
|
|
@@ -212,7 +224,7 @@ class DerivaExportCLI(BaseCLI):
|
|
|
212
224
|
sys.stderr.write("\n")
|
|
213
225
|
|
|
214
226
|
try:
|
|
215
|
-
exporter = DerivaExport(**vars(args))
|
|
227
|
+
exporter = DerivaExport(**vars(args), dcctx_cid="cli/" + self.__class__.__name__)
|
|
216
228
|
exporter.export()
|
|
217
229
|
except (DerivaDownloadError, DerivaDownloadConfigurationError, DerivaDownloadAuthenticationError,
|
|
218
230
|
DerivaDownloadAuthorizationError, DerivaDownloadTimeoutError) as e:
|
{deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/query/base_query_processor.py
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import errno
|
|
3
|
-
import certifi
|
|
4
3
|
import requests
|
|
5
|
-
from deriva.core import urlsplit, get_new_requests_session, stob, make_dirs, DEFAULT_SESSION_CONFIG
|
|
4
|
+
from deriva.core import urlsplit, get_new_requests_session, stob, make_dirs, format_exception, DEFAULT_SESSION_CONFIG
|
|
6
5
|
from deriva.transfer.download import DerivaDownloadError, DerivaDownloadConfigurationError, \
|
|
7
6
|
DerivaDownloadAuthenticationError, DerivaDownloadAuthorizationError
|
|
8
7
|
from deriva.transfer.download.processors.base_processor import BaseProcessor, \
|
|
@@ -83,12 +82,12 @@ class BaseQueryProcessor(BaseProcessor):
|
|
|
83
82
|
return self.catalog.get(self.query, headers=headers).json()
|
|
84
83
|
except requests.HTTPError as e:
|
|
85
84
|
if e.response.status_code == 401:
|
|
86
|
-
raise DerivaDownloadAuthenticationError(e)
|
|
85
|
+
raise DerivaDownloadAuthenticationError(format_exception(e))
|
|
87
86
|
if e.response.status_code == 403:
|
|
88
|
-
raise DerivaDownloadAuthorizationError(e)
|
|
87
|
+
raise DerivaDownloadAuthorizationError(format_exception(e))
|
|
89
88
|
if as_file:
|
|
90
89
|
os.remove(self.output_abspath)
|
|
91
|
-
raise DerivaDownloadError("Error executing catalog query: %s" % e)
|
|
90
|
+
raise DerivaDownloadError("Error executing catalog query: %s" % format_exception(e))
|
|
92
91
|
except Exception:
|
|
93
92
|
if as_file:
|
|
94
93
|
os.remove(self.output_abspath)
|
|
@@ -162,7 +161,7 @@ class BaseQueryProcessor(BaseProcessor):
|
|
|
162
161
|
if cookies:
|
|
163
162
|
session.cookies.update(cookies)
|
|
164
163
|
if login_params and auth_url:
|
|
165
|
-
r = session.post(auth_url, data=login_params
|
|
164
|
+
r = session.post(auth_url, data=login_params)
|
|
166
165
|
if r.status_code > 203:
|
|
167
166
|
raise DerivaDownloadError(
|
|
168
167
|
'GetExternalSession Failed with Status Code: %s\n%s\n' % (r.status_code, r.text))
|
|
@@ -4,7 +4,6 @@ import uuid
|
|
|
4
4
|
import datetime
|
|
5
5
|
import logging
|
|
6
6
|
import requests
|
|
7
|
-
import certifi
|
|
8
7
|
from bdbag import bdbag_ro as ro
|
|
9
8
|
from deriva.core import urlsplit, format_exception, get_transfer_summary, make_dirs, DEFAULT_CHUNK_SIZE
|
|
10
9
|
from deriva.core.utils.mime_utils import parse_content_disposition
|
|
@@ -39,7 +38,7 @@ class FileDownloadQueryProcessor(BaseQueryProcessor):
|
|
|
39
38
|
else:
|
|
40
39
|
headers.update(self.HEADERS)
|
|
41
40
|
session = self.getExternalSession(host)
|
|
42
|
-
with session.get(url, headers=headers, stream=True
|
|
41
|
+
with session.get(url, headers=headers, stream=True) as r:
|
|
43
42
|
if r.status_code != 200:
|
|
44
43
|
file_error = "File [%s] transfer failed." % output_path
|
|
45
44
|
url_error = 'HTTP GET Failed for url: %s' % url
|
|
@@ -157,8 +157,12 @@ class DerivaUpload(object):
|
|
|
157
157
|
|
|
158
158
|
# determine identity
|
|
159
159
|
if self.credentials:
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
try:
|
|
161
|
+
attributes = self.catalog.get_authn_session().json()
|
|
162
|
+
self.identity = attributes.get("client", self.identity)
|
|
163
|
+
except Exception as e:
|
|
164
|
+
# not a big deal since the credential token being used could be expired
|
|
165
|
+
logger.debug("Unable to determine user identity from existing credential (may be expired): %s" % e)
|
|
162
166
|
|
|
163
167
|
# init dcctx cid to a default
|
|
164
168
|
self.set_dcctx_cid(self.dcctx_cid)
|
|
@@ -342,7 +346,7 @@ class DerivaUpload(object):
|
|
|
342
346
|
return '%s:%s' % (urlquote(schema_name), urlquote(table_name))
|
|
343
347
|
|
|
344
348
|
@staticmethod
|
|
345
|
-
def interpolateDict(src, dst,
|
|
349
|
+
def interpolateDict(src, dst, allow_none=False, allow_none_column_list=[]):
|
|
346
350
|
if not (isinstance(src, dict) and isinstance(dst, dict)):
|
|
347
351
|
raise ValueError("Invalid input parameter type(s): (src = %s, dst = %s), expected (dict, dict)" % (
|
|
348
352
|
type(src).__name__, type(dst).__name__))
|
|
@@ -362,10 +366,10 @@ class DerivaUpload(object):
|
|
|
362
366
|
if value.startswith('{') and value.endswith('}'):
|
|
363
367
|
value = None
|
|
364
368
|
dst.update({k: value})
|
|
365
|
-
# remove all None valued entries in the dest, if disallowed
|
|
366
|
-
if
|
|
367
|
-
|
|
368
|
-
|
|
369
|
+
# remove all None valued entries in the dest, if globally disallowed or the column is not explicitly allowed
|
|
370
|
+
empty = [k for k, v in dst.items() if v is None]
|
|
371
|
+
for k in empty:
|
|
372
|
+
if not allow_none or (allow_none and k not in allow_none_column_list):
|
|
369
373
|
del dst[k]
|
|
370
374
|
|
|
371
375
|
return dst
|
|
@@ -720,7 +724,9 @@ class DerivaUpload(object):
|
|
|
720
724
|
|
|
721
725
|
# 8. Update an existing record, if necessary
|
|
722
726
|
column_map = asset_mapping.get("column_map", {})
|
|
723
|
-
|
|
727
|
+
allow_none_col_list = asset_mapping.get("allow_empty_columns_on_update", [])
|
|
728
|
+
allow_none = True if allow_none_col_list else False
|
|
729
|
+
updated_record = self.interpolateDict(self.metadata, column_map, allow_none, allow_none_col_list)
|
|
724
730
|
if updated_record != record:
|
|
725
731
|
record_update_template = asset_mapping.get("record_update_template")
|
|
726
732
|
require_record_update_template = stob(asset_mapping.get("require_record_update_template", False))
|
|
@@ -794,7 +800,7 @@ class DerivaUpload(object):
|
|
|
794
800
|
if result:
|
|
795
801
|
record = result[0]
|
|
796
802
|
self._updateFileMetadata(record)
|
|
797
|
-
return self.interpolateDict(self.metadata, column_map,
|
|
803
|
+
return self.interpolateDict(self.metadata, column_map, allow_none=True), record
|
|
798
804
|
|
|
799
805
|
def _urlEncodeMetadata(self, safe_overrides=None):
|
|
800
806
|
urlencoded = dict()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: deriva
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.8
|
|
4
4
|
Summary: Python APIs and CLIs (Command-Line Interfaces) for the DERIVA platform.
|
|
5
5
|
Home-page: https://github.com/informatics-isi-edu/deriva-py
|
|
6
6
|
Author: USC Information Sciences Institute, Informatics Systems Research Division
|
|
@@ -25,7 +25,6 @@ Description-Content-Type: text/markdown
|
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
Requires-Dist: packaging
|
|
27
27
|
Requires-Dist: requests
|
|
28
|
-
Requires-Dist: certifi
|
|
29
28
|
Requires-Dist: pika
|
|
30
29
|
Requires-Dist: urllib3<3,>=1.26
|
|
31
30
|
Requires-Dist: portalocker>=1.2.1
|
|
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
|
|
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
|
{deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/postprocess/url_post_processor.py
RENAMED
|
File without changes
|
|
File without changes
|
{deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/download/processors/query/bag_fetch_query_processor.py
RENAMED
|
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
|
{deriva-1.7.6 → deriva-1.7.8}/deriva/transfer/upload/processors/metadata_update_processor.py
RENAMED
|
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
|
|
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
|