技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
benchling-integration【数据与研究】Integrate with the Benchling R&D platform when you need to programmatically manage registry entities, inventory, ELN entries, workflows, events, or data warehouse analytics via API/SDK.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
references/ for task-specific guidance.Python: 3.10+. Repository baseline for current packaged skills.Third-party packages: not explicitly version-pinned in this skill package. Add pinned versions if this skill needs stricter environment control.Skill directory: 20260316/scientific-skills/Others/benchling-integration
No packaged executable script was detected.
Use the documented workflow in SKILL.md together with the references/assets in this folder.
Example run plan:
SKILL.md.references/ contains supporting rules, prompts, or checklists.Use this skill when you need to:
Additional reference docs may exist in
references/(e.g.,references/authentication.md,references/sdk_reference.md,references/api_endpoints.md) for deeper guidance.
benchling-sdk (Python) — version: not specified in source documentbiopython — version: not specified in source documentA minimal, runnable example that authenticates with an API key, creates a DNA sequence, lists sequences (paginated), and creates an ELN entry.
import os
from benchling_sdk.benchling import Benchling
from benchling_sdk.auth.api_key_auth import ApiKeyAuth
from benchling_sdk.models import DnaSequenceCreate, EntryCreate
def main():
tenant_url = os.environ["BENCHLING_TENANT_URL"] # e.g. https://your-tenant.benchling.com
api_key = os.environ["BENCHLING_API_KEY"]
folder_id = os.environ["BENCHLING_FOLDER_ID"] # e.g. fld_abc123
benchling = Benchling(
url=tenant_url,
auth_method=ApiKeyAuth(api_key),
)
# 1) Create a DNA sequence in the Registry (unregistered unless entity_registry_id is provided)
created_seq = benchling.dna_sequences.create(
DnaSequenceCreate(
name="Example Plasmid",
bases="ATCGATCG",
is_circular=True,
folder_id=folder_id,
)
)
print("Created DNA sequence:", created_seq.id, created_seq.name)
# 2) List DNA sequences (generator yields pages)
print("\nListing DNA sequences (first page):")
pages = benchling.dna_sequences.list()
first_page = next(iter(pages))
for seq in first_page:
print("-", seq.id, seq.name)
# 3) Create an ELN entry
entry = benchling.entries.create(
EntryCreate(
name="Example Experiment Entry",
folder_id=folder_id,
)
)
print("\nCreated ELN entry:", entry.id, entry.name)
if __name__ == "__main__":
main()
Run:
export BENCHLING_TENANT_URL="https://your-tenant.benchling.com"
export BENCHLING_API_KEY="your_api_key"
export BENCHLING_FOLDER_ID="fld_abc123"
python benchling_example.py
from benchling_sdk.benchling import Benchling
from benchling_sdk.auth.api_key_auth import ApiKeyAuth
benchling = Benchling(
url="https://your-tenant.benchling.com",
auth_method=ApiKeyAuth("your_api_key"),
)
from benchling_sdk.benchling import Benchling
from benchling_sdk.auth.client_credentials_oauth2 import ClientCredentialsOAuth2
auth_method = ClientCredentialsOAuth2(
client_id="your_client_id",
client_secret="your_client_secret",
)
benchling = Benchling(
url="https://your-tenant.benchling.com",
auth_method=auth_method,
)
DnaSequenceCreate.fields() helper.from benchling_sdk.models import DnaSequenceCreate
sequence = benchling.dna_sequences.create(
DnaSequenceCreate(
name="My Plasmid",
bases="ATCGATCG",
is_circular=True,
folder_id="fld_abc123",
schema_id="ts_abc123", # optional
fields=benchling.models.fields({"gene_name": "GFP"}),
)
)
entity_registry_id and naming_strategy should not be used together.sequence = benchling.dna_sequences.create(
DnaSequenceCreate(
name="My Plasmid",
bases="ATCGATCG",
is_circular=True,
folder_id="fld_abc123",
entity_registry_id="src_abc123",
naming_strategy="NEW_IDS", # do not combine with entity_registry_id per source note
)
)
from benchling_sdk.models import DnaSequenceUpdate
updated = benchling.dna_sequences.update(
sequence_id="seq_abc123",
dna_sequence=DnaSequenceUpdate(
name="Updated Plasmid Name",
fields=benchling.models.fields({"gene_name": "mCherry"}),
),
)
estimated_count().sequences = benchling.dna_sequences.list()
for page in sequences:
for seq in page:
print(seq.name, seq.id)
total = sequences.estimated_count()
ContainerCreate, BoxCreate).from benchling_sdk.models import ContainerCreate, BoxCreate
box = benchling.boxes.create(
BoxCreate(
name="Freezer Box A1",
schema_id="box_schema_abc123",
parent_storage_id="loc_abc123",
)
)
container = benchling.containers.create(
ContainerCreate(
name="Sample Tube 001",
schema_id="cont_schema_abc123",
parent_storage_id=box.id,
fields=benchling.models.fields({"concentration": "100 ng/μL"}),
)
)
benchling.containers.transfer(
container_id=container.id,
destination_id="box_xyz789",
)
from benchling_sdk.helpers.tasks import wait_for_task
result = wait_for_task(
benchling,
task_id="task_abc123",
interval_wait_seconds=2,
max_wait_seconds=300,
)
from benchling_sdk.benchling import Benchling
from benchling_sdk.auth.api_key_auth import ApiKeyAuth
from benchling_sdk.retry import RetryStrategy
benchling = Benchling(
url="https://your-tenant.benchling.com",
auth_method=ApiKeyAuth("your_api_key"),
retry_strategy=RetryStrategy(max_retries=3),
)
benchling_integration_result.md unless the skill documentation defines a better convention.Run this minimal verification path before full execution when possible:
No local script validation step is required for this skill.
Expected output format:
Result file: benchling_integration_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any