p4pillon
Extensions to the p4p Server API, to aid in creation and managment of pvAccess servers.
Installation
p4pillon may be installed via
$ pip install p4pillon
Python Version
Requires Python 3.10 or later. These extensions make extensive use of typing and other recent Python features.
Documentation
Documentation intended for developers using the library is available here.
Extensions
A brief overview of the components of the library.
NT Logic
The SharedNT class, derived from p4p's SharedPV class, automatically implements the logic of Normative Types (at this time NTScalars and NTScalarArrays) using handlers. It is possible, with the CompositeHandler class to override this behaviour, including diabling or replacing Normative Type logic.
CompositeHandler and Rules
p4p only allows a single Handler class to be associated with a SharedPV. To make it easier to combine or share handlers from multiple sources a CompositeHandler class is provided. The supplied CompositeHandler is derived from the p4p Handler. It also derives from an OrderedDict to store componenent Handlers (also standard p4p Handlers). The CompositeHandler calls component handlers in the specified order, and allows the component Handlers to be accessed through the OrderedDict interface.
Rules are component Handlers used with the CompositeHandler used to implement the NT Logic discussed above. The Rule class is derived from the Handler class but implements a commonly encountered flow from put() (for identification and authorisation), to put() (for operations that require comparison between the current state of the PV and its possible future state), and open() (for operations that only need consider the possible future state of the PV).
PVRecipe and Server
PVRecipe is a factory method used to simplify creation of SharedNT objects, i.e. PVs that implement Normative Type logic. It may be used in conjunction with the p4pillon Server class to simplify management of event loops and PV lifecycle.
The config_reader parses a YAML file in order to construct SharedNT PVs which are managed by the p4pillon Server. This is the simplest way to create and configure
Testing
Install the extra dependencies required for testing and development using uv sync (this installs the dev dependency group, which includes test and dist). To install only the test group, use uv sync --group test.
To run tests invoke pytest:
$ uv run pytest
or to run all tests and output a coverage report:
$ uv run coverage run -m pytest
$ uv run coverage report
Linting and Formatting
This repository's CI/CD pipeling (using GitHub Actions) checks that source code meets PEP 8, and other more stringent, coding standards. This uses the ruff linter and code formatter. It is included in the test dependency group (see above) and may be manually invoked:
$ uv run ruff check --fix
$ uv run ruff format
Releases
The release process requires use of the dist dependency group, which may be installed with uv sync --group dist. A build may then be triggered with python -m build. Alternatively, use:
$ uv run --group=dist python -m build
Publication to either PyPi or TestPyPI is performed automatically via CI/CD (i.e. GitHub Actions) and is driven by tags. Any commit intended for package publication must be tagged with a unique tag, and the semantic version must be greater than any existing tag.
Metadata
Release files for p4pillon 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| p4pillon-0.2.0.tar.gz | 226.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| p4pillon-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 305.6 kB
Release files / p4pillon-0.2.0.tar.gz
| Download URL | p4pillon-0.2.0.tar.gz |
|---|---|
| Size | 226.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1c590e26941cc89bd517d940e7de890b698bb09c556ef08261ef6afa2bbcb4d
|
|
BLAKE2b-256 checksum How to use checksums |
b15a3f1555f5568c7d03057a2bb67891685063342731f1eb9bc4e67673155555
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / p4pillon-0.2.0-py3-none-any.whl
| Download URL | p4pillon-0.2.0-py3-none-any.whl |
|---|---|
| Size | 79.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f859c04334767a89b51c8aeeb1020681c683b1ccdede91ec46ab3ca82b61b6f
|
|
BLAKE2b-256 checksum How to use checksums |
ef66d3529eeef2fca824af749dabbd0b736b5fa5a680888d71a68f7ba9644ff4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency log