Skip to main content

gw-instek-asr-3000

A pure-Python driver for the GW Instek ASR-3000 series programmable AC/DC power source (ASR-3200, ASR-3300, ASR-3400, ASR-3400HF). The MVP communicates with the instrument over Ethernet using a raw TCP SCPI socket.

Unofficial project. This software is not affiliated with, endorsed by, or in any way connected to Good Will Instrument Co., Ltd. ("GW Instek"). It is an independent, community-written driver created by reverse-engineering the publicly available programming manual. "GW Instek" and "ASR" are trademarks of their respective owners and are used here only to identify the hardware this driver targets.

Features

  • Zero runtime dependencies (stdlib socket only).
  • Full SCPI command set from the ASR-3000 Programming Manual (Rev. E): IEEE 488.2 common commands, output, source, measure, system, status, sequence, simulation, data/trace, memory, input and display subsystems.
  • Type-safe enums for enumerated parameters, with forgiving int / str / Enum input coercion.
  • Binary arbitrary-waveform transfer (:DATA:TRACe:WAVe block data).
  • Context-manager and connection management, with clear exception types.

Installation

pip install -e .          # development install
pip install -e ".[dev]"   # include pytest

Requires Python 3.10+.

See CHANGELOG.md for release notes.

Quick start

The ASR-3000 socket server port is fixed at 2268.

from gw_instek_asr import ASR3300, OutputMode, Waveform

with ASR3300("192.168.1.100") as asr:
    print(asr.identify())               # Identification(model='ASR-3300', ...)

    asr.mode(OutputMode.AC_INT)         # AC-INT output mode
    asr.waveform(Waveform.SIN)          # sine wave
    asr.voltage(230.0)                  # 230 Vrms
    asr.frequency(50.0)                 # 50 Hz
    asr.output_on()

    print("Vrms =", asr.voltage_rms())  # measured voltage
    print("Irms =", asr.current_rms())

ASR3000 (the series) and ASR3300 (the 3000 VA model) expose the same API.

API conventions

  • Get/set pattern. A method sets when given a value and queries when called with no arguments:

    asr.voltage(120.0)     # :VOLTage 120.0
    asr.voltage()          # :VOLTage?  -> 120.0
    
  • Enums. Enumerated parameters accept an enum member, an integer, or a mnemonic string and are returned as enum members:

    asr.mode("ACDC-INT") is OutputMode.ACDC_INT
    
  • Booleans accept True/False, 1/0, or "ON"/"OFF".

  • MIN/MAX. Numeric setters pass the mnemonics through:

    asr.voltage("MAX")
    

Raw command access

Anything not covered by a typed helper can be sent directly:

asr.write(":SOURce:VOLTage 120.0")
value = asr.query(":SOURce:VOLTage?")

Testing

The test suite uses an in-memory fake transport for command encoding plus a local TCP socket server to exercise the real transport end-to-end.

python -m pytest

For the complete local quality gate, install the development extra and run:

python -m pip install -e ".[dev]"
python -m ruff check src tests scripts examples
python -m ruff format --check src tests scripts examples
python -m mypy src/gw_instek_asr
python -m pytest -q

Publishing to PyPI

Publishing is handled by .github/workflows/publish.yml, which builds the sdist/wheel, runs the test suite, and publishes to PyPI when you push a tag like v0.2.0 (or trigger the workflow manually). Configure one of:

  • Trusted publishing (recommended): in PyPI → Publishing, add a trusted publisher for this repo (owner fuubox, repo gw-instek-asr-3000); no secrets required.
  • API token: add a repository secret named PYPI_API_TOKEN and, in the workflow, pass password: ${{ secrets.PYPI_API_TOKEN }} to the pypa/gh-action-pypi-publish step.

License

Zero-Clause BSD (0BSD) — see LICENSE. Completely open source and free to use, modify, and redistribute, with or without fee, for any purpose. Attribution is appreciated but not required.

Metadata

Release files for gw-instek-asr-3000 0.2.0

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

Source distribution (sdist)

Source distribution for gw-instek-asr-3000 0.2.0
File Size Uploaded Provenance Actions
gw_instek_asr_3000-0.2.0.tar.gz 36.0 kB With provenance Details for gw_instek_asr_3000-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gw-instek-asr-3000 0.2.0
File Interpreter ABI Platform Actions
gw_instek_asr_3000-0.2.0-py3-none-any.whl Python 3 none any Details for gw_instek_asr_3000-0.2.0-py3-none-any.whl

Total release size: 63.0 kB

Release files / gw_instek_asr_3000-0.2.0.tar.gz

Download URL gw_instek_asr_3000-0.2.0.tar.gz
Size 36.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dffcd000086a9919bdc5e5279234170a124167ebc5c3a46a4c48116d20f00124
BLAKE2b-256 checksum
How to use checksums
4f1a873f6200198ce62d9845cd29ea5254f8ea7f81e74b4f5d0f1f3f5d4bfce3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release files / gw_instek_asr_3000-0.2.0-py3-none-any.whl

Download URL gw_instek_asr_3000-0.2.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17ab8e85ce99b6de409270760acd54770d1e087970ea04b1a3c2dd4eb252b24a
BLAKE2b-256 checksum
How to use checksums
10f46a25d1dd74a4962e789632b19ab9c59091c03a6d82f539e4244711dfcec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Security for gw-instek-asr-3000 0.2.0

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 gw_instek_asr_3000-0.2.0.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 Sep 14, 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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