Metadata-Version: 2.4
Name: benhw
Version: 1.0.0
Summary: BenHW DLL wrapper library - Provides interface for controlling Bentham hardware including monochromators, detectors, amplifiers, and other optical components.
Author-email: Bentham Instruments Ltd <support@bentham.co.uk>
License-Expression: MIT
Project-URL: Homepage, https://www.bentham.co.uk
Project-URL: Documentation, https://www.bentham.co.uk/software/benhw/
Keywords: bentham,hardware,control,instrumentation,spectroscopy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.txt
Requires-Dist: cffi>=1.15.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: isort>=5.0.0; extra == "dev"
Requires-Dist: mypy>=0.990; extra == "dev"
Dynamic: license-file

# BenHW SDK - Python Interface

Python interface for Bentham Instruments Hardware Control DLL.

## Installation

```bash
pip install benhw
```


## Usage

### Example

```python
from benhw import BenHW, exceptions, tokens

hw = BenHW()

try:
  hw.build_system_model("system.cfg")
  hw.load_setup("setup.atr")
  hw.initialise()
  hw.park()
  hw.select_wavelength(wl=555)
  hw.set("motor1", tokens.MotorPosition, 0, 4455)
  signal = hw.automeasure()
  print(f"signal: {signal}")
except exceptions.BenHWException as e:
  print(f"BenHW error: {e}")

```

### Accessing Tokens and Errors

```python
from benhw import tokens, errors

# Access tokens via namespace
print(tokens.ADCVolts)           # 504
print(tokens.MonochromatorCurrentWL)  # 11

# Access error codes via namespace
print(errors.BI_OK)      # 0
print(errors.BI_error)   # -1
```

## Requirements

- Python 3.12+
- Windows operating system

## License

Licensed under the MIT License (SPDX: MIT). Copyright (c) 2026 Bentham Instruments Ltd. SPDX-License-Identifier: MIT

See the `LICENSE` file included in this package. Third-party components are listed in `THIRD_PARTY_NOTICES.txt`.
