Skip to main content

HVPS

PyPI version node.js bindings node-red node

PyPI downloads Python Version

Build and Test Upload Python Package to PyPI and nodejs bindings to npm

🤔 What is this?

This is a Python package for controlling high voltage power supplies (HVPS) over serial port. The aim is to provide a unified pythonic interface for different HVPS models.

Along with the Python package, a minimal set of bindings for Node.js is also provided. A nodered node is also available. They both rely on the Python package to be installed in order to work.

Currently only CAEN and iseg brands are supported.

⚙️ Installation

Installation via pip is supported. To install the latest published version, run:

pip install hvps

To install the package from source, including development dependencies, clone the repository and run:

pip install .[dev]

👨‍💻 Usage

There is a hierarchy of objects that represent the HVPS and its components:

  • HVPS: represents the HVPS itself and handles the connection to the serial port
  • Module: represents a module of the HVPS. Some HVPS support multiple modules over the same connection
  • Channel: represents a channel of the HVPS

Connection

from hvps import Caen, Iseg
import logging

# connection interface is common to all HVPS
# if no serial port is specified, the first available port will be used
# if no baudrate is specified, the default baudrate will be used
# if connect=False, the connection will not be established (useful for testing)
# if logging_level is specified, the logger will be configured accordingly
hvps = Caen(port="/dev/ttyUSB0", baudrate=115200, connect=True, logging_level=logging.DEBUG)

# connection settings can be accessed
print(f"port: {hvps.port}")
print(f"baudrate: {hvps.baudrate}")

Module

from hvps import Caen

# default connection settings
caen = Caen()

module = caen.module()  # get the first module (module 0)
# if multiple modules are present, they can be accessed by index e.g. caen.module(1)

# get the module's name
print(f"module name: {module.name}")

Channel

from hvps import Caen

caen = Caen()
module = caen.module(0)

print(f"number of channels: {module.number_of_channels}")

channel = module.channel(2)  # get channel number 2

# get monitoring parameters
print(f"vmon: {channel.vmon}")
print(f"vset: {channel.vset}")

# set values (remote mode must be enabled)
# turn on channel
channel.turn_on()

channel.vset = 300.0  # 300 V

⚠️ Disclaimer

The development of this package is mostly based on documentation with access to only a few models of HVPS.

If you use this package, it is very possible you find a bug or some oversight. You are encouraged to make a pull request or to create an issue to report a bug, to request additional features or to suggest improvements.

Metadata

Release files for hvps 0.1.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 hvps 0.1.0
File Size Uploaded Provenance Actions
hvps-0.1.0.tar.gz 35.4 kB Without provenance Details for hvps-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hvps 0.1.0
File Interpreter ABI Platform Actions
hvps-0.1.0-py3-none-any.whl Python 3 none any Details for hvps-0.1.0-py3-none-any.whl

Total release size: 69.3 kB

Release files / hvps-0.1.0.tar.gz

Download URL hvps-0.1.0.tar.gz
Size 35.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3eaf243ee2acb18651df97dfbb939f501a67358930ada478fd882b6227ab2b7e
BLAKE2b-256 checksum
How to use checksums
eae02ffc342c22a8f165e354cac475ac494db54c23692505aa9456c5abaae89f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / hvps-0.1.0-py3-none-any.whl

Download URL hvps-0.1.0-py3-none-any.whl
Size 33.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
664cc48262ea25f87e4499669c1d489c3a8f020126fdbfc8327bdd64ea88fc18
BLAKE2b-256 checksum
How to use checksums
dc294145d2c3f7c6f7be838360f9fc8cc439be65c3f06b2f965a4530428e018d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for hvps 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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