deriva 1.7.6__tar.gz → 1.7.7__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.7}/PKG-INFO +1 -1
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/__init__.py +1 -1
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/base_cli.py +5 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/hatrac_store.py +6 -1
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/deriva_download.py +5 -10
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/deriva_export.py +19 -6
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/query/base_query_processor.py +4 -4
- {deriva-1.7.6 → deriva-1.7.7/deriva.egg-info}/PKG-INFO +1 -1
- {deriva-1.7.6 → deriva-1.7.7}/.gitignore +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/CHANGELOG.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/LICENSE +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/README.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/acl_config.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/annotation_config.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/annotation_validate.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/base_config.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/dump_catalog_annotations.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/examples/group_owner_policy.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/examples/self_serve_policy.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/config/rollback_annotation.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/annotation.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/catalog_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/datapath.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/deriva_binding.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/deriva_server.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/ermrest_catalog.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/ermrest_model.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/hatrac_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/mmo.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/polling_ermrest_catalog.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/app_links.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/asset.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/bulk_upload.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/chaise_config.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/citation.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/column_display.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/display.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/export.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/export_2019.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/foreign_key.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/generated.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/immutable.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/indexing_preferences.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/key_display.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/non_deletable.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/required.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/source_definitions.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/table_alternatives.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/table_display.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/visible_columns.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/schemas/visible_foreign_keys.schema.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/tests/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/utils/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/utils/core_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/utils/globus_auth_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/utils/hash_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/utils/mime_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/utils/version_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/core/utils/webauthn_utils.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/seo/README.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/seo/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/seo/sitemap_builder.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/seo/sitemap_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/backup/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/backup/__main__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/backup/deriva_backup.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/backup/deriva_backup_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/__main__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/deriva_download_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/base_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/postprocess/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/postprocess/identifier_post_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/postprocess/transfer_post_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/postprocess/url_post_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/query/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/query/bag_fetch_query_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/query/file_download_query_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/transform/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/transform/base_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/transform/column_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/transform/fasta_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/transform/format_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/transform/geo_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/transform/string_transform_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test1.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test10.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test11.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test12.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test13.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test14.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test15.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test16.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test19.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test2.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test20.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test3.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test4.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test5.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test6.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test7.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test8.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/tests/test9.json +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/restore/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/restore/__main__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/restore/deriva_restore.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/restore/deriva_restore_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/__main__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/deriva_upload.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/deriva_upload_cli.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/processors/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/processors/archive_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/processors/base_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/processors/logging_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/processors/metadata_update_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/processors/rename_processor.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/upload/tests/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva/utils/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva.egg-info/SOURCES.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva.egg-info/dependency_links.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva.egg-info/entry_points.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva.egg-info/requires.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/deriva.egg-info/top_level.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/BUILD.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/Makefile +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/README.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/_static/README.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.config.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.core.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.core.utils.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.seo.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.backup.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.download.processors.postprocess.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.download.processors.query.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.download.processors.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.download.processors.transform.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.download.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.restore.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/api/deriva.transfer.upload.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/commands.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/deriva-acl-config.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/deriva-annotation-config.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/deriva-annotation-validate.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/deriva-backup-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/deriva-download-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/deriva-hatrac-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/deriva-restore-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/cli/deriva-sitemap-cli.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/conf.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/derivapy-catalog-snapshot.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/derivapy-catalog.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/derivapy-datapath-example-1.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/derivapy-datapath-example-2.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/derivapy-datapath-example-3.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/derivapy-datapath-example-4.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/derivapy-datapath-update.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/get-started.ipynb +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/index.rst +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/install.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/make.bat +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/project-tutorial.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/docs/using-r.md +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/requirements_dev.txt +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/setup.cfg +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/setup.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/mmo/__init__.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/mmo/base.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/mmo/test_mmo_drop.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/mmo/test_mmo_find.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/mmo/test_mmo_prune.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/mmo/test_mmo_rename.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/mmo/test_mmo_replace.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/tests/deriva/core/test_datapath.py +0 -0
- {deriva-1.7.6 → deriva-1.7.7}/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.7
|
|
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
|
|
@@ -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):
|
|
@@ -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__))
|
|
@@ -29,7 +29,8 @@ Client tool for interacting with DERIVA Export service.
|
|
|
29
29
|
:param envars (dict): A dictionary of variables used for template substitution. Optional.
|
|
30
30
|
:param output_dir (str): The directory where exported data will be stored (default: "."). Optional.
|
|
31
31
|
:param defer_download (bool): Whether to defer the actual data download. Optional.
|
|
32
|
-
:param timeout (
|
|
32
|
+
:param timeout (tuple) OR (float): Timeout value as a tuple of floats in seconds for (connect,read) export operations.
|
|
33
|
+
If a single float value is passed, it will apply to both connect and read operations. Optional.
|
|
33
34
|
:param export_type (str): The type of export to perform (default: "bdbag"). Optional.
|
|
34
35
|
|
|
35
36
|
:return: The full path to the downloaded file. If "defer_download" is True, the URL(s) where the export can be downloaded.
|
|
@@ -47,10 +48,20 @@ class DerivaExport:
|
|
|
47
48
|
self.base_server_uri = "https://" + self.host
|
|
48
49
|
self.service_url = self.base_server_uri + EXPORT_SERVICE_PATH % self.export_type
|
|
49
50
|
self.session_config = DEFAULT_SESSION_CONFIG.copy()
|
|
50
|
-
if self.timeout
|
|
51
|
-
self.
|
|
51
|
+
if isinstance(self.timeout, tuple):
|
|
52
|
+
if len(self.timeout) == 2:
|
|
53
|
+
self.session_config["timeout"] = self.timeout
|
|
54
|
+
else:
|
|
55
|
+
self.session_config["timeout"] = float(self.timeout[0])
|
|
56
|
+
elif self.timeout is not None:
|
|
57
|
+
try:
|
|
58
|
+
self.session_config["timeout"] = float(self.timeout)
|
|
59
|
+
except ValueError:
|
|
60
|
+
logger.warning("Unparseable timeout value: %r. Defaults will be used: %r." %
|
|
61
|
+
(self.timeout, self.session_config["timeout"]))
|
|
52
62
|
self.session = get_new_requests_session(self.service_url, self.session_config)
|
|
53
63
|
self.dcctx = DerivaClientContext()
|
|
64
|
+
self.dcctx['cid'] = kwargs.get("dcctx_cid", "api/" + self.__class__.__name__)
|
|
54
65
|
self.session.headers.update({'deriva-client-context': self.dcctx.encoded()})
|
|
55
66
|
|
|
56
67
|
# credential initialization
|
|
@@ -190,8 +201,10 @@ class DerivaExportCLI(BaseCLI):
|
|
|
190
201
|
BaseCLI.__init__(self, description, epilog, **kwargs)
|
|
191
202
|
self.parser.add_argument("--defer-download", action="store_true",
|
|
192
203
|
help="Do not download exported file(s). Default: False")
|
|
193
|
-
self.parser.add_argument("--timeout", metavar="<
|
|
194
|
-
help="
|
|
204
|
+
self.parser.add_argument("--timeout", metavar="<connect,read>", type=BaseCLI.parse_tuple,
|
|
205
|
+
help="Timeout value(s) in seconds (int or float) for connect and read operations. "
|
|
206
|
+
"Separate using commas. If a single value is provided it will be used for both "
|
|
207
|
+
"connect and read timeouts.")
|
|
195
208
|
self.parser.add_argument("--export-type", choices=["bdbag", "file"], default="bdbag",
|
|
196
209
|
help="Export type: {bdbag|file}. Default is bdbag.",)
|
|
197
210
|
self.parser.add_argument("--output-dir", metavar="<output dir>", default=".",
|
|
@@ -212,7 +225,7 @@ class DerivaExportCLI(BaseCLI):
|
|
|
212
225
|
sys.stderr.write("\n")
|
|
213
226
|
|
|
214
227
|
try:
|
|
215
|
-
exporter = DerivaExport(**vars(args))
|
|
228
|
+
exporter = DerivaExport(**vars(args), dcctx_cid="cli/" + self.__class__.__name__)
|
|
216
229
|
exporter.export()
|
|
217
230
|
except (DerivaDownloadError, DerivaDownloadConfigurationError, DerivaDownloadAuthenticationError,
|
|
218
231
|
DerivaDownloadAuthorizationError, DerivaDownloadTimeoutError) as e:
|
{deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/query/base_query_processor.py
RENAMED
|
@@ -2,7 +2,7 @@ import os
|
|
|
2
2
|
import errno
|
|
3
3
|
import certifi
|
|
4
4
|
import requests
|
|
5
|
-
from deriva.core import urlsplit, get_new_requests_session, stob, make_dirs, DEFAULT_SESSION_CONFIG
|
|
5
|
+
from deriva.core import urlsplit, get_new_requests_session, stob, make_dirs, format_exception, DEFAULT_SESSION_CONFIG
|
|
6
6
|
from deriva.transfer.download import DerivaDownloadError, DerivaDownloadConfigurationError, \
|
|
7
7
|
DerivaDownloadAuthenticationError, DerivaDownloadAuthorizationError
|
|
8
8
|
from deriva.transfer.download.processors.base_processor import BaseProcessor, \
|
|
@@ -83,12 +83,12 @@ class BaseQueryProcessor(BaseProcessor):
|
|
|
83
83
|
return self.catalog.get(self.query, headers=headers).json()
|
|
84
84
|
except requests.HTTPError as e:
|
|
85
85
|
if e.response.status_code == 401:
|
|
86
|
-
raise DerivaDownloadAuthenticationError(e)
|
|
86
|
+
raise DerivaDownloadAuthenticationError(format_exception(e))
|
|
87
87
|
if e.response.status_code == 403:
|
|
88
|
-
raise DerivaDownloadAuthorizationError(e)
|
|
88
|
+
raise DerivaDownloadAuthorizationError(format_exception(e))
|
|
89
89
|
if as_file:
|
|
90
90
|
os.remove(self.output_abspath)
|
|
91
|
-
raise DerivaDownloadError("Error executing catalog query: %s" % e)
|
|
91
|
+
raise DerivaDownloadError("Error executing catalog query: %s" % format_exception(e))
|
|
92
92
|
except Exception:
|
|
93
93
|
if as_file:
|
|
94
94
|
os.remove(self.output_abspath)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: deriva
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.7
|
|
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
|
|
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
|
|
File without changes
|
{deriva-1.7.6 → deriva-1.7.7}/deriva/transfer/download/processors/postprocess/url_post_processor.py
RENAMED
|
File without changes
|
|
File without changes
|
{deriva-1.7.6 → deriva-1.7.7}/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
|
|
File without changes
|
|
File without changes
|
{deriva-1.7.6 → deriva-1.7.7}/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
|
|
File without changes
|
|
File without changes
|