pybiolib 1.1.2184__py3-none-any.whl → 1.1.2191__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.
@@ -156,7 +156,7 @@ class DataRecord:
156
156
  return DataRecord(_internal_state=get_data_record_state_from_uri(uri))
157
157
 
158
158
  @staticmethod
159
- def create(destination: str, data_path: Optional[str] = None) -> 'DataRecord':
159
+ def create(destination: str, data_path: Optional[str] = None, record_type: Optional[str] = None) -> 'DataRecord':
160
160
  BiolibApiClient.assert_is_signed_in(authenticated_action_description='create a Data Record')
161
161
  if data_path is not None:
162
162
  assert os.path.isdir(data_path), f'The path "{data_path}" is not a directory.'
@@ -167,12 +167,11 @@ class DataRecord:
167
167
  record_name = 'data-record-' + datetime.now().isoformat().split('.')[0].replace(':', '-')
168
168
  data_record_uri = f'{destination}/{record_name}'
169
169
 
170
- uri_parsed = parse_app_uri(data_record_uri)
171
170
  response = api.client.post(
172
- path='/lfs/',
171
+ path='/resources/data-records/',
173
172
  data={
174
- 'account_handle': uri_parsed['account_handle_normalized'],
175
- 'name': uri_parsed['app_name'],
173
+ 'uri': data_record_uri,
174
+ 'type': record_type,
176
175
  },
177
176
  )
178
177
  data_record_info: DataRecordInfo = response.json()
biolib/cli/data_record.py CHANGED
@@ -19,8 +19,9 @@ def data_record() -> None:
19
19
  @data_record.command(help='Create a Data Record')
20
20
  @click.argument('uri', required=True)
21
21
  @click.option('--data-path', required=True, type=click.Path(exists=True))
22
- def create(uri: str, data_path: str) -> None:
23
- DataRecord.create(destination=uri, data_path=data_path)
22
+ @click.option('--record-type', required=False, type=str, default=None)
23
+ def create(uri: str, data_path: str, record_type: Optional[str]) -> None:
24
+ DataRecord.create(destination=uri, data_path=data_path, record_type=record_type)
24
25
 
25
26
 
26
27
  @data_record.command(help='Update a Data Record')
biolib/sdk/__init__.py CHANGED
@@ -1,12 +1,14 @@
1
+ from typing import Optional
2
+
1
3
  # Imports to hide and use as private internal utils
2
4
  from biolib._data_record.data_record import DataRecord as _DataRecord
3
5
  from biolib._internal.push_application import push_application as _push_application
4
6
  from biolib._internal.push_application import set_app_version_as_active as _set_app_version_as_active
7
+ from biolib._runtime.runtime import Runtime as _Runtime
5
8
  from biolib.app import BioLibApp as _BioLibApp
6
- from biolib.typing_utils import Optional as _Optional
7
9
 
8
10
  # Classes to expose as public API
9
- from biolib._runtime.runtime import Runtime
11
+ Runtime = _Runtime
10
12
 
11
13
 
12
14
  def push_app_version(uri: str, path: str) -> _BioLibApp:
@@ -31,7 +33,7 @@ def get_app_version_pytest_plugin(app_version: _BioLibApp):
31
33
  except BaseException:
32
34
  raise Exception('Failed to import pytest; please make sure it is installed') from None
33
35
 
34
- class AppVersionFixturePlugin(object):
36
+ class AppVersionFixturePlugin:
35
37
  def __init__(self, app_version_ref):
36
38
  self.app_version_ref = app_version_ref
37
39
 
@@ -42,9 +44,14 @@ def get_app_version_pytest_plugin(app_version: _BioLibApp):
42
44
  return AppVersionFixturePlugin(app_version)
43
45
 
44
46
 
45
- def create_data_record(destination: str, data_path: str, name: _Optional[str] = None) -> _DataRecord:
46
- if name:
47
- destination_with_name = f"{destination}/{name}"
48
- else:
49
- destination_with_name = destination
50
- return _DataRecord.create(destination_with_name, data_path)
47
+ def create_data_record(
48
+ destination: str,
49
+ data_path: str,
50
+ name: Optional[str] = None,
51
+ record_type: Optional[str] = None,
52
+ ) -> _DataRecord:
53
+ return _DataRecord.create(
54
+ destination=f'{destination}/{name}' if name else destination,
55
+ data_path=data_path,
56
+ record_type=record_type,
57
+ )
biolib/utils/seq_util.py CHANGED
@@ -35,7 +35,7 @@ class SeqUtil:
35
35
  input_file: Union[str, BufferedIOBase, None] = None,
36
36
  default_header: Optional[str] = None,
37
37
  allow_any_sequence_characters: bool = False,
38
- allow_empty_sequence: bool = False,
38
+ allow_empty_sequence: bool = True,
39
39
  file_name: Optional[str] = None,
40
40
  ) -> List[SeqUtilRecord]:
41
41
  if input_file is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.1.2184
3
+ Version: 1.1.2191
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -1,7 +1,7 @@
1
1
  LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
2
2
  README.md,sha256=_IH7pxFiqy2bIAmaVeA-iVTyUwWRjMIlfgtUbYTtmls,368
3
3
  biolib/__init__.py,sha256=_tThyzISH81yS9KXP_X3qEiKXmsIp5XOBcJIODfLVnc,4338
4
- biolib/_data_record/data_record.py,sha256=6PD-jBgWU2Cc4PwT-hLNPTFZygb4r0LBL617U-1eijE,12633
4
+ biolib/_data_record/data_record.py,sha256=CoyYRse5VdUBhQzzPfR9BkytgOsM-IZxkfMX1kyRnPk,12589
5
5
  biolib/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  biolib/_internal/data_record/__init__.py,sha256=fGdME6JGRU_2VxpJbYpGXYndjN-feUkmKY4fuMyq3cg,76
7
7
  biolib/_internal/data_record/data_record.py,sha256=YmaAABR57goDCE8-rKb2j0FPMSbDtRPCm_HhT3mM074,4299
@@ -57,7 +57,7 @@ biolib/biolib_errors.py,sha256=5m4lK2l39DafpoXBImEBD4EPH3ayXBX0JgtPzmGClow,689
57
57
  biolib/biolib_logging.py,sha256=J3E5H_LL5k6ZUim2C8gqN7E6lCBZMTpO4tnMpOPwG9U,2854
58
58
  biolib/cli/__init__.py,sha256=0v3c_J-U0k46c5ZWeQjLG_kTaKDJm81LBxQpDO2B_aI,1286
59
59
  biolib/cli/auth.py,sha256=rpWGmXs6Fz6CGrO9K8ibPRszOdXG78Vig_boKaVCD9A,2082
60
- biolib/cli/data_record.py,sha256=oDy8U6mv-h-hbeMihXRzVEvM-WrGQq6oBiBl3xDRaXs,3220
60
+ biolib/cli/data_record.py,sha256=08JbZkFWKMo0PrnhhG0jQEKnNW7pPLti9cOw8s1TWfI,3344
61
61
  biolib/cli/download_container.py,sha256=HIZVHOPmslGE5M2Dsp9r2cCkAEJx__vcsDz5Wt5LRos,483
62
62
  biolib/cli/init.py,sha256=wQOfii_au-d30Hp7DdH-WVw-WVraKvA_zY4za1w7DE8,821
63
63
  biolib/cli/lfs.py,sha256=z2qHUwink85mv9yDgifbVKkVwuyknGhMDTfly_gLKJM,4151
@@ -103,7 +103,7 @@ biolib/jobs/job.py,sha256=OfG8cLd3AjGjiMWRlJRZdVVbLsRWSX-OM5nxJhR6mPQ,19136
103
103
  biolib/jobs/job_result.py,sha256=rALHiKYNaC9lHi_JJqBob1RubzNLwG9Z386kwRJjd2M,5885
104
104
  biolib/jobs/types.py,sha256=qhadtH2KDC2WUOOqPiwke0YgtQY4FtuB71Stekq1k48,970
105
105
  biolib/runtime/__init__.py,sha256=MlRepA11n2H-3plB5rzWyyHK2JmP6PiaP3i6x3vt0mg,506
106
- biolib/sdk/__init__.py,sha256=qJ_V_Edxolzi4VBQCrvem5lYIkJ0FVH3VZepSDuXjTc,1895
106
+ biolib/sdk/__init__.py,sha256=amVp_jMxi2nqCcTsmL2aKUNGCAH3Yk4EzAnps9d1VH8,1928
107
107
  biolib/tables.py,sha256=acH7VjwAbadLo8P84FSnKEZxCTVsF5rEg9VPuxElNs8,872
108
108
  biolib/templates/__init__.py,sha256=Yx62sSyDCDesRQDQgmbDsLpfgEh93fWE8r9u4g2azXk,36
109
109
  biolib/templates/example_app.py,sha256=EB3E3RT4SeO_ii5nVQqJpi5KDGNE_huF1ub-e5ZFveE,715
@@ -114,10 +114,10 @@ biolib/utils/__init__.py,sha256=fwjciJyJicvYyZcVTzfDBgD0SKY13DeXqvTeG4qZIy8,5548
114
114
  biolib/utils/app_uri.py,sha256=Yq_-_VGugQhMMo6mM5f0G9yNlLkr0WK4j0Nrf3FE4xQ,2171
115
115
  biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3100
116
116
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
117
- biolib/utils/seq_util.py,sha256=WieuQ2RvV4QSJFUAMRVyvKXFs3YanFAmjh-CFIaQmQk,5184
117
+ biolib/utils/seq_util.py,sha256=ZQFcaE37B2dtucN2zDjOmdya_X0ITc1zBFZJNQY13XA,5183
118
118
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
119
- pybiolib-1.1.2184.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
120
- pybiolib-1.1.2184.dist-info/METADATA,sha256=oiLPHe9yf3WdQZ9ChOjRqqPki4p_e3jZL_V5jtjoXOM,1508
121
- pybiolib-1.1.2184.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
122
- pybiolib-1.1.2184.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
123
- pybiolib-1.1.2184.dist-info/RECORD,,
119
+ pybiolib-1.1.2191.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
120
+ pybiolib-1.1.2191.dist-info/METADATA,sha256=rKlCDAj0A1ygrKqBGIyZKZy_fy723ESDGg79nYwGoOg,1508
121
+ pybiolib-1.1.2191.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
122
+ pybiolib-1.1.2191.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
123
+ pybiolib-1.1.2191.dist-info/RECORD,,