Skip to main content

TBD

Project description

KA3005P Python Library

This Python library provides a high-level interface to control Korad, Tenma, RS, Velleman, Stamos, and other compatible power supplies via their serial interface. It is built on top of a Rust library ka3005p.

Installation

Make sure you have Python 3.8 or higher installed. You can install the library from PyPI by running the following command in your terminal:

pip install ka3005p

Note: If you are using Linux, you may need to add users to the dialout group or adjust the permissions of the serial interfaces that are needed to communicate with the power supply.

To add a user to the dialout group, you can use the following command: sudo usermod -a -G dialout username(please remember that logging out and logging back in may be required for the changes to take effect).

Usage

from ka3005p import PowerSupply

# List connected power supplies
devices = PowerSupply.list_power_supplies()

# Take control over a power supply
#
# Attention: Only one handle at the time is allowed to exist for a single PowerSupply.
#
#  Note: If no parameter is specified the first power supply which was found will be used.
power_supply = PowerSupply(devices[0])


# Prepare output voltage and current
power_supply.voltage = 12.0
power_supply = 0.5

# Turn on the output
power_supply.enable()

# Read voltage and current  
v = power_supply.voltage
a = power_supply.current

# Store current settings in memory slot 1
power_supply.save(1)

# Turn off the output
power_supply.disable()

# Load settings from memory slot 2
power_supply.load(2)

Building from Source

If you need to build the library from the source, you'll need Python development headers and Rust installed:

  1. Clone the repository:

    git clone git@github.com:nicoretti/ka3005p.git
    cd ka3005p
    
  2. Build and install using maturin (install it if it's not installed):

    pip install maturin
    maturin develop
    
  3. To build a wheel:

    maturin build --release
    

License

This project is licensed under either of

at your option.

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

ka3005p-0.5.0.tar.gz (485.9 kB view hashes)

Uploaded Source

Built Distributions

ka3005p-0.5.0-cp312-none-win_amd64.whl (712.5 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

ka3005p-0.5.0-cp312-none-win32.whl (644.7 kB view hashes)

Uploaded CPython 3.12 Windows x86

ka3005p-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (247.8 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ka3005p-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl (254.8 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

ka3005p-0.5.0-cp311-none-win_amd64.whl (712.2 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

ka3005p-0.5.0-cp311-none-win32.whl (644.0 kB view hashes)

Uploaded CPython 3.11 Windows x86

ka3005p-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (248.0 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ka3005p-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl (255.0 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

ka3005p-0.5.0-cp310-none-win_amd64.whl (712.2 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

ka3005p-0.5.0-cp310-none-win32.whl (644.1 kB view hashes)

Uploaded CPython 3.10 Windows x86

ka3005p-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (364.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ka3005p-0.5.0-cp310-cp310-macosx_11_0_arm64.whl (248.1 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ka3005p-0.5.0-cp310-cp310-macosx_10_12_x86_64.whl (255.1 kB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

ka3005p-0.5.0-cp39-none-win_amd64.whl (712.4 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

ka3005p-0.5.0-cp39-none-win32.whl (644.3 kB view hashes)

Uploaded CPython 3.9 Windows x86

ka3005p-0.5.0-cp38-none-win_amd64.whl (712.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

ka3005p-0.5.0-cp38-none-win32.whl (644.3 kB view hashes)

Uploaded CPython 3.8 Windows x86

Supported by

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