dcicutils 8.7.0.1b32__py3-none-any.whl → 8.7.0.1b33__py3-none-any.whl

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.
@@ -8,9 +8,13 @@ class PortalObject:
8
8
 
9
9
  def __init__(self, portal: Portal, portal_object: dict, portal_object_type: Optional[str] = None) -> None:
10
10
  self._portal = portal
11
- self._object = portal_object
11
+ self._data = portal_object
12
12
  self._type = portal_object_type if isinstance(portal_object_type, str) and portal_object_type else None
13
13
 
14
+ @property
15
+ def data(self):
16
+ return self._data
17
+
14
18
  @property
15
19
  @lru_cache(maxsize=1)
16
20
  def schema(self):
@@ -19,12 +23,12 @@ class PortalObject:
19
23
  @property
20
24
  @lru_cache(maxsize=1)
21
25
  def schema_type(self):
22
- return self._type or Portal.get_schema_type(self._object)
26
+ return self._type or Portal.get_schema_type(self._data)
23
27
 
24
28
  @property
25
29
  @lru_cache(maxsize=1)
26
30
  def schema_types(self):
27
- return self._type or Portal.get_schema_types(self._object)
31
+ return self._type or Portal.get_schema_types(self._data)
28
32
 
29
33
  @property
30
34
  @lru_cache(maxsize=1)
@@ -36,7 +40,7 @@ class PortalObject:
36
40
  @property
37
41
  @lru_cache(maxsize=1)
38
42
  def uuid(self) -> Optional[str]:
39
- return PortalObject.get_uuid(self._object)
43
+ return PortalObject.get_uuid(self._data)
40
44
 
41
45
  @staticmethod
42
46
  def get_uuid(portal_object: dict) -> Optional[str]:
@@ -53,13 +57,13 @@ class PortalObject:
53
57
  identifying_properties = []
54
58
  for identifying_property in self.schema_identifying_properties:
55
59
  if identifying_property not in ["uuid", "identifier", "aliases"]:
56
- if self._object.get(identifying_property):
60
+ if self._data.get(identifying_property):
57
61
  identifying_properties.append(identifying_property)
58
- if self._object.get("identifier"):
62
+ if self._data.get("identifier"):
59
63
  identifying_properties.insert(0, "identifier")
60
- if self._object.get("uuid"):
64
+ if self._data.get("uuid"):
61
65
  identifying_properties.insert(0, "uuid")
62
- if "aliases" in self.schema_identifying_properties and self._object.get("aliases"):
66
+ if "aliases" in self.schema_identifying_properties and self._data.get("aliases"):
63
67
  identifying_properties.append("aliases")
64
68
  return identifying_properties
65
69
 
@@ -73,7 +77,7 @@ class PortalObject:
73
77
  return []
74
78
  identifying_paths = []
75
79
  for identifying_property in identifying_properties:
76
- if (identifying_value := self._object.get(identifying_property)):
80
+ if (identifying_value := self._data.get(identifying_property)):
77
81
  if identifying_property == "uuid":
78
82
  identifying_paths.append(f"/{identifying_value}")
79
83
  # For now at least we include the path both with and without the schema type component
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcicutils
3
- Version: 8.7.0.1b32
3
+ Version: 8.7.0.1b33
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
@@ -44,7 +44,7 @@ dcicutils/log_utils.py,sha256=7pWMc6vyrorUZQf-V-M3YC6zrPgNhuV_fzm9xqTPph0,10883
44
44
  dcicutils/misc_utils.py,sha256=bMRWWxdbhuF3PKdCZEH-H4U1ecgT3Nag3EL92D9XGoY,100973
45
45
  dcicutils/obfuscation_utils.py,sha256=fo2jOmDRC6xWpYX49u80bVNisqRRoPskFNX3ymFAmjw,5963
46
46
  dcicutils/opensearch_utils.py,sha256=V2exmFYW8Xl2_pGFixF4I2Cc549Opwe4PhFi5twC0M8,1017
47
- dcicutils/portal_object_utils.py,sha256=Ys_jfycB364KRGK8r15Qw61gZpqdasU5yPvsdYMwTes,5208
47
+ dcicutils/portal_object_utils.py,sha256=io5XCdfHarFb1H2S3IyDNb25n9LPw2IZjcsiBowmeN4,5251
48
48
  dcicutils/portal_utils.py,sha256=jKYgZUYVdkg6VOs1hsiX4bSULLguOIBJFFRpvvZEklU,26704
49
49
  dcicutils/project_utils.py,sha256=qPdCaFmWUVBJw4rw342iUytwdQC0P-XKpK4mhyIulMM,31250
50
50
  dcicutils/qa_checkers.py,sha256=cdXjeL0jCDFDLT8VR8Px78aS10hwNISOO5G_Zv2TZ6M,20534
@@ -66,8 +66,8 @@ dcicutils/trace_utils.py,sha256=g8kwV4ebEy5kXW6oOrEAUsurBcCROvwtZqz9fczsGRE,1769
66
66
  dcicutils/validation_utils.py,sha256=cMZIU2cY98FYtzK52z5WUYck7urH6JcqOuz9jkXpqzg,14797
67
67
  dcicutils/variant_utils.py,sha256=2H9azNx3xAj-MySg-uZ2SFqbWs4kZvf61JnK6b-h4Qw,4343
68
68
  dcicutils/zip_utils.py,sha256=rnjNv_k6L9jT2SjDSgVXp4BEJYLtz9XN6Cl2Fy-tqnM,2027
69
- dcicutils-8.7.0.1b32.dist-info/LICENSE.txt,sha256=qnwSmfnEWMl5l78VPDEzAmEbLVrRqQvfUQiHT0ehrOo,1102
70
- dcicutils-8.7.0.1b32.dist-info/METADATA,sha256=esjo1TTuUTAkh_01JHpIF8Rj5-mLsiQGoA6K5YjlCos,3315
71
- dcicutils-8.7.0.1b32.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
72
- dcicutils-8.7.0.1b32.dist-info/entry_points.txt,sha256=8wbw5csMIgBXhkwfgsgJeuFcoUc0WsucUxmOyml2aoA,209
73
- dcicutils-8.7.0.1b32.dist-info/RECORD,,
69
+ dcicutils-8.7.0.1b33.dist-info/LICENSE.txt,sha256=qnwSmfnEWMl5l78VPDEzAmEbLVrRqQvfUQiHT0ehrOo,1102
70
+ dcicutils-8.7.0.1b33.dist-info/METADATA,sha256=oBnl8kr-p0xukoz_JLaF6utwsnX0CK79u9ykMwe8rCU,3315
71
+ dcicutils-8.7.0.1b33.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
72
+ dcicutils-8.7.0.1b33.dist-info/entry_points.txt,sha256=8wbw5csMIgBXhkwfgsgJeuFcoUc0WsucUxmOyml2aoA,209
73
+ dcicutils-8.7.0.1b33.dist-info/RECORD,,