dcicutils 8.7.0.1b7__tar.gz → 8.7.0.1b9__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/PKG-INFO +1 -1
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/portal_utils.py +19 -19
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/pyproject.toml +1 -1
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/LICENSE.txt +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/README.rst +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/__init__.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/base.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/beanstalk_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/bundle_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/cloudformation_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/codebuild_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/command_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/common.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/contribution_scripts.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/contribution_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/creds_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/data_readers.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/data_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/deployment_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/diff_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/docker_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ecr_scripts.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ecr_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ecs_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_base.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_manager.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_scripts.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_utils_legacy.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/es_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/exceptions.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ff_mocks.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ff_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/function_cache_decorator.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/glacier_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/jh_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/kibana/dashboards.json +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/kibana/readme.md +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/lang_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/c4-infrastructure.jsonc +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/c4-python-infrastructure.jsonc +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-common-server.jsonc +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-common.jsonc +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-gpl-pipeline.jsonc +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-pipeline.jsonc +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/log_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/misc_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/obfuscation_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/opensearch_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/project_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/qa_checkers.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/qa_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/redis_tools.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/redis_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/s3_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/schema_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/scripts/publish_to_pypi.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/scripts/run_license_checker.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/secrets_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/sheet_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/snapshot_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ssl_certificate_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/structured_data.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/task_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/tmpfile_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/trace_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/validation_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/variant_utils.py +0 -0
- {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/zip_utils.py +0 -0
@@ -207,10 +207,10 @@ class Portal:
|
|
207
207
|
|
208
208
|
def get(self, url: str, follow: bool = True, raise_for_status: bool = False, **kwargs) -> OptionalResponse:
|
209
209
|
url = self.url(url)
|
210
|
-
if not self.
|
210
|
+
if not self.vapp:
|
211
211
|
response = requests.get(url, allow_redirects=follow, **self._kwargs(**kwargs))
|
212
212
|
else:
|
213
|
-
response = self.
|
213
|
+
response = self.vapp.get(url, **self._kwargs(**kwargs))
|
214
214
|
if response and response.status_code in [301, 302, 303, 307, 308] and follow:
|
215
215
|
response = response.follow()
|
216
216
|
response = self._response(response)
|
@@ -221,10 +221,10 @@ class Portal:
|
|
221
221
|
def patch(self, url: str, data: Optional[dict] = None, json: Optional[dict] = None,
|
222
222
|
raise_for_status: bool = False, **kwargs) -> OptionalResponse:
|
223
223
|
url = self.url(url)
|
224
|
-
if not self.
|
224
|
+
if not self.vapp:
|
225
225
|
response = requests.patch(url, data=data, json=json, **self._kwargs(**kwargs))
|
226
226
|
else:
|
227
|
-
response = self.
|
227
|
+
response = self.vapp.patch_json(url, json or data, **self._kwargs(**kwargs))
|
228
228
|
response = self._response(response)
|
229
229
|
if raise_for_status:
|
230
230
|
response.raise_for_status()
|
@@ -233,29 +233,29 @@ class Portal:
|
|
233
233
|
def post(self, url: str, data: Optional[dict] = None, json: Optional[dict] = None, files: Optional[dict] = None,
|
234
234
|
raise_for_status: bool = False, **kwargs) -> OptionalResponse:
|
235
235
|
url = self.url(url)
|
236
|
-
if not self.
|
236
|
+
if not self.vapp:
|
237
237
|
response = requests.post(url, data=data, json=json, files=files, **self._kwargs(**kwargs))
|
238
238
|
else:
|
239
239
|
if files:
|
240
|
-
response = self.
|
240
|
+
response = self.vapp.post(url, json or data, upload_files=files, **self._kwargs(**kwargs))
|
241
241
|
else:
|
242
|
-
response = self.
|
242
|
+
response = self.vapp.post_json(url, json or data, upload_files=files, **self._kwargs(**kwargs))
|
243
243
|
response = self._response(response)
|
244
244
|
if raise_for_status:
|
245
245
|
response.raise_for_status()
|
246
246
|
return response
|
247
247
|
|
248
248
|
def get_metadata(self, object_id: str) -> Optional[dict]:
|
249
|
-
return get_metadata(obj_id=object_id, vapp=self.
|
249
|
+
return get_metadata(obj_id=object_id, vapp=self.vapp, key=self.key)
|
250
250
|
|
251
251
|
def patch_metadata(self, object_id: str, data: str) -> Optional[dict]:
|
252
|
-
if self.
|
253
|
-
return patch_metadata(obj_id=object_id, patch_item=data, key=self.
|
252
|
+
if self.key:
|
253
|
+
return patch_metadata(obj_id=object_id, patch_item=data, key=self.key)
|
254
254
|
return self.patch(f"/{object_id}", data).json()
|
255
255
|
|
256
256
|
def post_metadata(self, object_type: str, data: str) -> Optional[dict]:
|
257
|
-
if self.
|
258
|
-
return post_metadata(schema_name=object_type, post_item=data, key=self.
|
257
|
+
if self.key:
|
258
|
+
return post_metadata(schema_name=object_type, post_item=data, key=self.key)
|
259
259
|
return self.post(f"/{object_type}", data).json()
|
260
260
|
|
261
261
|
def get_health(self) -> OptionalResponse:
|
@@ -268,14 +268,14 @@ class Portal:
|
|
268
268
|
return False
|
269
269
|
|
270
270
|
def get_schema(self, schema_name: str) -> Optional[dict]:
|
271
|
-
return get_schema(self.schema_name(schema_name), portal_vapp=self.
|
271
|
+
return get_schema(self.schema_name(schema_name), portal_vapp=self.vapp, key=self.key)
|
272
272
|
|
273
273
|
def get_schemas(self) -> dict:
|
274
274
|
return self.get("/profiles/").json()
|
275
275
|
|
276
276
|
@staticmethod
|
277
277
|
def schema_name(name: str) -> str:
|
278
|
-
return to_camel_case(name if not name.endswith(".json") else name[:-5])
|
278
|
+
return to_camel_case(name.replace(" ", "") if not name.endswith(".json") else name[:-5])
|
279
279
|
|
280
280
|
def is_schema_type(self, value: dict, schema_type: str) -> bool:
|
281
281
|
"""
|
@@ -348,13 +348,13 @@ class Portal:
|
|
348
348
|
return url
|
349
349
|
if not (url := re.sub(r"/+", "/", url)).startswith("/"):
|
350
350
|
url = "/"
|
351
|
-
return self.
|
351
|
+
return self.server + url if self.server else url
|
352
352
|
|
353
353
|
def _kwargs(self, **kwargs) -> dict:
|
354
354
|
result_kwargs = {"headers":
|
355
355
|
kwargs.get("headers", {"Content-type": "application/json", "Accept": "application/json"})}
|
356
|
-
if self.
|
357
|
-
result_kwargs["auth"] = self.
|
356
|
+
if self.key_pair:
|
357
|
+
result_kwargs["auth"] = self.key_pair
|
358
358
|
if isinstance(timeout := kwargs.get("timeout"), int):
|
359
359
|
result_kwargs["timeout"] = timeout
|
360
360
|
return result_kwargs
|
@@ -457,9 +457,9 @@ class Portal:
|
|
457
457
|
return config.make_wsgi_app()
|
458
458
|
|
459
459
|
def start_for_testing(self, port: int = 7070, asynchronous: bool = False) -> Optional[Thread]:
|
460
|
-
if isinstance(self.
|
460
|
+
if isinstance(self.vapp, TestApp) and hasattr(self.vapp, "app") and isinstance(self.vapp.app, PyramidRouter):
|
461
461
|
def start_server() -> None: # noqa
|
462
|
-
with wsgi_make_server("0.0.0.0", port or 7070, self.
|
462
|
+
with wsgi_make_server("0.0.0.0", port or 7070, self.vapp.app) as server:
|
463
463
|
server.serve_forever()
|
464
464
|
if asynchronous:
|
465
465
|
server_thread = Thread(target=start_server)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "dcicutils"
|
3
|
-
version = "8.7.0.
|
3
|
+
version = "8.7.0.1b9" # TODO: To become 8.7.1
|
4
4
|
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
|
5
5
|
authors = ["4DN-DCIC Team <support@4dnucleome.org>"]
|
6
6
|
license = "MIT"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/c4-infrastructure.jsonc
RENAMED
File without changes
|
File without changes
|
{dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-common-server.jsonc
RENAMED
File without changes
|
{dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-common.jsonc
RENAMED
File without changes
|
{dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-gpl-pipeline.jsonc
RENAMED
File without changes
|
{dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-pipeline.jsonc
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
|