dcicutils 8.16.2.1b1__py3-none-any.whl → 8.16.2.1b3__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
dcicutils/portal_utils.py CHANGED
@@ -210,7 +210,8 @@ class Portal:
210
210
 
211
211
  def get(self, url: str, follow: bool = True,
212
212
  raw: bool = False, database: bool = False,
213
- limit: Optional[int] = None, offset: Optional[int] = None, field: Optional[str] = None,
213
+ limit: Optional[int] = None, offset: Optional[int] = None,
214
+ field: Optional[str] = None, deleted: bool = False,
214
215
  raise_for_status: bool = False, **kwargs) -> OptionalResponse:
215
216
  url = self.url(url, raw, database)
216
217
  if isinstance(limit, int) and (limit >= 0):
@@ -220,14 +221,19 @@ class Portal:
220
221
  url += f"?limit={limit}"
221
222
  if isinstance(offset, int) and (offset >= 0):
222
223
  if "?" in url:
223
- url += "&from={offset}"
224
+ url += f"&from={offset}"
224
225
  else:
225
- url += "?from={offset}"
226
+ url += f"?from={offset}"
226
227
  if isinstance(field, str) and field:
227
228
  if "?" in url:
228
- url += "&field={field}"
229
+ url += f"&field={field}"
229
230
  else:
230
- url += "?field={field}"
231
+ url += f"?field={field}"
232
+ if deleted is True:
233
+ if "?" in url:
234
+ url += "&status=deleted"
235
+ else:
236
+ url += "?status=deleted"
231
237
  if not self.vapp:
232
238
  response = requests.get(url, allow_redirects=follow, **self._kwargs(**kwargs))
233
239
  else:
@@ -270,7 +276,8 @@ class Portal:
270
276
  return response
271
277
 
272
278
  def get_metadata(self, object_id: str, raw: bool = False, database: bool = False,
273
- limit: Optional[int] = None, offset: Optional[int] = None, field: Optional[str] = None,
279
+ limit: Optional[int] = None, offset: Optional[int] = None,
280
+ field: Optional[str] = None, deleted: bool = False,
274
281
  raise_exception: bool = True) -> Optional[dict]:
275
282
  if isinstance(raw, bool) and raw:
276
283
  add_on = "frame=raw" + ("&datastore=database" if isinstance(database, bool) and database else "")
@@ -285,14 +292,19 @@ class Portal:
285
292
  add_on += f"limit={limit}"
286
293
  if isinstance(offset, int) and (offset >= 0):
287
294
  if add_on:
288
- add_on += "&from={offset}"
295
+ add_on += f"&from={offset}"
289
296
  else:
290
- add_on += "from={offset}"
297
+ add_on += f"from={offset}"
291
298
  if isinstance(field, int) and field:
292
299
  if add_on:
293
- add_on += "&field={field}"
300
+ add_on += f"&field={field}"
301
+ else:
302
+ add_on += f"field={field}"
303
+ if deleted is True:
304
+ if add_on:
305
+ add_on += "&status=deleted"
294
306
  else:
295
- add_on += "field={field}"
307
+ add_on += "status=deleted"
296
308
  if raise_exception:
297
309
  return get_metadata(obj_id=object_id, vapp=self.vapp, key=self.key, add_on=add_on)
298
310
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcicutils
3
- Version: 8.16.2.1b1
3
+ Version: 8.16.2.1b3
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
@@ -49,7 +49,7 @@ dcicutils/misc_utils.py,sha256=xNQtavXS6vw_x9rQNhZEryo9b19oWYg-A8TzjhVDuxg,11594
49
49
  dcicutils/obfuscation_utils.py,sha256=fo2jOmDRC6xWpYX49u80bVNisqRRoPskFNX3ymFAmjw,5963
50
50
  dcicutils/opensearch_utils.py,sha256=V2exmFYW8Xl2_pGFixF4I2Cc549Opwe4PhFi5twC0M8,1017
51
51
  dcicutils/portal_object_utils.py,sha256=Az3n1aL-PQkN5gOFE6ZqC2XkYsqiwKlq7-tZggs1QN4,11062
52
- dcicutils/portal_utils.py,sha256=FQyxqAsiN-Hd44fpWRrCp8i6HCTRkMqAq9vXM41Jf_s,46719
52
+ dcicutils/portal_utils.py,sha256=uMy3AJbs-pbjhR0sHXMZq74U6yZ4tTdWPqZJN871jmk,47117
53
53
  dcicutils/progress_bar.py,sha256=R3bWLMYM3Xq9PY7U0JadcFT1m7QmCbrbDp9qs9_Kf_c,19472
54
54
  dcicutils/project_utils.py,sha256=qPdCaFmWUVBJw4rw342iUytwdQC0P-XKpK4mhyIulMM,31250
55
55
  dcicutils/qa_checkers.py,sha256=j0kzo_T5VduKTxgsMTp7xjneyNokumZzI_iz55Y0Jjs,20505
@@ -75,8 +75,8 @@ dcicutils/trace_utils.py,sha256=g8kwV4ebEy5kXW6oOrEAUsurBcCROvwtZqz9fczsGRE,1769
75
75
  dcicutils/validation_utils.py,sha256=cMZIU2cY98FYtzK52z5WUYck7urH6JcqOuz9jkXpqzg,14797
76
76
  dcicutils/variant_utils.py,sha256=2H9azNx3xAj-MySg-uZ2SFqbWs4kZvf61JnK6b-h4Qw,4343
77
77
  dcicutils/zip_utils.py,sha256=_Y9EmL3D2dUZhxucxHvrtmmlbZmK4FpSsHEb7rGSJLU,3265
78
- dcicutils-8.16.2.1b1.dist-info/LICENSE.txt,sha256=qnwSmfnEWMl5l78VPDEzAmEbLVrRqQvfUQiHT0ehrOo,1102
79
- dcicutils-8.16.2.1b1.dist-info/METADATA,sha256=KItc8pDz1MPVwNMNTxczJKODYWdkNxk5tl8kpSW3H9w,3493
80
- dcicutils-8.16.2.1b1.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
81
- dcicutils-8.16.2.1b1.dist-info/entry_points.txt,sha256=W6kEWdUJk9tQ4myAgpehPdebcwvCAZ7UgB-wyPgDUMg,335
82
- dcicutils-8.16.2.1b1.dist-info/RECORD,,
78
+ dcicutils-8.16.2.1b3.dist-info/LICENSE.txt,sha256=qnwSmfnEWMl5l78VPDEzAmEbLVrRqQvfUQiHT0ehrOo,1102
79
+ dcicutils-8.16.2.1b3.dist-info/METADATA,sha256=9p8krTHYyhbGEFTwpohYWGLh_UngjVUbTDx9LMTJEck,3493
80
+ dcicutils-8.16.2.1b3.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
81
+ dcicutils-8.16.2.1b3.dist-info/entry_points.txt,sha256=W6kEWdUJk9tQ4myAgpehPdebcwvCAZ7UgB-wyPgDUMg,335
82
+ dcicutils-8.16.2.1b3.dist-info/RECORD,,