deriva 1.7.10__tar.gz → 1.7.11__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.10/deriva.egg-info → deriva-1.7.11}/PKG-INFO +2 -3
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/__init__.py +1 -1
- deriva-1.7.11/deriva/core/utils/credenza_auth_utils.py +299 -0
- {deriva-1.7.10 → deriva-1.7.11/deriva.egg-info}/PKG-INFO +2 -3
- {deriva-1.7.10 → deriva-1.7.11}/deriva.egg-info/SOURCES.txt +2 -64
- {deriva-1.7.10 → deriva-1.7.11}/deriva.egg-info/entry_points.txt +1 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva.egg-info/requires.txt +1 -1
- deriva-1.7.11/pyproject.toml +3 -0
- {deriva-1.7.10 → deriva-1.7.11}/setup.py +3 -3
- deriva-1.7.10/.gitignore +0 -95
- deriva-1.7.10/CHANGELOG.md +0 -18
- deriva-1.7.10/deriva/seo/README.md +0 -56
- deriva-1.7.10/deriva/transfer/download/tests/test1.json +0 -46
- deriva-1.7.10/deriva/transfer/download/tests/test10.json +0 -33
- deriva-1.7.10/deriva/transfer/download/tests/test11.json +0 -24
- deriva-1.7.10/deriva/transfer/download/tests/test12.json +0 -46
- deriva-1.7.10/deriva/transfer/download/tests/test13.json +0 -39
- deriva-1.7.10/deriva/transfer/download/tests/test14.json +0 -46
- deriva-1.7.10/deriva/transfer/download/tests/test15.json +0 -53
- deriva-1.7.10/deriva/transfer/download/tests/test16.json +0 -37
- deriva-1.7.10/deriva/transfer/download/tests/test19.json +0 -215
- deriva-1.7.10/deriva/transfer/download/tests/test2.json +0 -35
- deriva-1.7.10/deriva/transfer/download/tests/test20.json +0 -212
- deriva-1.7.10/deriva/transfer/download/tests/test3.json +0 -42
- deriva-1.7.10/deriva/transfer/download/tests/test4.json +0 -21
- deriva-1.7.10/deriva/transfer/download/tests/test5.json +0 -28
- deriva-1.7.10/deriva/transfer/download/tests/test6.json +0 -31
- deriva-1.7.10/deriva/transfer/download/tests/test7.json +0 -46
- deriva-1.7.10/deriva/transfer/download/tests/test8.json +0 -93
- deriva-1.7.10/deriva/transfer/download/tests/test9.json +0 -72
- deriva-1.7.10/docs/BUILD.md +0 -44
- deriva-1.7.10/docs/Makefile +0 -20
- deriva-1.7.10/docs/README.md +0 -416
- deriva-1.7.10/docs/_static/README.txt +0 -1
- deriva-1.7.10/docs/api/deriva.config.rst +0 -46
- deriva-1.7.10/docs/api/deriva.core.rst +0 -127
- deriva-1.7.10/docs/api/deriva.core.utils.rst +0 -54
- deriva-1.7.10/docs/api/deriva.rst +0 -20
- deriva-1.7.10/docs/api/deriva.seo.rst +0 -15
- deriva-1.7.10/docs/api/deriva.transfer.backup.rst +0 -30
- deriva-1.7.10/docs/api/deriva.transfer.download.processors.postprocess.rst +0 -38
- deriva-1.7.10/docs/api/deriva.transfer.download.processors.query.rst +0 -39
- deriva-1.7.10/docs/api/deriva.transfer.download.processors.rst +0 -31
- deriva-1.7.10/docs/api/deriva.transfer.download.processors.transform.rst +0 -10
- deriva-1.7.10/docs/api/deriva.transfer.download.rst +0 -37
- deriva-1.7.10/docs/api/deriva.transfer.restore.rst +0 -29
- deriva-1.7.10/docs/api/deriva.transfer.rst +0 -20
- deriva-1.7.10/docs/api/deriva.transfer.upload.rst +0 -29
- deriva-1.7.10/docs/cli/commands.md +0 -10
- deriva-1.7.10/docs/cli/deriva-acl-config.md +0 -290
- deriva-1.7.10/docs/cli/deriva-annotation-config.md +0 -226
- deriva-1.7.10/docs/cli/deriva-annotation-validate.md +0 -212
- deriva-1.7.10/docs/cli/deriva-backup-cli.md +0 -121
- deriva-1.7.10/docs/cli/deriva-download-cli.md +0 -410
- deriva-1.7.10/docs/cli/deriva-hatrac-cli.md +0 -141
- deriva-1.7.10/docs/cli/deriva-restore-cli.md +0 -169
- deriva-1.7.10/docs/cli/deriva-sitemap-cli.md +0 -48
- deriva-1.7.10/docs/conf.py +0 -189
- deriva-1.7.10/docs/derivapy-catalog-snapshot.ipynb +0 -332
- deriva-1.7.10/docs/derivapy-catalog.ipynb +0 -164
- deriva-1.7.10/docs/derivapy-datapath-example-1.ipynb +0 -293
- deriva-1.7.10/docs/derivapy-datapath-example-2.ipynb +0 -619
- deriva-1.7.10/docs/derivapy-datapath-example-3.ipynb +0 -583
- deriva-1.7.10/docs/derivapy-datapath-example-4.ipynb +0 -2573
- deriva-1.7.10/docs/derivapy-datapath-update.ipynb +0 -385
- deriva-1.7.10/docs/get-started.ipynb +0 -117
- deriva-1.7.10/docs/index.rst +0 -27
- deriva-1.7.10/docs/install.md +0 -19
- deriva-1.7.10/docs/make.bat +0 -36
- deriva-1.7.10/docs/project-tutorial.md +0 -666
- deriva-1.7.10/docs/using-r.md +0 -99
- deriva-1.7.10/requirements_dev.txt +0 -8
- deriva-1.7.10/tests/deriva/core/mmo/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/LICENSE +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/README.md +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/acl_config.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/annotation_config.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/annotation_validate.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/base_config.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/dump_catalog_annotations.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/examples/group_owner_policy.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/examples/self_serve_policy.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/config/rollback_annotation.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/annotation.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/base_cli.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/catalog_cli.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/datapath.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/deriva_binding.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/deriva_server.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/ermrest_catalog.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/ermrest_model.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/hatrac_cli.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/hatrac_store.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/mmo.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/polling_ermrest_catalog.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/app_links.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/asset.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/bulk_upload.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/chaise_config.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/citation.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/column_display.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/display.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/export.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/export_2019.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/foreign_key.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/generated.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/immutable.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/indexing_preferences.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/key_display.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/non_deletable.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/required.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/source_definitions.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/table_alternatives.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/table_display.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/visible_columns.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/schemas/visible_foreign_keys.schema.json +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/tests/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/utils/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/utils/core_utils.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/utils/globus_auth_utils.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/utils/hash_utils.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/utils/mime_utils.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/utils/version_utils.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/core/utils/webauthn_utils.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/seo/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/seo/sitemap_builder.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/seo/sitemap_cli.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/backup/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/backup/__main__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/backup/deriva_backup.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/backup/deriva_backup_cli.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/__main__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/deriva_download.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/deriva_download_cli.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/deriva_export.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/base_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/postprocess/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/postprocess/identifier_post_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/postprocess/transfer_post_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/postprocess/url_post_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/query/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/query/bag_fetch_query_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/query/base_query_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/query/file_download_query_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/transform/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/transform/base_transform_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/transform/column_transform_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/transform/fasta_transform_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/transform/format_transform_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/transform/geo_transform_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/processors/transform/string_transform_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/download/tests/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/restore/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/restore/__main__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/restore/deriva_restore.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/restore/deriva_restore_cli.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/__main__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/deriva_upload.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/deriva_upload_cli.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/processors/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/processors/archive_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/processors/base_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/processors/logging_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/processors/metadata_update_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/processors/rename_processor.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/transfer/upload/tests/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva/utils/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva.egg-info/dependency_links.txt +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/deriva.egg-info/top_level.txt +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/setup.cfg +0 -0
- {deriva-1.7.10/tests → deriva-1.7.11/tests/deriva}/__init__.py +0 -0
- {deriva-1.7.10/tests/deriva → deriva-1.7.11/tests/deriva/core}/__init__.py +0 -0
- {deriva-1.7.10/tests/deriva/core → deriva-1.7.11/tests/deriva/core/mmo}/__init__.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/tests/deriva/core/mmo/base.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/tests/deriva/core/mmo/test_mmo_drop.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/tests/deriva/core/mmo/test_mmo_find.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/tests/deriva/core/mmo/test_mmo_prune.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/tests/deriva/core/mmo/test_mmo_rename.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/tests/deriva/core/mmo/test_mmo_replace.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/tests/deriva/core/test_datapath.py +0 -0
- {deriva-1.7.10 → deriva-1.7.11}/tests/deriva/core/test_ermrest_model.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deriva
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.11
|
|
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
|
|
@@ -15,7 +15,6 @@ Classifier: Operating System :: POSIX
|
|
|
15
15
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
16
16
|
Classifier: Operating System :: Microsoft :: Windows
|
|
17
17
|
Classifier: Programming Language :: Python
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -28,7 +27,7 @@ Requires-Dist: requests
|
|
|
28
27
|
Requires-Dist: pika
|
|
29
28
|
Requires-Dist: urllib3<3,>=1.26.20
|
|
30
29
|
Requires-Dist: portalocker>=1.2.1
|
|
31
|
-
Requires-Dist: bdbag>=1.
|
|
30
|
+
Requires-Dist: bdbag>=1.8.0
|
|
32
31
|
Requires-Dist: globus_sdk<4,>=3
|
|
33
32
|
Requires-Dist: fair-research-login>=0.3.1
|
|
34
33
|
Requires-Dist: fair-identifiers-client>=0.5.1
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import json
|
|
3
|
+
import logging
|
|
4
|
+
import traceback
|
|
5
|
+
from pprint import pprint
|
|
6
|
+
from requests.exceptions import HTTPError, ConnectionError
|
|
7
|
+
from bdbag.fetch.auth import keychain as bdbkc
|
|
8
|
+
from deriva.core import DEFAULT_CREDENTIAL_FILE, read_credential, write_credential, format_exception, BaseCLI, \
|
|
9
|
+
get_new_requests_session, urlparse, urljoin
|
|
10
|
+
from deriva.core.utils import eprint
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def host_to_url(host, path="/", protocol="https"):
|
|
16
|
+
if not host:
|
|
17
|
+
return None
|
|
18
|
+
upr = urlparse(host)
|
|
19
|
+
if upr.scheme and upr.netloc:
|
|
20
|
+
url = urljoin(host, path)
|
|
21
|
+
else:
|
|
22
|
+
url = "%s://%s%s" % (protocol, host, path if not host.endswith("/") else "")
|
|
23
|
+
return url.lower()
|
|
24
|
+
|
|
25
|
+
class UsageException(ValueError):
|
|
26
|
+
"""Usage exception.
|
|
27
|
+
"""
|
|
28
|
+
def __init__(self, message):
|
|
29
|
+
"""Initializes the exception.
|
|
30
|
+
"""
|
|
31
|
+
super(UsageException, self).__init__(message)
|
|
32
|
+
|
|
33
|
+
class CredenzaAuthUtilCLI(BaseCLI):
|
|
34
|
+
"""CredenzaAuthUtil Command-line Interface.
|
|
35
|
+
"""
|
|
36
|
+
def __init__(self, *args, **kwargs):
|
|
37
|
+
super(CredenzaAuthUtilCLI, self).__init__(*args, **kwargs)
|
|
38
|
+
self.remove_options(['--token', '--oauth2-token'])
|
|
39
|
+
self.parser.add_argument("--pretty", "-p", action="store_true",
|
|
40
|
+
help="Pretty-print all result output.")
|
|
41
|
+
self.credentials = None
|
|
42
|
+
|
|
43
|
+
# init subparsers and corresponding functions
|
|
44
|
+
self.subparsers = self.parser.add_subparsers(title='sub-commands', dest='subcmd')
|
|
45
|
+
self.login_init()
|
|
46
|
+
self.logout_init()
|
|
47
|
+
self.get_session_init()
|
|
48
|
+
self.put_session_init()
|
|
49
|
+
|
|
50
|
+
@staticmethod
|
|
51
|
+
def update_bdbag_keychain(token=None, host=None, keychain_file=None, allow_redirects=False, delete=False):
|
|
52
|
+
if (token is None) or (host is None):
|
|
53
|
+
return
|
|
54
|
+
keychain_file = keychain_file or bdbkc.DEFAULT_KEYCHAIN_FILE
|
|
55
|
+
entry = {
|
|
56
|
+
"uri": host_to_url(host),
|
|
57
|
+
"auth_type": "bearer-token",
|
|
58
|
+
"auth_params": {
|
|
59
|
+
"token": token,
|
|
60
|
+
"allow_redirects_with_token": True if allow_redirects else False
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
bdbkc.update_keychain(entry, keychain_file=keychain_file, delete=delete)
|
|
64
|
+
|
|
65
|
+
def load_credential(self, host, credential_file=None):
|
|
66
|
+
if not self.credentials:
|
|
67
|
+
self.credentials = read_credential(credential_file or DEFAULT_CREDENTIAL_FILE, create_default=True)
|
|
68
|
+
credential = self.credentials.get(host, self.credentials.get(host.lower()))
|
|
69
|
+
if not credential:
|
|
70
|
+
return None
|
|
71
|
+
return credential.get("bearer-token")
|
|
72
|
+
|
|
73
|
+
def save_credential(self, host, credential_file=None, credential=None):
|
|
74
|
+
if not self.credentials:
|
|
75
|
+
self.credentials = read_credential(credential_file or DEFAULT_CREDENTIAL_FILE, create_default=True)
|
|
76
|
+
|
|
77
|
+
if credential is not None:
|
|
78
|
+
self.credentials[host] = {"bearer-token": credential}
|
|
79
|
+
else:
|
|
80
|
+
self.credentials.pop(host, None)
|
|
81
|
+
|
|
82
|
+
write_credential(credential_file or DEFAULT_CREDENTIAL_FILE, self.credentials)
|
|
83
|
+
|
|
84
|
+
def get_session(self, args, check_only=False):
|
|
85
|
+
credential = self.load_credential(args.host, args.credential_file)
|
|
86
|
+
if not credential:
|
|
87
|
+
return None if check_only else "Credential not found. Login required."
|
|
88
|
+
|
|
89
|
+
url = host_to_url(args.host, "/authn/session")
|
|
90
|
+
session = get_new_requests_session(url)
|
|
91
|
+
session.headers.update({"Authorization": f"Bearer {credential}"})
|
|
92
|
+
response = session.get(url)
|
|
93
|
+
|
|
94
|
+
if response.status_code == 200:
|
|
95
|
+
return response.json()
|
|
96
|
+
elif response.status_code == 404:
|
|
97
|
+
return None if check_only else f"No valid session found for host '{args.host}'."
|
|
98
|
+
else:
|
|
99
|
+
response.raise_for_status()
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
def put_session(self, args):
|
|
103
|
+
credential = self.load_credential(args.host, args.credential_file)
|
|
104
|
+
if not credential:
|
|
105
|
+
return "Credential not found. Login required."
|
|
106
|
+
|
|
107
|
+
path = "/authn/session"
|
|
108
|
+
if args.refresh_upstream:
|
|
109
|
+
path += "?refresh_upstream=true"
|
|
110
|
+
url = host_to_url(args.host, path)
|
|
111
|
+
session = get_new_requests_session(url)
|
|
112
|
+
session.headers.update({"Authorization": f"Bearer {credential}"})
|
|
113
|
+
response = session.put(url)
|
|
114
|
+
|
|
115
|
+
if response.status_code == 200:
|
|
116
|
+
return response.json()
|
|
117
|
+
elif response.status_code == 404:
|
|
118
|
+
return f"No valid session found for host '{args.host}'."
|
|
119
|
+
else:
|
|
120
|
+
response.raise_for_status()
|
|
121
|
+
return None
|
|
122
|
+
|
|
123
|
+
def login(self, args):
|
|
124
|
+
|
|
125
|
+
if not sys.stdin.isatty():
|
|
126
|
+
raise RuntimeError("Interactive TTY required for device login.")
|
|
127
|
+
|
|
128
|
+
if not args.force:
|
|
129
|
+
resp = self.get_session(args, check_only=True)
|
|
130
|
+
if resp:
|
|
131
|
+
return f"You are already logged in to host '{args.host}'"
|
|
132
|
+
|
|
133
|
+
path = "/authn/device/start"
|
|
134
|
+
if args.refresh:
|
|
135
|
+
path += "?refresh=true"
|
|
136
|
+
url = host_to_url(args.host, path)
|
|
137
|
+
session = get_new_requests_session(url)
|
|
138
|
+
response = session.post(url)
|
|
139
|
+
response.raise_for_status()
|
|
140
|
+
body = response.json()
|
|
141
|
+
verification_url = body["verification_uri"]
|
|
142
|
+
|
|
143
|
+
login_prompt = f"""
|
|
144
|
+
|
|
145
|
+
Device login initiated to {args.host}.
|
|
146
|
+
|
|
147
|
+
1. Please visit {verification_url} in a browser to complete authentication.
|
|
148
|
+
2. After that, return here and enter "y" or "yes" at the prompt below to proceed.
|
|
149
|
+
|
|
150
|
+
"""
|
|
151
|
+
sys.stdout.write(login_prompt)
|
|
152
|
+
sys.stdout.flush()
|
|
153
|
+
try:
|
|
154
|
+
while True:
|
|
155
|
+
sys.stdout.write("\nProceed? (y/N): ")
|
|
156
|
+
sys.stdout.flush()
|
|
157
|
+
response = sys.stdin.readline()
|
|
158
|
+
|
|
159
|
+
ans = response.strip().lower()
|
|
160
|
+
if ans in {"y", "yes"}:
|
|
161
|
+
break
|
|
162
|
+
elif ans in {"n", "no", ""}: # default is No on empty/enter
|
|
163
|
+
return f"Login cancelled for '{args.host}'."
|
|
164
|
+
except KeyboardInterrupt:
|
|
165
|
+
sys.stdout.write("\nCancelled by user (Ctrl-C).\n")
|
|
166
|
+
return f"Login cancelled for '{args.host}'."
|
|
167
|
+
|
|
168
|
+
token_response = session.post(
|
|
169
|
+
f"https://{args.host}/authn/device/token",
|
|
170
|
+
json={"device_code": body["device_code"]}
|
|
171
|
+
)
|
|
172
|
+
token_response.raise_for_status()
|
|
173
|
+
body = token_response.json()
|
|
174
|
+
token = body["access_token"]
|
|
175
|
+
self.save_credential(args.host, args.credential_file, token)
|
|
176
|
+
if not args.no_bdbag_keychain:
|
|
177
|
+
self.update_bdbag_keychain(host=args.host,
|
|
178
|
+
token=token,
|
|
179
|
+
keychain_file=args.bdbag_keychain_file or bdbkc.DEFAULT_KEYCHAIN_FILE)
|
|
180
|
+
token_display = f"Access token: {token}" if args.show_token else ""
|
|
181
|
+
return f"You have been successfully logged in to host '{args.host}'. {token_display}"
|
|
182
|
+
|
|
183
|
+
def logout(self, args):
|
|
184
|
+
credential = self.load_credential(args.host, args.credential_file)
|
|
185
|
+
if not credential:
|
|
186
|
+
return "Credential not found. Not logged in."
|
|
187
|
+
|
|
188
|
+
url = host_to_url(args.host, "/authn/device/logout")
|
|
189
|
+
session = get_new_requests_session(url)
|
|
190
|
+
session.headers.update({"Authorization": f"Bearer {credential}"})
|
|
191
|
+
response = session.post(url)
|
|
192
|
+
response.raise_for_status()
|
|
193
|
+
|
|
194
|
+
self.save_credential(args.host, args.credential_file)
|
|
195
|
+
if not args.no_bdbag_keychain:
|
|
196
|
+
self.update_bdbag_keychain(host=args.host,
|
|
197
|
+
token=credential,
|
|
198
|
+
delete=True,
|
|
199
|
+
keychain_file=args.bdbag_keychain_file or bdbkc.DEFAULT_KEYCHAIN_FILE)
|
|
200
|
+
|
|
201
|
+
return f"You have been successfully logged out of host '{args.host}'."
|
|
202
|
+
|
|
203
|
+
def login_init(self):
|
|
204
|
+
parser = self.subparsers.add_parser('login',
|
|
205
|
+
help="Login with Globus Auth and get OAuth tokens for resource access.")
|
|
206
|
+
|
|
207
|
+
parser.add_argument("--no-bdbag-keychain", action="store_true",
|
|
208
|
+
help="Do not update the bdbag keychain file with result access tokens. Default false.")
|
|
209
|
+
parser.add_argument('--bdbag-keychain-file', metavar='<file>',
|
|
210
|
+
help="Non-default path to a bdbag keychain file.")
|
|
211
|
+
parser.add_argument("--refresh", action="store_true",
|
|
212
|
+
help="Allow the session manager to automatically refresh access tokens on the user's behalf "
|
|
213
|
+
"until either the refresh token expires or the user logs out.")
|
|
214
|
+
parser.add_argument("--force", action="store_true",
|
|
215
|
+
help="Force a login flow even if the current access token is valid.")
|
|
216
|
+
parser.add_argument("--show-token", action="store_true",
|
|
217
|
+
help="Display the token from the authorization response.")
|
|
218
|
+
parser.set_defaults(func=self.login)
|
|
219
|
+
|
|
220
|
+
def logout_init(self):
|
|
221
|
+
parser = self.subparsers.add_parser("logout", help="Logout and revoke all access and refresh tokens.")
|
|
222
|
+
parser.add_argument("--no-bdbag-keychain", action="store_true",
|
|
223
|
+
help="Do not update the bdbag keychain file by removing access tokens on logout. Default false.")
|
|
224
|
+
parser.add_argument('--bdbag-keychain-file', metavar='<file>',
|
|
225
|
+
help="Non-default path to a bdbag keychain file.")
|
|
226
|
+
parser.set_defaults(func=self.logout)
|
|
227
|
+
|
|
228
|
+
def get_session_init(self):
|
|
229
|
+
parser = self.subparsers.add_parser("get-session",
|
|
230
|
+
help="Retrieve information about the currently logged-in user.")
|
|
231
|
+
parser.set_defaults(func=self.get_session)
|
|
232
|
+
|
|
233
|
+
def put_session_init(self):
|
|
234
|
+
parser = self.subparsers.add_parser("put-session",
|
|
235
|
+
help="Extend the current logged-in user's session.")
|
|
236
|
+
parser.add_argument("--refresh-upstream", action="store_true",
|
|
237
|
+
help="Attempt to refresh access tokens, other dependent tokens, and claims from the "
|
|
238
|
+
"upstream identity provider.")
|
|
239
|
+
parser.set_defaults(func=self.put_session)
|
|
240
|
+
|
|
241
|
+
def main(self):
|
|
242
|
+
args = self.parse_cli()
|
|
243
|
+
|
|
244
|
+
def _cmd_error_message(emsg):
|
|
245
|
+
return "{prog} {subcmd}: {msg}".format(
|
|
246
|
+
prog=self.parser.prog, subcmd=args.subcmd, msg=emsg)
|
|
247
|
+
|
|
248
|
+
try:
|
|
249
|
+
if not hasattr(args, 'func'):
|
|
250
|
+
self.parser.print_usage()
|
|
251
|
+
return 2
|
|
252
|
+
|
|
253
|
+
if args.subcmd == "login" or args.subcmd == "logout" or args.subcmd == "session":
|
|
254
|
+
pass
|
|
255
|
+
else:
|
|
256
|
+
pass
|
|
257
|
+
|
|
258
|
+
response = args.func(args)
|
|
259
|
+
if args.pretty:
|
|
260
|
+
if isinstance(response, dict) or isinstance(response, list):
|
|
261
|
+
try:
|
|
262
|
+
print(json.dumps(response, indent=2))
|
|
263
|
+
return 0
|
|
264
|
+
except:
|
|
265
|
+
pprint(response)
|
|
266
|
+
return 0
|
|
267
|
+
elif not isinstance(response, str):
|
|
268
|
+
pprint(response)
|
|
269
|
+
return 0
|
|
270
|
+
print(response)
|
|
271
|
+
return 0
|
|
272
|
+
|
|
273
|
+
except UsageException as e:
|
|
274
|
+
eprint("{prog} {subcmd}: {msg}".format(prog=self.parser.prog, subcmd=args.subcmd, msg=e))
|
|
275
|
+
except ConnectionError as e:
|
|
276
|
+
eprint("{prog}: Connection error occurred".format(prog=self.parser.prog))
|
|
277
|
+
except HTTPError as e:
|
|
278
|
+
if 401 == e.response.status_code:
|
|
279
|
+
msg = 'Authentication required: %s' % format_exception(e)
|
|
280
|
+
elif 403 == e.response.status_code:
|
|
281
|
+
msg = 'Permission denied: %s' % format_exception(e)
|
|
282
|
+
else:
|
|
283
|
+
msg = e
|
|
284
|
+
eprint(_cmd_error_message(msg))
|
|
285
|
+
except RuntimeError as e:
|
|
286
|
+
logging.debug(format_exception(e))
|
|
287
|
+
eprint('An unexpected runtime error occurred')
|
|
288
|
+
except:
|
|
289
|
+
eprint('An unexpected error occurred')
|
|
290
|
+
traceback.print_exc()
|
|
291
|
+
return 1
|
|
292
|
+
|
|
293
|
+
def main():
|
|
294
|
+
desc = "Credenza Auth Utilities"
|
|
295
|
+
info = "For more information see: https://github.com/informatics-isi-edu/deriva-py"
|
|
296
|
+
return CredenzaAuthUtilCLI(desc, info).main()
|
|
297
|
+
|
|
298
|
+
if __name__ == '__main__':
|
|
299
|
+
sys.exit(main())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deriva
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.11
|
|
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
|
|
@@ -15,7 +15,6 @@ Classifier: Operating System :: POSIX
|
|
|
15
15
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
16
16
|
Classifier: Operating System :: Microsoft :: Windows
|
|
17
17
|
Classifier: Programming Language :: Python
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -28,7 +27,7 @@ Requires-Dist: requests
|
|
|
28
27
|
Requires-Dist: pika
|
|
29
28
|
Requires-Dist: urllib3<3,>=1.26.20
|
|
30
29
|
Requires-Dist: portalocker>=1.2.1
|
|
31
|
-
Requires-Dist: bdbag>=1.
|
|
30
|
+
Requires-Dist: bdbag>=1.8.0
|
|
32
31
|
Requires-Dist: globus_sdk<4,>=3
|
|
33
32
|
Requires-Dist: fair-research-login>=0.3.1
|
|
34
33
|
Requires-Dist: fair-identifiers-client>=0.5.1
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
.gitignore
|
|
2
|
-
CHANGELOG.md
|
|
3
1
|
LICENSE
|
|
4
2
|
README.md
|
|
5
|
-
|
|
3
|
+
pyproject.toml
|
|
6
4
|
setup.cfg
|
|
7
5
|
setup.py
|
|
8
6
|
deriva/__init__.py
|
|
@@ -58,12 +56,12 @@ deriva/core/schemas/visible_foreign_keys.schema.json
|
|
|
58
56
|
deriva/core/tests/__init__.py
|
|
59
57
|
deriva/core/utils/__init__.py
|
|
60
58
|
deriva/core/utils/core_utils.py
|
|
59
|
+
deriva/core/utils/credenza_auth_utils.py
|
|
61
60
|
deriva/core/utils/globus_auth_utils.py
|
|
62
61
|
deriva/core/utils/hash_utils.py
|
|
63
62
|
deriva/core/utils/mime_utils.py
|
|
64
63
|
deriva/core/utils/version_utils.py
|
|
65
64
|
deriva/core/utils/webauthn_utils.py
|
|
66
|
-
deriva/seo/README.md
|
|
67
65
|
deriva/seo/__init__.py
|
|
68
66
|
deriva/seo/sitemap_builder.py
|
|
69
67
|
deriva/seo/sitemap_cli.py
|
|
@@ -95,24 +93,6 @@ deriva/transfer/download/processors/transform/format_transform_processor.py
|
|
|
95
93
|
deriva/transfer/download/processors/transform/geo_transform_processor.py
|
|
96
94
|
deriva/transfer/download/processors/transform/string_transform_processor.py
|
|
97
95
|
deriva/transfer/download/tests/__init__.py
|
|
98
|
-
deriva/transfer/download/tests/test1.json
|
|
99
|
-
deriva/transfer/download/tests/test10.json
|
|
100
|
-
deriva/transfer/download/tests/test11.json
|
|
101
|
-
deriva/transfer/download/tests/test12.json
|
|
102
|
-
deriva/transfer/download/tests/test13.json
|
|
103
|
-
deriva/transfer/download/tests/test14.json
|
|
104
|
-
deriva/transfer/download/tests/test15.json
|
|
105
|
-
deriva/transfer/download/tests/test16.json
|
|
106
|
-
deriva/transfer/download/tests/test19.json
|
|
107
|
-
deriva/transfer/download/tests/test2.json
|
|
108
|
-
deriva/transfer/download/tests/test20.json
|
|
109
|
-
deriva/transfer/download/tests/test3.json
|
|
110
|
-
deriva/transfer/download/tests/test4.json
|
|
111
|
-
deriva/transfer/download/tests/test5.json
|
|
112
|
-
deriva/transfer/download/tests/test6.json
|
|
113
|
-
deriva/transfer/download/tests/test7.json
|
|
114
|
-
deriva/transfer/download/tests/test8.json
|
|
115
|
-
deriva/transfer/download/tests/test9.json
|
|
116
96
|
deriva/transfer/restore/__init__.py
|
|
117
97
|
deriva/transfer/restore/__main__.py
|
|
118
98
|
deriva/transfer/restore/deriva_restore.py
|
|
@@ -129,48 +109,6 @@ deriva/transfer/upload/processors/metadata_update_processor.py
|
|
|
129
109
|
deriva/transfer/upload/processors/rename_processor.py
|
|
130
110
|
deriva/transfer/upload/tests/__init__.py
|
|
131
111
|
deriva/utils/__init__.py
|
|
132
|
-
docs/BUILD.md
|
|
133
|
-
docs/Makefile
|
|
134
|
-
docs/README.md
|
|
135
|
-
docs/conf.py
|
|
136
|
-
docs/derivapy-catalog-snapshot.ipynb
|
|
137
|
-
docs/derivapy-catalog.ipynb
|
|
138
|
-
docs/derivapy-datapath-example-1.ipynb
|
|
139
|
-
docs/derivapy-datapath-example-2.ipynb
|
|
140
|
-
docs/derivapy-datapath-example-3.ipynb
|
|
141
|
-
docs/derivapy-datapath-example-4.ipynb
|
|
142
|
-
docs/derivapy-datapath-update.ipynb
|
|
143
|
-
docs/get-started.ipynb
|
|
144
|
-
docs/index.rst
|
|
145
|
-
docs/install.md
|
|
146
|
-
docs/make.bat
|
|
147
|
-
docs/project-tutorial.md
|
|
148
|
-
docs/using-r.md
|
|
149
|
-
docs/_static/README.txt
|
|
150
|
-
docs/api/deriva.config.rst
|
|
151
|
-
docs/api/deriva.core.rst
|
|
152
|
-
docs/api/deriva.core.utils.rst
|
|
153
|
-
docs/api/deriva.rst
|
|
154
|
-
docs/api/deriva.seo.rst
|
|
155
|
-
docs/api/deriva.transfer.backup.rst
|
|
156
|
-
docs/api/deriva.transfer.download.processors.postprocess.rst
|
|
157
|
-
docs/api/deriva.transfer.download.processors.query.rst
|
|
158
|
-
docs/api/deriva.transfer.download.processors.rst
|
|
159
|
-
docs/api/deriva.transfer.download.processors.transform.rst
|
|
160
|
-
docs/api/deriva.transfer.download.rst
|
|
161
|
-
docs/api/deriva.transfer.restore.rst
|
|
162
|
-
docs/api/deriva.transfer.rst
|
|
163
|
-
docs/api/deriva.transfer.upload.rst
|
|
164
|
-
docs/cli/commands.md
|
|
165
|
-
docs/cli/deriva-acl-config.md
|
|
166
|
-
docs/cli/deriva-annotation-config.md
|
|
167
|
-
docs/cli/deriva-annotation-validate.md
|
|
168
|
-
docs/cli/deriva-backup-cli.md
|
|
169
|
-
docs/cli/deriva-download-cli.md
|
|
170
|
-
docs/cli/deriva-hatrac-cli.md
|
|
171
|
-
docs/cli/deriva-restore-cli.md
|
|
172
|
-
docs/cli/deriva-sitemap-cli.md
|
|
173
|
-
tests/__init__.py
|
|
174
112
|
tests/deriva/__init__.py
|
|
175
113
|
tests/deriva/core/__init__.py
|
|
176
114
|
tests/deriva/core/test_datapath.py
|
|
@@ -6,6 +6,7 @@ deriva-annotation-rollback = deriva.config.rollback_annotation:main
|
|
|
6
6
|
deriva-annotation-validate = deriva.config.annotation_validate:main
|
|
7
7
|
deriva-backup-cli = deriva.transfer.backup.__main__:main
|
|
8
8
|
deriva-catalog-cli = deriva.core.catalog_cli:main
|
|
9
|
+
deriva-credenza-auth-utils = deriva.core.utils.credenza_auth_utils:main
|
|
9
10
|
deriva-download-cli = deriva.transfer.download.__main__:main
|
|
10
11
|
deriva-export-cli = deriva.transfer.download.deriva_export:main
|
|
11
12
|
deriva-globus-auth-utils = deriva.core.utils.globus_auth_utils:main
|
|
@@ -58,7 +58,8 @@ setup(
|
|
|
58
58
|
'deriva-sitemap-cli = deriva.seo.sitemap_cli:main',
|
|
59
59
|
'deriva-backup-cli = deriva.transfer.backup.__main__:main',
|
|
60
60
|
'deriva-restore-cli = deriva.transfer.restore.__main__:main',
|
|
61
|
-
'deriva-globus-auth-utils = deriva.core.utils.globus_auth_utils:main'
|
|
61
|
+
'deriva-globus-auth-utils = deriva.core.utils.globus_auth_utils:main',
|
|
62
|
+
'deriva-credenza-auth-utils = deriva.core.utils.credenza_auth_utils:main'
|
|
62
63
|
]
|
|
63
64
|
},
|
|
64
65
|
install_requires=[
|
|
@@ -67,7 +68,7 @@ setup(
|
|
|
67
68
|
'pika',
|
|
68
69
|
'urllib3>=1.26.20,<3',
|
|
69
70
|
'portalocker>=1.2.1',
|
|
70
|
-
'bdbag>=1.
|
|
71
|
+
'bdbag>=1.8.0',
|
|
71
72
|
'globus_sdk>=3,<4',
|
|
72
73
|
'fair-research-login>=0.3.1',
|
|
73
74
|
'fair-identifiers-client>=0.5.1',
|
|
@@ -82,7 +83,6 @@ setup(
|
|
|
82
83
|
'Operating System :: MacOS :: MacOS X',
|
|
83
84
|
'Operating System :: Microsoft :: Windows',
|
|
84
85
|
'Programming Language :: Python',
|
|
85
|
-
'Programming Language :: Python :: 3.8',
|
|
86
86
|
'Programming Language :: Python :: 3.9',
|
|
87
87
|
'Programming Language :: Python :: 3.10',
|
|
88
88
|
'Programming Language :: Python :: 3.11',
|
deriva-1.7.10/.gitignore
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# Byte-compiled / optimized / DLL files
|
|
2
|
-
__pycache__/
|
|
3
|
-
*.py[cod]
|
|
4
|
-
*$py.class
|
|
5
|
-
|
|
6
|
-
# C extensions
|
|
7
|
-
*.so
|
|
8
|
-
|
|
9
|
-
# Distribution / packaging
|
|
10
|
-
.Python
|
|
11
|
-
env/
|
|
12
|
-
build/
|
|
13
|
-
develop-eggs/
|
|
14
|
-
dist/
|
|
15
|
-
downloads/
|
|
16
|
-
eggs/
|
|
17
|
-
.eggs/
|
|
18
|
-
lib/
|
|
19
|
-
lib64/
|
|
20
|
-
parts/
|
|
21
|
-
sdist/
|
|
22
|
-
var/
|
|
23
|
-
*.egg-info/
|
|
24
|
-
.installed.cfg
|
|
25
|
-
*.egg
|
|
26
|
-
|
|
27
|
-
# PyInstaller
|
|
28
|
-
# Usually these files are written by a python script from a template
|
|
29
|
-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
30
|
-
*.manifest
|
|
31
|
-
*.spec
|
|
32
|
-
|
|
33
|
-
# Installer logs
|
|
34
|
-
pip-log.txt
|
|
35
|
-
pip-delete-this-directory.txt
|
|
36
|
-
|
|
37
|
-
# Unit test / coverage reports
|
|
38
|
-
htmlcov/
|
|
39
|
-
.tox/
|
|
40
|
-
.coverage
|
|
41
|
-
.coverage.*
|
|
42
|
-
.cache
|
|
43
|
-
nosetests.xml
|
|
44
|
-
coverage.xml
|
|
45
|
-
*,cover
|
|
46
|
-
.hypothesis/
|
|
47
|
-
|
|
48
|
-
# Translations
|
|
49
|
-
*.mo
|
|
50
|
-
*.pot
|
|
51
|
-
|
|
52
|
-
# Django stuff:
|
|
53
|
-
*.log
|
|
54
|
-
local_settings.py
|
|
55
|
-
|
|
56
|
-
# Flask stuff:
|
|
57
|
-
instance/
|
|
58
|
-
.webassets-cache
|
|
59
|
-
|
|
60
|
-
# Scrapy stuff:
|
|
61
|
-
.scrapy
|
|
62
|
-
|
|
63
|
-
# Sphinx documentation
|
|
64
|
-
docs/_build/
|
|
65
|
-
|
|
66
|
-
# PyBuilder
|
|
67
|
-
target/
|
|
68
|
-
|
|
69
|
-
# IPython Notebook
|
|
70
|
-
.ipynb_checkpoints
|
|
71
|
-
|
|
72
|
-
# pyenv
|
|
73
|
-
.python-version
|
|
74
|
-
|
|
75
|
-
# celery beat schedule file
|
|
76
|
-
celerybeat-schedule
|
|
77
|
-
|
|
78
|
-
# dotenv
|
|
79
|
-
.env
|
|
80
|
-
|
|
81
|
-
# virtualenv
|
|
82
|
-
venv/
|
|
83
|
-
ENV/
|
|
84
|
-
|
|
85
|
-
# Spyder project settings
|
|
86
|
-
.spyderproject
|
|
87
|
-
|
|
88
|
-
# Rope project settings
|
|
89
|
-
.ropeproject
|
|
90
|
-
|
|
91
|
-
# mac finder
|
|
92
|
-
.DS_Store
|
|
93
|
-
|
|
94
|
-
# pycharm
|
|
95
|
-
.idea/
|
deriva-1.7.10/CHANGELOG.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# CHANGE LOG
|
|
2
|
-
|
|
3
|
-
## 1.6.5
|
|
4
|
-
|
|
5
|
-
DataPath feature enhancements and changes:
|
|
6
|
-
* new `denormalize()` method that uses a `visible-columns` "context" or a heuristic function to denormalize a path expression.
|
|
7
|
-
* new `limit()` method as a chaining operation so that clients don't need to explicity `fetch()` results with limits.
|
|
8
|
-
* subtle change to `link()` method for how it determines whether an alias name has been "bound" to the path. Now, it more explicitly checks if an alias object is found in the path's bound table instances. This change also relaxes the alias naming constraint to allow for automatic conflict resolution by appending an incremental numeric disambiguator if the given alias name is already in use. This could result in some `link()` methods now succeeding where they would have failed in the past.
|
|
9
|
-
|
|
10
|
-
## 1.0.0
|
|
11
|
-
Feature release.
|
|
12
|
-
* Refactored catalog configuration API.
|
|
13
|
-
* Support for aggregate functions and binning in DataPath API.
|
|
14
|
-
* Various bug fixes.
|
|
15
|
-
* Complete change list [here](https://github.com/informatics-isi-edu/deriva-py/compare/v0.9.0...v1.0.0).
|
|
16
|
-
|
|
17
|
-
Change lists for previous releases can be found on the GitHub releases
|
|
18
|
-
page [here](https://github.com/informatics-isi-edu/deriva-py/releases).
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Sitemap builder library and CLI
|
|
2
|
-
|
|
3
|
-
## The CLI documentation is [here](../../docs/cli/deriva-sitemap-cli.md).
|
|
4
|
-
|
|
5
|
-
## SiteMapBuilder class
|
|
6
|
-
|
|
7
|
-
Typical usage is:
|
|
8
|
-
|
|
9
|
-
1. Create a SiteMapBuilder class
|
|
10
|
-
|
|
11
|
-
2. For each table to include in the sitemap, create a table spec and populate it with the table's data. Typically, the creating and populating for a table is done by a single call to add_table_spec.
|
|
12
|
-
|
|
13
|
-
3. Call write_sitemap to write out the site map
|
|
14
|
-
|
|
15
|
-
### Examples
|
|
16
|
-
|
|
17
|
-
In the simplest case, this would create a sitemap with two tables::
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
sb = SitemapBuilder("https", "myhost.org", 1)
|
|
21
|
-
sb.add_table_spec("schema1", "table1")
|
|
22
|
-
sb.add_table_spec("schema2", "table2")
|
|
23
|
-
sb.write_sitemap(sys.stdout)
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
If you want to include only a subset of rows of a table, you can pass a datapath to add_table_spec::
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
pb = catalog.getPathBuilder()
|
|
31
|
-
path=pb.schema3.table3.filter(pb.schema3.table3.Species=="Homo sapiens")
|
|
32
|
-
sb.add_table_spec("schema3", "table3", datapath=path)
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
If you want to do something more customizable, you can populate the spec yourself::
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
rows = do_something_complicated()
|
|
39
|
-
spec = sb.add_table_spec("schema4", "table4", populate=False)
|
|
40
|
-
sb.set_table_spec_data(rows)
|
|
41
|
-
sb.add_fkey_times(spec)
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Note: if add_table_spec populates the spec for you, it will set the modification time based on the times in the table and on all single-valued incoming foreign keys (because those are the most likely to affect a Chaise record page). If you're populating the spec yourself (i.e., if you called add_table_spec with populate=False), you can call add_fkey_times to make those time adjustments.
|
|
45
|
-
|
|
46
|
-
### Limitations:
|
|
47
|
-
|
|
48
|
-
Sitemaps should be no more than 50MB in size and should contain no more than 50,000 URLS (https://www.sitemaps.org/faq.html#faq_sitemap_size), but this class doesn't enforce those limits. (Note: A site can have multiple sitemaps).
|
|
49
|
-
|
|
50
|
-
A URL element should have no more than 1000 images associated with it (https://support.google.com/webmasters/answer/178636?hl=en), but this class doesn't enforce that limit.
|
|
51
|
-
|
|
52
|
-
This class assumes that all images in a catalog will have the same license.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|