pybiolib 1.2.783__py3-none-any.whl → 1.2.796__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.
@@ -4,11 +4,14 @@ from collections import OrderedDict
4
4
  from biolib import api
5
5
  from biolib._internal.types.experiment import DeprecatedExperimentDict, ExperimentDict
6
6
  from biolib._internal.types.resource import ResourceDetailedDict
7
+ from biolib._internal.utils import open_browser_window_from_notebook
8
+ from biolib.biolib_api_client import BiolibApiClient
7
9
  from biolib.biolib_errors import BioLibError
8
10
  from biolib.jobs.job import Job
9
11
  from biolib.jobs.types import JobsPaginatedResponse
10
12
  from biolib.tables import BioLibTable
11
13
  from biolib.typing_utils import Dict, List, Optional, Union
14
+ from biolib.utils import IS_RUNNING_IN_NOTEBOOK
12
15
 
13
16
 
14
17
  class Experiment:
@@ -42,6 +45,10 @@ class Experiment:
42
45
  def uuid(self) -> str:
43
46
  return self._resource_dict['uuid']
44
47
 
48
+ @property
49
+ def id(self) -> str:
50
+ return self.uuid
51
+
45
52
  @property
46
53
  def name(self) -> str:
47
54
  return self._resource_dict['name']
@@ -235,3 +242,20 @@ class Experiment:
235
242
 
236
243
  def _refetch(self) -> None:
237
244
  self._resource_dict = self._get_resource_dict_by_uuid(uuid=self._resource_dict['uuid'])
245
+
246
+ def open_browser(self) -> None:
247
+ """Open a browser window to view this experiment.
248
+
249
+ If running in a notebook, this will attempt to open a new browser window.
250
+ Otherwise, it will print a URL that you can copy and paste.
251
+ """
252
+ api_client = BiolibApiClient.get()
253
+ url_to_open = f'{api_client.base_url}/experiments/{self.id}/'
254
+
255
+ if IS_RUNNING_IN_NOTEBOOK:
256
+ print(f'Opening experiment page at: {url_to_open}')
257
+ print('If your browser does not open automatically, click on the link above.')
258
+ open_browser_window_from_notebook(url_to_open)
259
+ else:
260
+ print('Please copy and paste the following link into your browser:')
261
+ print(url_to_open)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybiolib
3
- Version: 1.2.783
3
+ Version: 1.2.796
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  Keywords: biolib
@@ -111,7 +111,7 @@ biolib/compute_node/webserver/webserver_types.py,sha256=2t8EaFKESnves3BA_NBdnS2y
111
111
  biolib/compute_node/webserver/webserver_utils.py,sha256=XWvwYPbWNR3qS0FYbLLp-MDDfVk0QdaAmg3xPrT0H2s,4234
112
112
  biolib/compute_node/webserver/worker_thread.py,sha256=7uD9yQPhePYvP2HCJ27EeZ_h6psfIWFgqm1RHZxzobs,12483
113
113
  biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
- biolib/experiments/experiment.py,sha256=OTUPOY_F5qo22oFi3acnRMmG0pcmP6ZfoQncFkcTYDQ,9478
114
+ biolib/experiments/experiment.py,sha256=gY1-d7FgVrcQO3YzOJ0mHS6j7z7rl5XzXEuk7dFi1gU,10460
115
115
  biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
116
116
  biolib/jobs/job.py,sha256=X33-s9u8x3uZI0x_fSDgEFAW0ke-8Qi96M-VB-W29MA,26703
117
117
  biolib/jobs/job_result.py,sha256=rALHiKYNaC9lHi_JJqBob1RubzNLwG9Z386kwRJjd2M,5885
@@ -131,8 +131,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
131
131
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
132
132
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
133
133
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
134
- pybiolib-1.2.783.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
135
- pybiolib-1.2.783.dist-info/METADATA,sha256=1fqV7KqHOFEbKUZs1XDGqOKjRXDV95ysP3_eaLJSBjg,1570
136
- pybiolib-1.2.783.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
137
- pybiolib-1.2.783.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
138
- pybiolib-1.2.783.dist-info/RECORD,,
134
+ pybiolib-1.2.796.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
135
+ pybiolib-1.2.796.dist-info/METADATA,sha256=SoMz2oMjXUwS383J9ynDCIVIRFV_Bi0wXXMluw78JWg,1570
136
+ pybiolib-1.2.796.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
137
+ pybiolib-1.2.796.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
138
+ pybiolib-1.2.796.dist-info/RECORD,,