pybiolib 1.1.1934__py3-none-any.whl → 1.1.1942__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.
@@ -1,4 +1,5 @@
1
1
  import json
2
+ import re
2
3
 
3
4
  from biolib import api
4
5
  from biolib.typing_utils import Optional, TypedDict, cast
@@ -45,6 +46,17 @@ class Runtime:
45
46
  def get_app_uri() -> str:
46
47
  return Runtime._get_job_data()['app_uri']
47
48
 
49
+ @staticmethod
50
+ def get_secret(secret_name: str) -> bytes:
51
+ assert re.match(
52
+ '^[a-zA-Z0-9_-]*$', secret_name
53
+ ), 'Secret name can only contain alphanumeric characters and dashes or underscores '
54
+ try:
55
+ with open(f'/biolib/secrets/{secret_name}', 'rb') as file:
56
+ return file.read()
57
+ except BaseException as error:
58
+ raise BioLibRuntimeError(f'Unable to get system secret: {secret_name}') from error
59
+
48
60
  @staticmethod
49
61
  def set_main_result_prefix(result_prefix: str) -> None:
50
62
  job_data = Runtime._get_job_data()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.1.1934
3
+ Version: 1.1.1942
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -7,7 +7,7 @@ biolib/_internal/data_record/data_record.py,sha256=ctijrrZ-LfUxtwzS8PEVa1VBuBLVW
7
7
  biolib/_internal/data_record/remote_storage_endpoint.py,sha256=LPq8Lr5FhKF9_o5K-bUdT7TeLe5XFUD0AAeTkNEVZug,1133
8
8
  biolib/_internal/http_client.py,sha256=DdooXei93JKGYGV4aQmzue_oFzvHkozg2UCxgk9dfDM,5081
9
9
  biolib/_internal/push_application.py,sha256=H1PGNtVJ0vRC0li39gFMpPpjm6QeZ8Ob-7cLkLmxS_Y,10009
10
- biolib/_internal/runtime.py,sha256=Ey8_3FqL8Fi3Wrb7OyLi5WrtShOs6zLbFfpzANfJRcE,2569
10
+ biolib/_internal/runtime.py,sha256=BnFvRWYnxPXCgOtfxupN255Zxx9Gw6oPZyzUIGODw3k,3060
11
11
  biolib/_internal/utils/__init__.py,sha256=p5vsIFyu-zYqBgdSMfwW9NC_jk7rXvvCbV4Bzd3As7c,630
12
12
  biolib/api/__init__.py,sha256=iIO8ZRdn7YDhY5cR47-Wo1YsNOK8H6RN6jn8yor5WJI,137
13
13
  biolib/api/client.py,sha256=MtDkH2Amr2Fko-bCR5DdookJu0yZ1q-6K_PPg4KK_Ek,2941
@@ -105,8 +105,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
105
105
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
106
106
  biolib/utils/seq_util.py,sha256=jC5WhH63FTD7SLFJbxQGA2hOt9NTwq9zHl_BEec1Z0c,4907
107
107
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
108
- pybiolib-1.1.1934.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
109
- pybiolib-1.1.1934.dist-info/METADATA,sha256=ghE4y_tINPJKQk-bmkx5eD_qIOSs62-g0fyC1bEfjBQ,1508
110
- pybiolib-1.1.1934.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
- pybiolib-1.1.1934.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
112
- pybiolib-1.1.1934.dist-info/RECORD,,
108
+ pybiolib-1.1.1942.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
109
+ pybiolib-1.1.1942.dist-info/METADATA,sha256=Pwe_8XEyKXVlgndcOctndELApx5t-8KLDuAc3EJFDis,1508
110
+ pybiolib-1.1.1942.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
111
+ pybiolib-1.1.1942.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
112
+ pybiolib-1.1.1942.dist-info/RECORD,,