readback
Validation via echo-confirmation. Send a value, read it back through a confirm function, and fail closed on mismatch — the classic command-then-verify pattern used in safety and control systems.
Install
pip install readback
Usage
from readback import readback, ReadbackError
sent = {"motor": "arm", "rpm": 1200}
confirmed = readback(sent, confirm_fn=lambda: {"motor": "arm", "rpm": 1200})
assert confirmed == sent
try:
readback(sent, confirm_fn=lambda: {"motor": "arm", "rpm": 0})
except ReadbackError as e:
assert e.expected == sent
assert e.got["rpm"] == 0
Roadmap
This is an early 0.1.0 release with active development planned:
- Tolerance / partial-match policies
- Async confirm functions
- Structured logging of mismatch traces
Author
Coldbricks — coldbricks@gmail.com
Release files for readback 0.1.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 | |
|---|---|---|---|
| readback-0.1.0.tar.gz | 2.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| readback-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.8 kB
Release files / readback-0.1.0.tar.gz
| Download URL | readback-0.1.0.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba9bd9efa80ce1b09666e27a5a75a67f3e3e103efccf21334f153f1260351053
|
|
BLAKE2b-256 checksum How to use checksums |
30550e8a30d98795d8e443ee64ea9f220b0fcc8ed9b45067c20bad48802bc356
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / readback-0.1.0-py3-none-any.whl
| Download URL | readback-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0cd11a704e35cb6608f30df6c6196c3d016ba87f2ec55ac65134eff49152278
|
|
BLAKE2b-256 checksum How to use checksums |
f05c3124efd5ee99c59593deffbabaff80e90b72286425edef7f07f8f2793211
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|