Registry / http-networking / benchling-api-client

benchling-api-client

JSON →
library2.0.436pypypi✓ verified 83d ago

An autogenerated Python client library providing programmatic access to the Benchling API. It is generated from Benchling's OpenAPI specification, ensuring it stays up-to-date with the latest API changes. As an auto-generated client, its release cadence typically follows updates to the underlying API specification.

pip install benchling-api-client
INSTALL
IMPORT
SIG · BENCHLING-API-CLIE
B
benchling-api-client
http-networkingpythonv2.0.436
Install
8.1s avg
Import
Disk
99MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.436 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 90.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 8.1s · import 0.000s · 91MB
99MB installed
● package 99MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BenchlingClient
import benchling_api_client
from benchling_api_client import BenchlingClient

This quickstart demonstrates how to initialize the Benchling API client using environment variables for credentials and make a simple call to list users. It highlights the required host format and accessing specific API endpoints via the client instance. The code includes a check for unset environment variables.

import os from benchling_api_client import BenchlingClient, Configuration # Benchling API keys are typically associated with a specific tenant. # Set these environment variables: BENCHLING_TENANT_NAME, BENCHLING_API_KEY # Example host: https://my-org.benchling.com/api/v2 benchling_tenant = os.environ.get('BENCHLING_TENANT_NAME', 'YOUR_TENANT_NAME') benchling_api_key = os.environ.get('BENCHLING_API_KEY', 'YOUR_API_KEY') if benchling_tenant == 'YOUR_TENANT_NAME' or benchling_api_key == 'YOUR_API_KEY': print("Please set BENCHLING_TENANT_NAME and BENCHLING_API_KEY environment variables.") else: try: configuration = Configuration( host=f"https://{benchling_tenant}.benchling.com/api/v2", api_key={'api_key': benchling_api_key} ) with BenchlingClient(configuration=configuration) as client: # The client provides direct access to various API namespaces (e.g., users, aa_sequences) users_api = client.users # List users, retrieving only the first page for demonstration response = users_api.list_users(page_size=1) if response.users: print(f"Found user: {response.users[0].handle} (ID: {response.users[0].id})") else: print("No users found or accessible with this API key.") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingMajor version updates (e.g., from 1.x to 2.x) in auto-generated clients frequently introduce breaking changes due to underlying API specification evolution. This can include altered method signatures, renamed parameters, or changes in data model structures.
fix
Refer to the official Benchling API documentation and the client's GitHub release notes for specific migration guides when upgrading across major versions.
affects: <2.0.0
gotchaMany list endpoints in the Benchling API (e.g., `list_users`, `list_aa_sequences`) are paginated. To retrieve all results, you must iterate through pages using the `next_token` parameter from the response.
fix
Implement a loop that continuously calls the list method, passing the `next_token` from the previous response until no `next_token` is returned.
affects: All versions
gotchaThe `host` configuration must be precise, including the `https://` prefix, your tenant name, and the `/api/v2` suffix (e.g., `https://my-org.benchling.com/api/v2`). Omitting parts of this URL is a common configuration error.
fix
Ensure your `host` string exactly matches the expected format for your Benchling tenant.
affects: All versions
gotchaAPI keys have specific scopes and permissions. If you encounter `403 Forbidden` errors, it likely indicates that your API key lacks the necessary permissions for the operation you are attempting. The client itself cannot bypass these API-level restrictions.
fix
Verify that your Benchling API key has the required read/write permissions for the specific resources and operations. Consult your Benchling tenant administrator or the Benchling API documentation on permissions.
affects: All versions
Upgrade
Version history
2.0.436latest on PyPI · released May 20, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
benchling-api-client — pip install benchling-api-client · libregistry