Track the state of anywidget widgets.
Read the documentation at kirangadhave.me/trrackpy.
from trrack_widget import JsonFileStore, Persisted, Trrackable
Persisted(counter, store=JsonFileStore("state.json")) # comes back as you left it
Trrackable(counter) # undo, redo, and branchPersistedsaves a widget's state and restores it the next time it loads.Trrackablerecords every change as a history you can navigate.- A store decides where the state lives: a file, a database, the URL. Write your own with two methods.
| Package | What | Docs |
|---|---|---|
trrack-widget |
Persisted and Trrackable, the two widget wrappers. |
packages/trrack-widget |
trrack |
The branching history model and the stores. Pure Python, no UI dependencies. | packages/trrack |
Runnable marimo notebooks are in examples.
See CONTRIBUTING.md for setup, the dev loop, and releases.
BSD-3-Clause. trrackpy is the Python sibling of trrackjs.