Skip to main content

A library for the Plesty ecosystem.

Project description

PlestyLib

PlestyLib is the core Python library in the PLESTY ecosystem for building standardized device APIs for laboratory and experimental automation.

It provides reusable abstractions for:

  1. Device lifecycle and synchronous device models
  2. Transport/traffic management (Serial, VISA, TCP/IP)
  3. Command and operation solvers (for example SCPI and operation-message protocols)
  4. Parameter and function metadata systems
  5. Auto testing helpers, logging, and error-handling utilities

Requirements

  1. Python 3.12+
  2. Runtime dependencies are defined in pyproject.toml

Installation

Install from package index:

pip install plesty-lib
# or 
uv add plesty-lib

For development, install from source and sync the dev dependency group:

uv sync --group dev
# or
pip install -e .
pip install plesty-sdk

Quick Start

1. Create a device class from a base device

from plestylib.device.base_visa_scpi_device import BaseVisaScpiDevice


class PowermeterDevice(BaseVisaScpiDevice):
	def __init__(self, address: str):
		super().__init__(address)
		self.register_config("POWER", dtype=float, read_only=True, command="MEAS:SCAL:POW")
		self.register_config("WAVELENGTH", dtype=int, unit="nm", command="SENS:CORR:WAV")

2. Use the device

address = "USB0::0x1313::0x8078::P0000001::INSTR"

with PowermeterDevice(address) as dev:
	print(dev.identity())
	print(dev.query("POWER"))

Architecture Overview

PlestyLib encourages a layered device API design:

  1. Base device model: operation entry points and parameter/function systems
  2. Command/operation solver: map standardized calls to protocol payloads
  3. Traffic manager: transport-specific I/O with real hardware
  4. Optional wrappers: async and TCP/IP service/client patterns

This separation keeps implementations testable and easier to maintain.

License

Plesty is licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later). See the LICENSE file.

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

plesty_lib-0.1.1.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

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

plesty_lib-0.1.1-py3-none-any.whl (85.2 kB view details)

Uploaded Python 3

File details

Details for the file plesty_lib-0.1.1.tar.gz.

File metadata

  • Download URL: plesty_lib-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for plesty_lib-0.1.1.tar.gz
Algorithm Hash digest
SHA256 727f5268102ccfcbe24b6b7b05cb91612a6a0380e0aeec7a704668d5d1707332
MD5 c35979406367aa8ce40b40955eaa3e66
BLAKE2b-256 ea355216ab1af7ea6fa6be6b4375a5d3a0c19b76a282d9a4eed962c8bd7cd7bd

See more details on using hashes here.

File details

Details for the file plesty_lib-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: plesty_lib-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 85.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for plesty_lib-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74220946a5a330495088abf658728fc6359348d1e6cb7abb549cf4df9c6ca823
MD5 48c3a888c3dab8d29dd45dd98c212f92
BLAKE2b-256 0e3887bac96707594f77b98504aff36bfb4f58d8d94d79f2b4c7000913e900c2

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