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:
- Device lifecycle and synchronous device models
- Transport/traffic management (Serial, VISA, TCP/IP)
- Command and operation solvers (for example SCPI and operation-message protocols)
- Parameter and function metadata systems
- Auto testing helpers, logging, and error-handling utilities
Requirements
- Python 3.12+
Installation
Install from package index:
pip install plesty-lib
# or
uv add plesty-lib
Optional dependencies
Features that need a heavy or platform-specific package keep it out of the
base install and behind an extra. Without the extra the feature raises an
ImportError naming it; nothing else is affected.
| Extra | Adds | Enables |
|---|---|---|
hdf5 |
h5py |
convert_to_hdf5 — packs saved results into one HDF5 archive |
fit |
scipy |
SpectrumFit analyzer — Gaussian / Lorentzian / Voigt spectrum fits |
pip install "plesty-lib[hdf5]"
# or
uv add "plesty-lib[hdf5]"
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 plesty.lib.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
# replace the serial number P0000001 with that of your own 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:
- Base device model: operation entry points and parameter/function systems
- Command/operation solver: map standardized calls to protocol payloads
- Traffic manager: transport-specific I/O with real hardware
- 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.
Metadata
Release files for plesty-lib 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| plesty_lib-0.5.2.tar.gz | 887.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plesty_lib-0.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.4 MB
Release files / plesty_lib-0.5.2.tar.gz
| Download URL | plesty_lib-0.5.2.tar.gz |
|---|---|
| Size | 887.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7216cc5fdcbb3af519e4b32b7b03530c7c03444a9527ba8e54fc2e826798e47
|
|
BLAKE2b-256 checksum How to use checksums |
96d7f52b7410424860a0cf6757346ea64cc32b6238979a6fb2205c0794bf23f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","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}
|
Release files / plesty_lib-0.5.2-py3-none-any.whl
| Download URL | plesty_lib-0.5.2-py3-none-any.whl |
|---|---|
| Size | 503.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1be63206d919ecf79635aa5f99a0ecbdf0c3f3f6e07ed8186f36ad81136cf275
|
|
BLAKE2b-256 checksum How to use checksums |
db958d66425f375e38ade911b271f26b142cb504f707c7390019ec646f199ea7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","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}
|