Metadata-Version: 2.4
Name: pyvisa-rs
Version: 0.1.3
Requires-Dist: pyvisa>=1.13
Summary: Rust-backed VISA backend for PyVISA, powered by rsvisa-rs.
Author: Alexander Hill
License: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# pyvisa-rs

A PyVISA backend powered by [`rsvisa-rs`](../), a Rust port of
pyvisa-py. Select it from PyVISA with the `@rs` library spec.

## Install

From a clone of this repo, with an activated virtualenv:

```bash
cd pyvisa-rs
maturin develop
```

This builds the Rust extension and installs the `pyvisa-rs` package
into the current environment. PyVISA discovers it automatically via its
`pyvisa_*` package scan.

## Usage

```python
import pyvisa

rm = pyvisa.ResourceManager("@rs")

print(rm.list_resources())

with rm.open_resource("TCPIP::192.168.1.10::INSTR") as instr:
    instr.timeout = 5000
    print(instr.query("*IDN?"))
```

That's it — once `"@rs"` is passed to `ResourceManager`, the rest of
the PyVISA API works exactly as it does against any other backend.

## Backends supported

The Rust backend mirrors pyvisa-py's transports:

- `TCPIP::...::INSTR` (VXI-11)
- `TCPIP::...::SOCKET`
- `TCPIP::...::HISLIP`
- `USB::...::INSTR` / `USB::...::RAW`
- `ASRL...::INSTR` (serial)

## Comparing against pyvisa-py

`examples/discovery.py` runs `list_resources()` through both backends
and diffs the results:

```bash
uv run --with pyvisa --with pyserial --with pyusb \
       --with libusb-package --with zeroconf --with pyvisa-py \
       examples/discovery.py
```

Pass `--reinstall-package pyvisa-rs` after editing Rust sources — uv's
wheel cache does not invalidate on Rust source changes.

