Skip to main content

A Python abstraction layer for GW-Instek GPP power supplies

Project description

pyGPP

Status Python License Ruff

pyGPP is a Python Hardware Abstraction Layer (HAL) over SCPI commands using PyVISA for controlling GW-Instek GPP series power supplies. It simplifies automation, allowing you to focus on your test logic rather than looking up raw SCPI command strings.

Supported Models:

  • GPP-3060
  • GPP-6030
  • GPP-3650

Why this library?

  • Type-safe API (Enums, Dataclasses) instead of magic strings
  • Model-aware validation (prevents sending 70V to a 30V channel)
  • Auto-disables outputs on exit/error via context manager
  • Returns structured data, not CSV strings

Quick Start

from pygpp import GPP3060, ChannelMode

with GPP3060(address='ASRL3::INSTR') as psu:
    # Example: Using the GPP as an electronic load
    psu.ch1.set_mode(ChannelMode.LOAD_CC)
    psu.ch1.set_current(0.5)  # Sink 0.5A
    psu.ch1.enable()
    data = psu.ch1.measure()
    print(f"Sinking {data.power} W")

Examples

The examples/ directory demonstrates the features in progressive complexity. The plot below was generated using examples/04_python_sequence.py to sweep the load on a GPP-3060 and characterize a buck converter:

See example 04 for a description.

Prerequisites

  • Hardware: A supported GW-Instek programmable power supply.
  • Drivers:
  • Tooling: uv (optional)

Installation

As a Dependency (for users)

If you want to use pyGPP in your own project, install it directly from PyPI:

pip install pygpp

Try the examples:

git clone https://gitlab.com/samshahrokni/pyGPP.git
cd pyGPP
uv sync --group examples

# Run any example directly:
uv run python -m examples.01_connection_check

For Development (for contributors)

Clone the repository and sync dependencies (automatically fetches Python):

git clone https://gitlab.com/samshahrokni/pyGPP.git
cd pyGPP
uv sync --all-extras
pre-commit install

Notes

  • Incomplete Implementation: Not all SCPI commands are implemented. See the GPP Series User Manual for the full command list.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygpp-0.1.0.tar.gz (628.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygpp-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file pygpp-0.1.0.tar.gz.

File metadata

  • Download URL: pygpp-0.1.0.tar.gz
  • Upload date:
  • Size: 628.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pygpp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5d87386c1e1b17a10414dc3c160e1e75cec2176c461e68cdd29b0752466674ad
MD5 7553f8dc1ffc722979d1afd0f5b87a24
BLAKE2b-256 a286c8d458f997a47aa5ef49292ee677853de96bba038bc87a58e7d27e50756d

See more details on using hashes here.

File details

Details for the file pygpp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pygpp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pygpp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb1d6a9c0766c7686d54520467243bec89c2b450fd61c12691cbda648d01d72e
MD5 56a8bdcdd309dad0a501b5104bafa696
BLAKE2b-256 0fc2cb1c0e493e1afc95ec2d19d8e3b98d0f1b28fa7ecf62b432f676e4a38171

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page