SDK for interacting with the Benchling Platform. Currently unsupported for production use.
Project description
Benchling SDK
A Python 3.8+ SDK for the Benchling platform.
Important! This is an unsupported pre-release not suitable for production use.
Getting Started
Installation
Install the dependency via Poetry (if applicable):
poetry add benchling-sdk
Or Pip:
pip install benchling-sdk
Using the SDK
Obtain a valid API key from your Benchling account and provide it to the SDK, along with the URL for the server. Example:
from benchling_sdk.benchling import Benchling
benchling = Benchling(url="https://my.benchling.com/api/v2", api_key="secure_api_key")
With Benchling
now instantiated, make a sample call to all requests with the schema ID assaych_test
:
requests = benchling.requests.list_all("assaych_test")
In general, API calls are synchronous and blocking.
Generators
Some methods which call paginated API endpoints will produce Python generators. Example:
requests_generator = benchling.requests.list("assaych_test")
next_request = next(requests_generator)
Error Handling
Failed API interactions will generally return a BenchlingError
, which will contain some underlying
information on the HTTP response such as the status. Example:
from benchling_sdk.errors import BenchlingError
try:
requests = benchling.requests.list_all("assaych_test")
except BenchlingError as error:
print(error.status_code)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for benchling_sdk-0.3.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 873cc0661597b1decf0fe95459fe9f7bb7e14f2daf444f2b59a308698662f019 |
|
MD5 | 3de4e5f1e1c28f8c4c36da863b2d646a |
|
BLAKE2b-256 | 1901f4dc282c7cd9eb1b40646f4b11a04f884c73d8028787ed0572e4a86c50f6 |