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.
Files changed (70) hide show
  1. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/PKG-INFO +1 -1
  2. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/portal_utils.py +19 -19
  3. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/pyproject.toml +1 -1
  4. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/LICENSE.txt +0 -0
  5. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/README.rst +0 -0
  6. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/__init__.py +0 -0
  7. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/base.py +0 -0
  8. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/beanstalk_utils.py +0 -0
  9. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/bundle_utils.py +0 -0
  10. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/cloudformation_utils.py +0 -0
  11. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/codebuild_utils.py +0 -0
  12. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/command_utils.py +0 -0
  13. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/common.py +0 -0
  14. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/contribution_scripts.py +0 -0
  15. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/contribution_utils.py +0 -0
  16. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/creds_utils.py +0 -0
  17. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/data_readers.py +0 -0
  18. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/data_utils.py +0 -0
  19. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/deployment_utils.py +0 -0
  20. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/diff_utils.py +0 -0
  21. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/docker_utils.py +0 -0
  22. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ecr_scripts.py +0 -0
  23. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ecr_utils.py +0 -0
  24. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ecs_utils.py +0 -0
  25. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_base.py +0 -0
  26. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_manager.py +0 -0
  27. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_scripts.py +0 -0
  28. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_utils.py +0 -0
  29. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/env_utils_legacy.py +0 -0
  30. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/es_utils.py +0 -0
  31. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/exceptions.py +0 -0
  32. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ff_mocks.py +0 -0
  33. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ff_utils.py +0 -0
  34. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/function_cache_decorator.py +0 -0
  35. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/glacier_utils.py +0 -0
  36. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/jh_utils.py +0 -0
  37. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/kibana/dashboards.json +0 -0
  38. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/kibana/readme.md +0 -0
  39. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/lang_utils.py +0 -0
  40. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/c4-infrastructure.jsonc +0 -0
  41. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/c4-python-infrastructure.jsonc +0 -0
  42. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-common-server.jsonc +0 -0
  43. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-common.jsonc +0 -0
  44. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-gpl-pipeline.jsonc +0 -0
  45. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_policies/park-lab-pipeline.jsonc +0 -0
  46. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/license_utils.py +0 -0
  47. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/log_utils.py +0 -0
  48. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/misc_utils.py +0 -0
  49. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/obfuscation_utils.py +0 -0
  50. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/opensearch_utils.py +0 -0
  51. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/project_utils.py +0 -0
  52. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/qa_checkers.py +0 -0
  53. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/qa_utils.py +0 -0
  54. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/redis_tools.py +0 -0
  55. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/redis_utils.py +0 -0
  56. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/s3_utils.py +0 -0
  57. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/schema_utils.py +0 -0
  58. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/scripts/publish_to_pypi.py +0 -0
  59. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/scripts/run_license_checker.py +0 -0
  60. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/secrets_utils.py +0 -0
  61. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/sheet_utils.py +0 -0
  62. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/snapshot_utils.py +0 -0
  63. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/ssl_certificate_utils.py +0 -0
  64. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/structured_data.py +0 -0
  65. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/task_utils.py +0 -0
  66. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/tmpfile_utils.py +0 -0
  67. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/trace_utils.py +0 -0
  68. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/validation_utils.py +0 -0
  69. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/variant_utils.py +0 -0
  70. {dcicutils-8.7.0.1b7 → dcicutils-8.7.0.1b9}/dcicutils/zip_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcicutils
3
- Version: 8.7.0.1b7
3
+ Version: 8.7.0.1b9
4
4
  Summary: Utility package for interacting with the 4DN Data Portal and other 4DN resources
5
5
  Home-page: https://github.com/4dn-dcic/utils
6
6
  License: MIT
@@ -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._vapp:
210
+ if not self.vapp:
211
211
  response = requests.get(url, allow_redirects=follow, **self._kwargs(**kwargs))
212
212
  else:
213
- response = self._vapp.get(url, **self._kwargs(**kwargs))
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._vapp:
224
+ if not self.vapp:
225
225
  response = requests.patch(url, data=data, json=json, **self._kwargs(**kwargs))
226
226
  else:
227
- response = self._vapp.patch_json(url, json or data, **self._kwargs(**kwargs))
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._vapp:
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._vapp.post(url, json or data, upload_files=files, **self._kwargs(**kwargs))
240
+ response = self.vapp.post(url, json or data, upload_files=files, **self._kwargs(**kwargs))
241
241
  else:
242
- response = self._vapp.post_json(url, json or data, upload_files=files, **self._kwargs(**kwargs))
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._vapp, key=self._key)
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._key:
253
- return patch_metadata(obj_id=object_id, patch_item=data, key=self._key)
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._key:
258
- return post_metadata(schema_name=object_type, post_item=data, key=self._key)
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._vapp, key=self._key)
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]) if isinstance(name, str) else ""
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._server + url if self._server else url
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._key_pair:
357
- result_kwargs["auth"] = self._key_pair
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._vapp, TestApp) and hasattr(self._vapp, "app") and isinstance(self._vapp.app, PyramidRouter):
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._vapp.app) as server:
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.1b7" # TODO: To become 8.7.1
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