---
name: benchweave-sdk
description: >
  Offline authoring and conformance tools for BenchWeave OTDP device plugins. Use when writing Python code that uses the benchweave_sdk package.
license: MIT
compatibility: Requires Python >=3.13.
---

# BenchWeave

Offline authoring and conformance tools for BenchWeave OTDP device plugins.

## Installation

```bash
pip install benchweave-sdk
```

## API overview

### Protocols

Protocol / structural-typing interfaces

- `Adapter`: Structural contract for a device plugin adapter
- `HostServices`: Scoped host services: clocks, transport, and evidence recording
- `OperationContext`: Per-operation identity, deadline, and cancellation state
- `interfaces.CaptureServices`

### Testing doubles

Deterministic, hardware-free host and context doubles

- `testing.MockHost`
- `testing.MockContext`
- `testing.ConformanceError`

### Conformance

Reusable adapter lifecycle and operation checks

- `conformance.check_operation`
- `conformance.check_lifecycle`

### Validation

Offline schema and semantic checks against the vendored contracts

- `validation.contract_documents`
- `validation.validate`
- `validation.validate_request`
- `validation.validate_result`
- `validation.validate_descriptor`

### Presentation

Offline presentation validation and bounded, symlink-refusing reads

- `presentation.read_file`
- `presentation.check_ui`
- `presentation.validate_preset`
- `presentation.validate_presentation`
- `presentation.load_validated_preview_inputs`
- `presentation.ValidatedPreviewInputs`
- `presentation.resolve_preset_action`

### Packaging

Deterministic bundle inventory helpers

- `packaging.inventory`
- `packaging.verify_inventory`

## Resources

- [Full documentation](https://madeinoz67.github.io/benchweave-sdk/docs/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
- [Source code](https://github.com/madeinoz67/benchweave-sdk)
