hearback
Listener-side counterpart to echo-confirmation: a decorator that re-validates function outputs against a schema or predicate before they leave the call boundary.
Install
pip install hearback
Usage
from hearback import hearback, HearbackError
@hearback(lambda n: isinstance(n, int) and n >= 0)
def absolute_delta(a, b):
return abs(a - b)
assert absolute_delta(3, 10) == 7
@hearback(str)
def label(x):
return x # must be a str
assert label("ok") == "ok"
try:
label(123)
except HearbackError:
pass
Roadmap
This is an early 0.1.0 release with active development planned:
- JSON Schema / pydantic integration
- Async function support
- Structured advisory payloads on failure
Author
Coldbricks — coldbricks@gmail.com
Release files for hearback 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 | |
|---|---|---|---|
| hearback-0.1.0.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hearback-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 kB
Release files / hearback-0.1.0.tar.gz
| Download URL | hearback-0.1.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c55dc54eea307270bd2d070ec3740b9102b73a763acee9b71b91ad9442f9a09a
|
|
BLAKE2b-256 checksum How to use checksums |
67199d79880786f2db09eee5b4c9e49c22ee73a8cff84ff0c8ca01e8cb1863b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / hearback-0.1.0-py3-none-any.whl
| Download URL | hearback-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
081cee35ded82a9c4cb0713c020e9494645f0d4d374aa393f0a863def8fa2589
|
|
BLAKE2b-256 checksum How to use checksums |
9f645d24a87e88aa472e2181e21c536ef073ec636f54ca1650043721b5f55012
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|