Skip to main content

instrutech-gauges

Python drivers for InstruTech gauges over serial or TCP serial gateways.

Install

uv add instrutech-gauges

Or for local development:

uv sync

Available drivers

  • VGC301
  • HornetIGM402
  • Public base class for custom devices: InstruTechAsciiGauge

Quick start (VGC301)

from instrutech_gauges import SerialTransport, VGC301

t = SerialTransport(port="/dev/ttyUSB0", baudrate=19200, timeout_s=0.3)
g = VGC301(t, address=1)

with g:
    print(g.read_sw_version())
    print(g.read_pressure_torr())
    g.set_trip_point(1, "on_below", 4.00e2)
    print(g.read_trip_point(1, "on_below"))

Quick start (Hornet IGM402)

from instrutech_gauges import HornetIGM402, SerialTransport

t = SerialTransport(port="/dev/ttyUSB0", baudrate=19200, timeout_s=0.3)
g = HornetIGM402(t, address=1)

with g:
    print(g.read_sw_version())
    print(g.read_system_pressure_torr())
    print(g.read_pressure_unit())

Firmware notes for HornetIGM402:

  • SES emission setting responses like 0.1MA_EM / 4.0MA_EM are parsed.
  • RU accepts long unit tokens (TORR, MBAR, PASCAL).
  • Optional command families (RU/SU, RDIG*) raise InstruTechUnsupportedCommandError on firmware that returns SYNTX ER.
  • Socket transport defaults to \r command termination.

Without context manager (with)

Use explicit open() / close() with try/finally:

from instrutech_gauges import SerialTransport, VGC301

t = SerialTransport(port="/dev/ttyUSB0", baudrate=19200, timeout_s=0.3)
g = VGC301(t, address=1)

g.open(probe=True)
try:
    print(g.read_sw_version())
    print(g.read_pressure_torr())
finally:
    g.close()
from instrutech_gauges import HornetIGM402, SerialTransport

t = SerialTransport(port="/dev/ttyUSB0", baudrate=19200, timeout_s=0.3)
g = HornetIGM402(t, address=1)

g.open(probe=True)
try:
    print(g.read_sw_version())
    print(g.read_system_pressure_torr())
finally:
    g.close()

Public base class

InstruTechAsciiGauge exposes shared protocol and transport helpers for building new drivers:

  • framing/parsing (#xx...<CR>, *xx...<CR>)
  • query() / query_float() / command_prog_ok()
  • serial reconfiguration (set_baud, set_parity, set_serial_comm)
  • common Mini-Convectron-style commands (VER, RD, TS, TZ, SL/SH, RL/RH, FAC, RST)

Minimal custom driver:

from instrutech_gauges import InstruTechAsciiGauge

class MyGauge(InstruTechAsciiGauge):
    def read_custom_value(self) -> float:
        return self.query_float("RDCUSTOM")

Transport

  • SerialTransport: local serial via pyserial
  • SocketTransport: TCP serial gateways (raw TCP)

SocketTransport defaults to CR (\r) command termination. If your gateway expects CRLF, override it:

from instrutech_gauges import SocketTransport

t = SocketTransport("192.168.1.50", 4001, timeout_s=1.0, write_terminator=b"\r\n")

Runtime serial reconfiguration (set_baud, set_parity) is supported only with SerialTransport.

VGC301 serial notes

Per the VGC301 manual, SB* / SP* / SA* / FAC require RST before they take effect.

  • VGC301.set_baud(...) defaults to reset_after=True
  • VGC301.set_parity(...) defaults to reset_after=True
  • For ODD/EVEN parity, data bits default to 7; for NO parity, data bits default to 8

Error handling

Typical exceptions:

  • InstruTechTimeoutError
  • InstruTechProtocolError
  • InstruTechDeviceError
  • InstruTechUnsupportedTransportOperationError

Release flow

  • CI runs on every push and PR (.github/workflows/ci.yml).
  • PyPI publish runs only on tags that start with v (.github/workflows/publish.yml).
  • Publish is blocked unless tag version matches pyproject.toml version exactly.

Example release:

git tag v0.1.1
git push origin v0.1.1

Configure PyPI Trusted Publisher for this repository so the publish workflow can upload without storing an API token.

Metadata

Release files for instrutech-gauges 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for instrutech-gauges 0.3.5
File Size Uploaded Provenance
instrutech_gauges-0.3.5.tar.gz 11.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for instrutech-gauges 0.3.5
File Interpreter ABI Platform
instrutech_gauges-0.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / instrutech_gauges-0.3.5.tar.gz

Download URL instrutech_gauges-0.3.5.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f315c963359391a31085dd6a2f0e3cb5162ab0f123e9841a41d5ebdfe8618922
BLAKE2b-256 checksum
How to use checksums
07e9eb3f1dd6b3e7a6affaf0b843acd45ac25e24ad72088541aeb653fb8cc08f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / instrutech_gauges-0.3.5-py3-none-any.whl

Download URL instrutech_gauges-0.3.5-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e62a1dfd9a2a8aa96f3014577b2719554f1205d66b5ad4de587c7f467e87a87
BLAKE2b-256 checksum
How to use checksums
a13f69d69bc2576752f75535fc6cb680a710dda16429a3101872183adbf5691a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for instrutech-gauges 0.3.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for instrutech_gauges-0.3.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page