Skip to main content

PlestyLib

PlestyLib is the core Python library of PLESTY, a platform for automating lab measurements. Code built on it comes in three kinds, each a module of its own:

  • a device controls one instrument;
  • an experiment runs a measurement with devices and records it;
  • an analyzer turns recorded data into a result.

PlestyLib gives each kind a standard shape, so every instrument is driven the same way and every measurement is recorded the same way. It provides:

  1. Base classes for devices, with parameter and operation systems, status snapshots, and serving a device over the network
  2. Connections to instruments: serial, VISA, TCP/IP, and Thorlabs APT controllers (including those Kinesis has bound to FTDI's D2XX driver)
  3. Command solvers that translate standard calls into an instrument's own protocol, such as SCPI
  4. Experiments: a standard command line, run folders on a shared data disk, resuming, stopping, and a journal of every run
  5. Analyzers, HTML reports, and a viewer that plots a measurement live or replays it afterwards
  6. Test helpers for all three kinds of module

Full documentation: https://docs.plesty.net/plesty-lib/.

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
gui pyside6, pyqtgraph windows: device control panels and the viewer that plots a measurement
record pillow, imageio, imageio-ffmpeg saving a measurement's plots as a video (MP4, or GIF with Pillow alone)
report latex2mathml equations in reports opened as HTML; without it they show as LaTeX source
fit scipy SpectrumFit analyzer — Gaussian / Lorentzian / Voigt spectrum fits
hdf5 h5py convert_to_hdf5 — packs saved results into one HDF5 archive
pip install "plesty-lib[gui,record]"
# or
uv add "plesty-lib[gui,record]"

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"))

The documentation's quick start continues from here: serving the device over the network, using it without the instrument, then an experiment and an analyzer.

Architecture Overview

A device is built in layers, and a module's author only writes the lower ones:

  1. Traffic manager: the connection to the instrument (serial, VISA, TCP/IP, APT)
  2. Command solver: maps standard calls to the instrument's protocol
  3. Synchronous device: the class the author writes, with its parameters and operations
  4. Provided by PlestyLib: the asynchronous wrapper, the network server, and a client that drives a remote device with the same calls as a local one

An experiment then drives devices through those clients, and an analyzer reads what the experiment recorded. Concepts explains how the parts fit together.

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.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plesty-lib 0.6.1
File Size Uploaded Provenance Actions
plesty_lib-0.6.1.tar.gz 909.2 kB Without provenance Details for plesty_lib-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plesty-lib 0.6.1
File Interpreter ABI Platform Actions
plesty_lib-0.6.1-py3-none-any.whl Python 3 none any Details for plesty_lib-0.6.1-py3-none-any.whl

Total release size: 1.4 MB

Release files / plesty_lib-0.6.1.tar.gz

Download URL plesty_lib-0.6.1.tar.gz
Size 909.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cb32bcc90f8d444a1e4e44479ed29bfc7d9bd853522416b9a61e76d7d4cdd5e3
BLAKE2b-256 checksum
How to use checksums
2bc1988cf580b26befb9f6ded026c59797f88c603d360d6bf92bab36ba6fabc6
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.6.1-py3-none-any.whl

Download URL plesty_lib-0.6.1-py3-none-any.whl
Size 513.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82f12fc096f6b131278ffea25d00cd15a92a06835670ce08ba83b5911d298e32
BLAKE2b-256 checksum
How to use checksums
df07bdbe382116551c32b12473d2a7c5e2ad0c3abc0882705ab58aa70b802eb9
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}

Security for plesty-lib 0.6.1

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.

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files No provenance

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