benchling-sdk 1.13.0a1__py3-none-any.whl → 1.14.0__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,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from functools import cached_property
3
4
  from typing import Optional, TYPE_CHECKING
4
5
 
5
6
  from benchling_api_client.v2.stable.client import Client
@@ -23,7 +24,6 @@ class V2Service(BaseService):
23
24
 
24
25
  _v2_alpha_service: Optional[V2AlphaService]
25
26
  _v2_beta_service: Optional[V2BetaService]
26
- _v2_stable_service: Optional[V2StableService]
27
27
 
28
28
  def __init__(self, client: Client, retry_strategy: RetryStrategy = RetryStrategy()):
29
29
  """
@@ -35,7 +35,12 @@ class V2Service(BaseService):
35
35
  super().__init__(client, retry_strategy)
36
36
  self._v2_alpha_service = None
37
37
  self._v2_beta_service = None
38
- self._v2_stable_service = None
38
+
39
+ # Note that alpha & beta do not use the @cached_property pattern that we've used for all other
40
+ # service accessors; instead, we've rolled our own equivalent caching logic using an attribute.
41
+ # That's because we want some additional behavior - logging a warning message - to happen on
42
+ # every call to those property methods, not just on the first call. We could consider changing
43
+ # this in a future release so it only logs once, in which case we can use @cached_property.
39
44
 
40
45
  @property
41
46
  def alpha(self) -> V2AlphaService:
@@ -47,10 +52,12 @@ class V2Service(BaseService):
47
52
  See https://benchling.com/api/v2-alpha/reference
48
53
  """
49
54
  log_stability_warning(StabilityLevel.ALPHA, package="v2.alpha")
55
+
50
56
  if self._v2_alpha_service is None:
51
- from benchling_sdk.services.v2.v2_alpha_service import V2AlphaService
57
+ from .v2.v2_alpha_service import V2AlphaService
58
+
59
+ self._v2_alpha_service = self._create_service(V2AlphaService)
52
60
 
53
- self._v2_alpha_service = V2AlphaService(self._client, self._retry_strategy)
54
61
  return self._v2_alpha_service
55
62
 
56
63
  @property
@@ -64,20 +71,19 @@ class V2Service(BaseService):
64
71
  """
65
72
  log_stability_warning(StabilityLevel.BETA, package="v2.beta")
66
73
  if self._v2_beta_service is None:
67
- from benchling_sdk.services.v2.v2_beta_service import V2BetaService
74
+ from .v2.v2_beta_service import V2BetaService
75
+
76
+ self._v2_beta_service = self._create_service(V2BetaService)
68
77
 
69
- self._v2_beta_service = V2BetaService(self._client, self._retry_strategy)
70
78
  return self._v2_beta_service
71
79
 
72
- @property
80
+ @cached_property
73
81
  def stable(self) -> V2StableService:
74
82
  """
75
83
  Stable.
76
84
 
77
85
  See https://docs.benchling.com/docs/stability#are-breaking-changes-made-to-the-api-or-events
78
86
  """
79
- if self._v2_stable_service is None:
80
- from benchling_sdk.services.v2.v2_stable_service import V2StableService
87
+ from .v2.v2_stable_service import V2StableService
81
88
 
82
- self._v2_stable_service = V2StableService(self._client, self._retry_strategy)
83
- return self._v2_stable_service
89
+ return self._create_service(V2StableService)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: benchling-sdk
3
- Version: 1.13.0a1
3
+ Version: 1.14.0
4
4
  Summary: SDK for interacting with the Benchling Platform.
5
5
  License: Apache-2.0
6
6
  Author: Benchling Support
@@ -17,7 +17,7 @@ Provides-Extra: python-jose
17
17
  Requires-Dist: PyYAML (>=6.0,<7.0)
18
18
  Requires-Dist: attrs (>=20.1.0,<23)
19
19
  Requires-Dist: backoff (>=1.10.0,<2.0.0)
20
- Requires-Dist: benchling-api-client (==2.0.302)
20
+ Requires-Dist: benchling-api-client (==2.0.307)
21
21
  Requires-Dist: certifi (>=2022.12.7)
22
22
  Requires-Dist: cryptography (>=42.0.0) ; extra == "cryptography"
23
23
  Requires-Dist: dataclasses-json (>=0.5.2,<0.6.0)
@@ -27,7 +27,7 @@ benchling_sdk/auth/__init__.py,sha256=N4pJYVUnTLzg5HO9ZldHaI-Am97i6AOCdQS0M5QcVp
27
27
  benchling_sdk/auth/api_key_auth.py,sha256=Ui-cnvGMjcwVPV_b2GdBaoTjEyHJIu9CjtZScVBEUvU,641
28
28
  benchling_sdk/auth/bearer_token_auth.py,sha256=nymI8V91evcnK-TWKkBXZwck8U1qSh4WaseyQbvF-Cg,1268
29
29
  benchling_sdk/auth/client_credentials_oauth2.py,sha256=auHj8FAJxUrDf1HJp9wfmcC_pJ-3rj4tdQbsUIvSUQs,5801
30
- benchling_sdk/benchling.py,sha256=zpthXOtPdGo1-BsjqXo6TcPVNBWadQKHHZnBOD784A0,26428
30
+ benchling_sdk/benchling.py,sha256=jhOPq0CTZOOoWA_BWioR-kuoLxcozSYrY1fR7mqT1Ck,27400
31
31
  benchling_sdk/docs/__init__.py,sha256=ySHo76PzLndmXOVWrF80VjB5Pi48G82CCQNdzUEzbCY,38
32
32
  benchling_sdk/docs/__main__.py,sha256=1ZlGXdn2gHGC0fAuan5i54mh35VkDf5mhY9VeKNyCRA,244
33
33
  benchling_sdk/errors.py,sha256=9JCjkY7wQ-K-_GStgYZrSns35FNExZSx-t5Xdlh-U0I,8239
@@ -43,18 +43,16 @@ benchling_sdk/helpers/response_helpers.py,sha256=vtmb9lEEKy3dRFre3Q0R4XaLBEaS_rr
43
43
  benchling_sdk/helpers/retry_helpers.py,sha256=SeKOPjnJIes6UsD7kVqlYKBYmwH_DCHdllnG3jys3N8,2740
44
44
  benchling_sdk/helpers/serialization_helpers.py,sha256=IUS0uGU_EiZvb8O-bTViUaROmxKcvdX3JeR9iKsWAG8,3662
45
45
  benchling_sdk/helpers/transaction_manager.py,sha256=HcSDsgGK7Rb93bgv6fpb4HvQUT-tqP0lXgVa_bWCDh4,3663
46
- benchling_sdk/models/__init__.py,sha256=KwJzBoEQ9XdYb9ruYRhS1tR3DetDimXkOfNMq2zm3f4,351530
46
+ benchling_sdk/models/__init__.py,sha256=g_tZPB5NyW5EOcNPLlYLfkR24a5dFtVcrX6piEabKDE,360467
47
47
  benchling_sdk/models/webhooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- benchling_sdk/models/webhooks/v0/__init__.py,sha256=fapR6_IeCW11ITYy1ScOFufqgu0EWq3jHD-Dr4rCIHE,9700
48
+ benchling_sdk/models/webhooks/v0/__init__.py,sha256=tEHA5YxF_WPBjvOIT8UxQjxFAnX--fQmReATINpTz7Y,48834
49
49
  benchling_sdk/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
50
50
  benchling_sdk/services/__init__.py,sha256=K7N-sxMKhIsFroLe_tJIRcKJJuoShTCxiD_bfUz9958,85
51
51
  benchling_sdk/services/v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  benchling_sdk/services/v2/alpha/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  benchling_sdk/services/v2/alpha/v2_alpha_app_service.py,sha256=cR3nk6oxV2B-ewcUooQ4iqMZJQaj_wvwGyON2eL08Hc,1443
54
- benchling_sdk/services/v2/alpha/v2_alpha_dna_sequence_service.py,sha256=XzpaPWbdxbwE_LJ5RheKHNAwdjPNfr7-o3IXmJsQ6UI,1347
55
- benchling_sdk/services/v2/base_service.py,sha256=g4Qn001slCJTvqDvRmbImJNBJ8lPJgMVL1H4Xxc8D2o,951
54
+ benchling_sdk/services/v2/base_service.py,sha256=BoplYqaZCk_p9LAJ_U1doEdDD4HmvT9UPfGKeXW53dY,1254
56
55
  benchling_sdk/services/v2/beta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
- benchling_sdk/services/v2/beta/v2_beta_aa_sequence_service.py,sha256=ED5jOL1N5JzuikpVPZNj0Wi5czwTfA9HChQca1fwA3I,1410
58
56
  benchling_sdk/services/v2/beta/v2_beta_app_service.py,sha256=nVOEQ3ESkUo2e4p_MYMq-VUpEx2wNpJIY7ZZ8UuHnuQ,1385
59
57
  benchling_sdk/services/v2/beta/v2_beta_collaboration_service.py,sha256=epLHLdDRfj8ni2-45WWFSpOgQG-kTmbxTffRP1mnim0,5753
60
58
  benchling_sdk/services/v2/beta/v2_beta_data_frame_service.py,sha256=oqCVyYBK7YECXYIDWJ5VIaiAO-W7GXC7xd0Wy1swTmU,14853
@@ -63,7 +61,7 @@ benchling_sdk/services/v2/beta/v2_beta_folder_service.py,sha256=b6-D_eDTF1e2l2YL
63
61
  benchling_sdk/services/v2/beta/v2_beta_project_service.py,sha256=8Wk0u6dtiewytfuJ2RaybMOfqih7YF74cJF_wsetJpM,4926
64
62
  benchling_sdk/services/v2/beta/v2_beta_worklist_service.py,sha256=tFMe-7Wbw3qISe-T5EsnYVsmcd1P8Aw1NoWmNA5MroU,5544
65
63
  benchling_sdk/services/v2/stable/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
- benchling_sdk/services/v2/stable/aa_sequence_service.py,sha256=ttiN9YeezeBmJW8RAyqwwSYRDk2i2EMDNvArgVPsM-w,12935
64
+ benchling_sdk/services/v2/stable/aa_sequence_service.py,sha256=75l2QsE6WZ5EJvSDmImZhGi-kc6TPYCFnVpojOKpB1c,13492
67
65
  benchling_sdk/services/v2/stable/api_service.py,sha256=e0RNp4Jne9UTaHOYMOxxXJpsyUO3WMSFPzN7hB8iliU,12371
68
66
  benchling_sdk/services/v2/stable/app_service.py,sha256=dy9FMVvMiJrkYbxZswKuB37EB9K_jCqQr9FfAa0BMgE,23126
69
67
  benchling_sdk/services/v2/stable/assay_result_service.py,sha256=_qtSpMznVrGHlB2VnHI87IPjVQHCX1pZbLPJ_LYuW7U,13362
@@ -75,10 +73,10 @@ benchling_sdk/services/v2/stable/custom_entity_service.py,sha256=LOATrTh7Vv6dXWl
75
73
  benchling_sdk/services/v2/stable/custom_notation_service.py,sha256=LCnt8hoCkkSRbz-bXUaYbuMaE-1XdYmXB0MgeQ30POc,2141
76
74
  benchling_sdk/services/v2/stable/dna_alignments_service.py,sha256=leJaPt7Uk1PyxfO9LXTVi2DjLyqcXgeMselftJaGJA4,7445
77
75
  benchling_sdk/services/v2/stable/dna_oligo_service.py,sha256=0D3X98UxWWolkCG_IxiPE3oiFMwyqC7vJlJCyEbNDt4,11128
78
- benchling_sdk/services/v2/stable/dna_sequence_service.py,sha256=YkcwrFmWDQpKDtMvdTdaMkiRD9-xd9BtNejb8VWVhnk,15203
76
+ benchling_sdk/services/v2/stable/dna_sequence_service.py,sha256=8s4Lgitf4k-Ma0XuXhvG-68A1v4YXZzvtqt9VgukOUQ,16310
79
77
  benchling_sdk/services/v2/stable/dropdown_service.py,sha256=AcnATXU_TChhSm9NX8dx9wnbxeBwACzThw5zM3yPYmk,4919
80
78
  benchling_sdk/services/v2/stable/entity_service.py,sha256=NGDjng4rwiL6EeDCEs5oy9ciKV6CPv71S1l7A8zM0Uk,2190
81
- benchling_sdk/services/v2/stable/entry_service.py,sha256=nGK8bctxpaeyHFNj-aY53TbTOwGvqbd8xqQgs-nncKI,12935
79
+ benchling_sdk/services/v2/stable/entry_service.py,sha256=7HypcoX0vWDi5hFMtqFO6RpKc6IclO3HMQaWdvKNXyQ,13706
82
80
  benchling_sdk/services/v2/stable/event_service.py,sha256=--j-oqKR-Ld5d4QiJ6aofOr9LTBCM7maqwRvo2goSPA,2538
83
81
  benchling_sdk/services/v2/stable/export_service.py,sha256=T8ir9yRyA8rMUXagLAWYR4cYtOzxt6JxjlnQwExk_HU,1080
84
82
  benchling_sdk/services/v2/stable/feature_library_service.py,sha256=h3vdttbJzWWG-297FedtmDXSFEUP0KVGU5Y2D_VW-KA,9767
@@ -104,14 +102,16 @@ benchling_sdk/services/v2/stable/task_service.py,sha256=61vimlvZf2R93SitGyd883Yk
104
102
  benchling_sdk/services/v2/stable/team_service.py,sha256=SYwI2Bv3rWDYnoEKb-MX_yhe39fErewJ4Sx0aon-ej0,4723
105
103
  benchling_sdk/services/v2/stable/user_service.py,sha256=NkMPz2rPaF6iXNWTBAOWSiXVif2rHYGbYAzaHg4Fhig,7528
106
104
  benchling_sdk/services/v2/stable/warehouse_service.py,sha256=_gVTwJZ5BcaNBG0k8I0a4MRahajkV7TNtREfuQGwR74,1286
105
+ benchling_sdk/services/v2/stable/workflow_flowchart_config_version_service.py,sha256=HqSFSD9EDWaYAkCdHWjqpIPRuQbbNaJKkDHvQaK1Ggk,1323
106
+ benchling_sdk/services/v2/stable/workflow_flowchart_service.py,sha256=wkqk9fwIbOzq7JCAtZDAlc9dV7pw0bk1nhrFEkUd-ls,3158
107
107
  benchling_sdk/services/v2/stable/workflow_output_service.py,sha256=VD0RvOBCkgX_YwUoQYQPR_PyGJXuIau5beq9bK75VXM,9993
108
108
  benchling_sdk/services/v2/stable/workflow_task_group_service.py,sha256=SSfHDH-Eniz09HG_qSPSfSVHU3BpvTbgGhOQS4iWcAw,8848
109
109
  benchling_sdk/services/v2/stable/workflow_task_service.py,sha256=pOhwFmWVk1jh3A9C70LpLhYjlgk2DcGCfjO8Uup9ScQ,12819
110
- benchling_sdk/services/v2/v2_alpha_service.py,sha256=vNfYK0Dheml9ozR_0tzTlA3blPDTdfTQR8ppaQ6xuu4,2609
111
- benchling_sdk/services/v2/v2_beta_service.py,sha256=URRSAdNuoSg322Ej18st0Z4SPBw7-y0udOeBpw2Lomg,7149
112
- benchling_sdk/services/v2/v2_stable_service.py,sha256=zZ9Mrx0TkDwPG62uNAzz79wI2hUwcaSO3qAJX29Fij0,36051
113
- benchling_sdk/services/v2_service.py,sha256=3eoIjYEmGLPdWCpBN0pl7q7_HNWCsUvfvTn3Hcz0wSM,2860
114
- benchling_sdk-1.13.0a1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
115
- benchling_sdk-1.13.0a1.dist-info/METADATA,sha256=EVq5yV_BBQ4QRahzuF9KhzibTR1U9iCgUGQ_ZzVXIno,2118
116
- benchling_sdk-1.13.0a1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
117
- benchling_sdk-1.13.0a1.dist-info/RECORD,,
110
+ benchling_sdk/services/v2/v2_alpha_service.py,sha256=sGj6cG7IkoolrKSBI1AVNIL5te_X6QOPGXn_WmHuSDc,1600
111
+ benchling_sdk/services/v2/v2_beta_service.py,sha256=extNpmdBP9yGQsE4k_CEPkwlqlTT9HGw7F3qiR11cJs,4651
112
+ benchling_sdk/services/v2/v2_stable_service.py,sha256=ASx8MtvZqfKNBMUnuzGwPKdH1gV4e3VnJYy6XSxxyNo,26129
113
+ benchling_sdk/services/v2_service.py,sha256=cGX-Ps0hu7Oh1M7a0tu2zDN8-QG63dNDoK7w4eYo_OQ,3093
114
+ benchling_sdk-1.14.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
115
+ benchling_sdk-1.14.0.dist-info/METADATA,sha256=TuQDQGZXmvpDurCdLql2-IEMN6kte_39pSW1m5bL4MM,2116
116
+ benchling_sdk-1.14.0.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
117
+ benchling_sdk-1.14.0.dist-info/RECORD,,
@@ -1,32 +0,0 @@
1
- from benchling_api_client.v2.alpha.api.dna_sequences import find_matching_regions_dna_sequences
2
- from benchling_api_client.v2.alpha.api.dna_sequences.find_matching_regions_dna_sequences import (
3
- DnaSequencesFindMatchingRegion,
4
- )
5
-
6
- from benchling_sdk.helpers.decorators import api_method
7
- from benchling_sdk.helpers.response_helpers import model_from_detailed
8
- from benchling_sdk.models import AsyncTaskLink
9
- from benchling_sdk.services.v2.base_service import BaseService
10
-
11
-
12
- class V2AlphaDnaSequenceService(BaseService):
13
- """
14
- V2-Alpha DNA Sequences.
15
-
16
- DNA sequences are the bread and butter of the Benchling Molecular Biology suite. On Benchling, these are
17
- comprised of a string of nucleotides and collections of other attributes, such as annotations and primers.
18
-
19
- See https://benchling.com/api/v2-alpha/reference#/DNA%20Sequences
20
- """
21
-
22
- @api_method
23
- def find_matching_regions(self, find_matching_region: DnaSequencesFindMatchingRegion) -> AsyncTaskLink:
24
- """
25
- Find matching regions for DNA sequences.
26
-
27
- See https://benchling.com/api/v2-alpha/reference#/DNA%20Sequences/findMatchingRegionsDnaSequences
28
- """
29
- response = find_matching_regions_dna_sequences.sync_detailed(
30
- client=self.client, json_body=find_matching_region
31
- )
32
- return model_from_detailed(response)
@@ -1,33 +0,0 @@
1
- from benchling_api_client.v2.beta.api.aa_sequences import find_matching_regions_aa_sequences
2
- from benchling_api_client.v2.beta.models.aa_sequences_find_matching_region import (
3
- AaSequencesFindMatchingRegion,
4
- )
5
-
6
- from benchling_sdk.helpers.decorators import api_method
7
- from benchling_sdk.helpers.response_helpers import model_from_detailed
8
- from benchling_sdk.models import AsyncTaskLink
9
- from benchling_sdk.services.v2.base_service import BaseService
10
-
11
-
12
- class V2BetaAaSequenceService(BaseService):
13
- """
14
- V2-Beta AA Sequences.
15
-
16
- AA Sequences are the working units of cells that make everything run (they help make structures, catalyze
17
- reactions and allow for signaling - a kind of internal cell communication). On Benchling, these are comprised
18
- of a string of amino acids and collections of other attributes, such as annotations.
19
-
20
- See https://benchling.com/api/v2-beta/reference#/AA%20Sequences
21
- """
22
-
23
- @api_method
24
- def find_matching_regions(self, find_matching_region: AaSequencesFindMatchingRegion) -> AsyncTaskLink:
25
- """
26
- Find matching regions for AA sequences.
27
-
28
- See https://benchling.com/api/v2-beta/reference#/AA%20Sequences/findMatchingRegionsAaSequences
29
- """
30
- response = find_matching_regions_aa_sequences.sync_detailed(
31
- client=self.client, json_body=find_matching_region
32
- )
33
- return model_from_detailed(response)