This release is a pre-release and may not be stable for production use.
trrack-widget
An anywidget that wraps any widget and records its state as a branching provenance history you can navigate — undo, redo, jump to any node, branch off an earlier state, and label checkpoints. Works in marimo and Jupyter.
Built on trrack (the pure provenance
core); part of the trrackpy
monorepo.
Install
uv add trrack-widget # or: pip install trrack-widget
trrack is pulled in automatically.
Quick start
Wrap any anywidget; its synced traits are tracked, and every change is committed as a node in the history.
from trrack_widget import Trrackable
tt = Trrackable(counter) # counter is any anywidget.AnyWidget
tt.view # wrapped widget + provenance controls, side by side
Drive it from Python as well as the UI:
tt.undo()
tt.redo()
tt.go_to(node_id) # jump to any node
tt.label("before tuning") # name the current node
Display
tt.view— the target and the controls side by side. Usesmarimo.hstackwhen marimo is available, otherwise falls back toipywidgets.HBox.tt.widget— just the wrapped target.tt.controls— just the provenance control UI.
Constructor options
Trrackable(
target, # the widget to track
traits=None, # trait names to track; defaults to the target's
# public synced traits
*,
debounce_ms=0, # coalesce rapid trait changes into one commit
persist_path=None, # convenience: persist to this JSON file
store=None, # any trrack.Store; takes precedence over persist_path
)
Persistence
Pass persist_path to make a session durable. State is restored on the next
construction with the same path (the file is authoritative), and written after
every mutation, coalesced and atomic:
tt = Trrackable(counter, persist_path="state.json")
# ... interact ...
tt.flush_persist() # force any pending write immediately
For a non-file backend, pass any trrack.Store:
from trrack import JsonFileStore
tt = Trrackable(counter, store=JsonFileStore("state.json"))
Frontend
The control UI is a React + TypeScript component bundled to
src/trrack_widget/static/controls.js. Installed wheels ship the prebuilt
bundle, so end users never need Node. See the
monorepo CONTRIBUTING guide
for the frontend dev loop.
License
BSD-3-Clause.
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 trrack_widget-0.0.1a2.tar.gz.
File metadata
- Download URL: trrack_widget-0.0.1a2.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc1c0ae1fd04d65a8c3cbd23348de6c864fb49938826a2dc2517c2362da9dafe
|
|
| MD5 |
a85502a344944337d66eefc4c10cfeff
|
|
| BLAKE2b-256 |
c9eab35e8968c087d8d19f22b64c9119861451a08363581aaade77d34bd7ce75
|
Provenance
The following attestation bundles were made for trrack_widget-0.0.1a2.tar.gz:
Publisher:
release.yml on kirangadhave/trrackpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trrack_widget-0.0.1a2.tar.gz -
Subject digest:
bc1c0ae1fd04d65a8c3cbd23348de6c864fb49938826a2dc2517c2362da9dafe - Sigstore transparency entry: 1940494627
- Sigstore integration time:
-
Permalink:
kirangadhave/trrackpy@7a93ba18ae1be2ef4dd40d48beec0a73661f139c -
Branch / Tag:
refs/tags/v0.0.1a2 - Owner: https://github.com/kirangadhave
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7a93ba18ae1be2ef4dd40d48beec0a73661f139c -
Trigger Event:
push
-
Statement type:
File details
Details for the file trrack_widget-0.0.1a2-py3-none-any.whl.
File metadata
- Download URL: trrack_widget-0.0.1a2-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
427f02056bdbf0daf43d5067c7cc51a17f5ef65f466f6e465b5433cfb96c1d7e
|
|
| MD5 |
3ff254de27a86481dd2f19289114dcbc
|
|
| BLAKE2b-256 |
fb27d26953f799c84bf40290ffe37145cb0e70ae9d2597345c53df7ca9be821a
|
Provenance
The following attestation bundles were made for trrack_widget-0.0.1a2-py3-none-any.whl:
Publisher:
release.yml on kirangadhave/trrackpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trrack_widget-0.0.1a2-py3-none-any.whl -
Subject digest:
427f02056bdbf0daf43d5067c7cc51a17f5ef65f466f6e465b5433cfb96c1d7e - Sigstore transparency entry: 1940494707
- Sigstore integration time:
-
Permalink:
kirangadhave/trrackpy@7a93ba18ae1be2ef4dd40d48beec0a73661f139c -
Branch / Tag:
refs/tags/v0.0.1a2 - Owner: https://github.com/kirangadhave
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7a93ba18ae1be2ef4dd40d48beec0a73661f139c -
Trigger Event:
push
-
Statement type: