abstraction-watch, in Python
Be told what is true now, and be told when nothing has changed for a while.
A Notice carries the present; quiet says nothing visible has moved for at
least the budget, and silence says for how long. One module, standard library
only, importing nothing of ours.
Quiet is the half that is normally missing. A progress bar that stops moving and a transfer nobody is performing look identical to a listener that is only told about changes.
This page is the Python package. The contract, the Go and C++ implementations,
what is measured and what is UNPROVEN are on
the repository.
Install
Not on PyPI, and the name on PyPI is not ours.
git clone https://github.com/openabstractions/abstraction-watch
pip install ./abstraction-watch/python
Python 3.9 or later. abstraction_watch.py is one file with no imports of ours,
so copying it into a _vendor/ directory of your own is an equally complete
installation.
An example that runs
A source that says when it moved, and a listener that hears both the change and the quiet after it:
import abstraction_watch as watch
progress = watch.push({"done": 0}, stamp="0", budget=0.5)
progress.post({"done": 1 << 20}, stamp="1")
notice = progress.next()
print("now:", notice.now)
notice = progress.next()
print("quiet:", notice.quiet, "after", round(notice.silence, 1), "s of nothing")
progress.close()
budget=0.5 is the quiet budget and the only timer here: the listener's own wait
decides when silence counts, so a change the source already made is always
delivered ahead of a quiet that would postdate it.
What an application calls
| call | what it does |
|---|---|
push(first, stamp, budget) |
a subscription over a source that reports its own changes through post |
poll(read, every, budget) |
a subscription over a source that has to be asked. read returns (value, stamp); every is the interval between asks while a listener waits |
Subscription.next(timeout=None) |
the next Notice: a change, or quiet once the budget passed with none |
Subscription.current() |
what is true now, without waiting |
Subscription.post(value, stamp) |
tell a push subscription the source moved |
Subscription.close() |
end it. A waiting next raises Closed |
settle(events, period, settled) |
call settled once a queue of platform notifications has been still for period, because one edit produces several of them |
A subscription is iterable: for notice in subscription: ..., ending on close().
stamp is what decides whether a value is a change; two reads with the same stamp
are one.
abstraction_job.watch(store, kind, budget) is this primitive with a job store as
the source, which is what a download progress view binds to.
What may break
- No conformance verdict, in any language. No scenario in the suite cites this layer yet — what is proven and what is not. Anything that depends on this layer inherits that.
- Not on any package index, and no release carries an API stability promise. Pin a commit you have read.
pollasks; it does not subscribe to the platform. There is no inotify, noReadDirectoryChangesWand no FSEvents under it.settleis the seam where a caller supplies those.- Every published transcript was produced on Windows or Linux. macOS is
UNPROVENthroughout.
Apache-2.0. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abstraction_watch-0.1.0.tar.gz.
File metadata
- Download URL: abstraction_watch-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3afed7e325d4aaa165891dcc9db364879cc72fbabb16a109279f7e2196ad803a
|
|
| MD5 |
862df8addfb452455d047fa7089e7d55
|
|
| BLAKE2b-256 |
bbd03f5045b50286af302b4123337f62ee1d8667a37b4c0df5b80dd5ba91f8d3
|
Provenance
The following attestation bundles were made for abstraction_watch-0.1.0.tar.gz:
Publisher:
publish.yml on openabstractions/abstraction-watch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstraction_watch-0.1.0.tar.gz -
Subject digest:
3afed7e325d4aaa165891dcc9db364879cc72fbabb16a109279f7e2196ad803a - Sigstore transparency entry: 2781724820
- Sigstore integration time:
-
Permalink:
openabstractions/abstraction-watch@dd9db972a76f825cca422d5a573e0e3dd67b272d -
Branch / Tag:
refs/tags/python/v0.1.0 - Owner: https://github.com/openabstractions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dd9db972a76f825cca422d5a573e0e3dd67b272d -
Trigger Event:
push
-
Statement type:
File details
Details for the file abstraction_watch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: abstraction_watch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
253eed30bd117b8a836fba2f1a5fc18676695eb35f7425456833bf10b524e159
|
|
| MD5 |
4038488e3a4192f534d106907f02da0f
|
|
| BLAKE2b-256 |
8205055a32b20bc478fcf89354afb7e85a54093753700013b4344b5b55fd4a97
|
Provenance
The following attestation bundles were made for abstraction_watch-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on openabstractions/abstraction-watch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstraction_watch-0.1.0-py3-none-any.whl -
Subject digest:
253eed30bd117b8a836fba2f1a5fc18676695eb35f7425456833bf10b524e159 - Sigstore transparency entry: 2781724949
- Sigstore integration time:
-
Permalink:
openabstractions/abstraction-watch@dd9db972a76f825cca422d5a573e0e3dd67b272d -
Branch / Tag:
refs/tags/python/v0.1.0 - Owner: https://github.com/openabstractions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dd9db972a76f825cca422d5a573e0e3dd67b272d -
Trigger Event:
push
-
Statement type: