pybiolib 1.2.1144__py3-none-any.whl → 1.2.1151__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.
@@ -284,3 +284,16 @@ class DataRecord:
284
284
 
285
285
  def _get_detailed_dict(self) -> types.DataRecordDetailedDict:
286
286
  return cast(types.DataRecordDetailedDict, api_client.get(f'/resources/data-records/{self.uuid}/').json())
287
+
288
+ def delete(self) -> None:
289
+ """Delete the data record.
290
+
291
+ Example::
292
+ >>> record = DataRecord.get_by_uri("account/data-record")
293
+ >>> record.delete()
294
+ """
295
+ try:
296
+ api_client.delete(path=f'/apps/{self.uuid}/')
297
+ logger.info(f'Data record {self.uri} deleted')
298
+ except Exception as error:
299
+ raise Exception(f'Failed to delete data record {self.uri} due to: {error}') from error
biolib/cli/data_record.py CHANGED
@@ -80,3 +80,20 @@ def describe(uri: str, output_as_json: bool) -> None:
80
80
  size_string = str(file_info['size_bytes'])
81
81
  leading_space_string = ' ' * (10 - len(size_string))
82
82
  print(f"{leading_space_string}{size_string} {file_info['path']}")
83
+
84
+
85
+ @data_record.command(help='Delete a Data Record')
86
+ @click.argument('uri', required=True)
87
+ def delete(uri: str) -> None:
88
+ record = DataRecord.get_by_uri(uri=uri)
89
+
90
+ print(f'You are about to delete the data record: {record.uri}')
91
+ print('This action cannot be undone.')
92
+
93
+ confirmation = input(f'To confirm deletion, please type the data record name "{record.name}": ')
94
+ if confirmation != record.name:
95
+ print('Data record name does not match. Deletion cancelled.')
96
+ return
97
+
98
+ record.delete()
99
+ print(f'Data record {record.uri} has been deleted.')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybiolib
3
- Version: 1.2.1144
3
+ Version: 1.2.1151
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  Keywords: biolib
@@ -1,5 +1,5 @@
1
1
  biolib/__init__.py,sha256=o0cpNzP7OwPYfdw5Cq-XgsMYooQdQynZTUO3W-LFuKo,10657
2
- biolib/_data_record/data_record.py,sha256=zKvnh5T-dIVY46-kgVzMBoZ666ZhcTCFQnWvZT0D6RM,12026
2
+ biolib/_data_record/data_record.py,sha256=BM2WEBnn13reSiAqhBtcV8FLewFWSTcMmFV0bD74bM0,12489
3
3
  biolib/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  biolib/_internal/add_copilot_prompts.py,sha256=wcIdrceFcfKSoEjvM4uNzhKZ0I1-MCFkfNO4duqtGHA,1861
5
5
  biolib/_internal/add_gui_files.py,sha256=MrtvkIpe70tVVJYBBsMbRhjsxf55hFzlzn-ea2oinTc,2218
@@ -96,7 +96,7 @@ biolib/biolib_errors.py,sha256=eyQolC4oGi350BDEMOd-gAHYVqo2L2lYgv6c4ZdXPjQ,1184
96
96
  biolib/biolib_logging.py,sha256=Y3qALGNYaTHdXP2aPFNWfxN71pk2Z3syMG6XrYcRZT8,2863
97
97
  biolib/cli/__init__.py,sha256=IHC2bEyA27pvgp-18SGfFVJOP456elanz7suDP8D084,1316
98
98
  biolib/cli/auth.py,sha256=p9ZGY6ld2rnMbpsuRskvIQJNUHlSgYgcLTDsYGyUwyw,1407
99
- biolib/cli/data_record.py,sha256=t8DfJK2EZ_SNZ9drDA_N5Jqy8DNwf9f5SlFrIaOvtv0,3501
99
+ biolib/cli/data_record.py,sha256=ypNr-MK_3bvJv0wkZ4V1p_4cU9gfGvFoeXTtghnhrQE,4078
100
100
  biolib/cli/download_container.py,sha256=HIZVHOPmslGE5M2Dsp9r2cCkAEJx__vcsDz5Wt5LRos,483
101
101
  biolib/cli/init.py,sha256=oGo178h_GlDieWjBqHDLAejeUhVKm5ZJnI_o2YqbEZ0,8366
102
102
  biolib/cli/lfs.py,sha256=z2qHUwink85mv9yDgifbVKkVwuyknGhMDTfly_gLKJM,4151
@@ -157,8 +157,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
157
157
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
158
158
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
159
159
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
160
- pybiolib-1.2.1144.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
161
- pybiolib-1.2.1144.dist-info/METADATA,sha256=WPrOMwzh3qoKo6NEAXTbvhA28V0mhgd8bNOJ-W_vKOM,1571
162
- pybiolib-1.2.1144.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
163
- pybiolib-1.2.1144.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
164
- pybiolib-1.2.1144.dist-info/RECORD,,
160
+ pybiolib-1.2.1151.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
161
+ pybiolib-1.2.1151.dist-info/METADATA,sha256=Bh16IOuD7nJW0zGBpjUyvyjDw1TjVsvFNybYupwZ_Cs,1571
162
+ pybiolib-1.2.1151.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
163
+ pybiolib-1.2.1151.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
164
+ pybiolib-1.2.1151.dist-info/RECORD,,