Skip to main content

Validation via echo-confirmation: readback(value, confirm_fn).

Project description

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

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

readback-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

readback-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file readback-0.1.0.tar.gz.

File metadata

  • Download URL: readback-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for readback-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ba9bd9efa80ce1b09666e27a5a75a67f3e3e103efccf21334f153f1260351053
MD5 5a7b863555212db4d50a46efcb80f0d3
BLAKE2b-256 30550e8a30d98795d8e443ee64ea9f220b0fcc8ed9b45067c20bad48802bc356

See more details on using hashes here.

File details

Details for the file readback-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: readback-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for readback-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0cd11a704e35cb6608f30df6c6196c3d016ba87f2ec55ac65134eff49152278
MD5 db7e2f2170d1c58cd74c2806f14354f0
BLAKE2b-256 f05c3124efd5ee99c59593deffbabaff80e90b72286425edef7f07f8f2793211

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