Metadata-Version: 2.5
Name: yidl-undoable
Version: 0.1.2
Summary: YIDL generated transactional data classes with sparse undo history
Project-URL: Repository, https://github.com/owebeeone/yidl-undoable
Project-URL: Documentation, https://github.com/owebeeone/yidl-undoable/blob/main/docs/API.md
Project-URL: Issues, https://github.com/owebeeone/yidl-undoable/issues
Requires-Python: <3.16,>=3.12
Requires-Dist: astichi>=1.1.3
Requires-Dist: yidl-cache==0.1.0
Requires-Dist: yidl-lifecycle>=0.1.0
Requires-Dist: yidl>=0.1.0
Provides-Extra: dev
Requires-Dist: hatchling>=1.24; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Provides-Extra: regenerate
Requires-Dist: yidl-dataclass==0.1.1; extra == 'regenerate'
Description-Content-Type: text/markdown

# YIDL Undoable

Make an edit to a Python model, undo it, and redo it. Declare which fields belong
to history; Undoable supplies guarded transactions and a shared history for the
root objects and their managed descendants. You do not need to write YIDL.

```python
from yidl_undoable import UndoRedoManager, managed, undoable

@undoable
class Document:
    title: str = managed(default="Draft")

history = UndoRedoManager()
document = Document(transaction_manager=history)
history.initialize(document)
with history.begin():
    document.title = "Ready"
assert history.undo() and document.title == "Draft"
assert history.redo() and document.title == "Ready"
```

Install with `python -m pip install yidl-undoable`. The package targets CPython
3.12–3.15; see the [installation qualification](docs/GettingStarted.md#installation)
for platform/dependency limits.

Start with [your first undo](docs/GettingStarted.md), then learn
[frames and views](docs/Concepts.md), [collections](docs/Collections.md), and
[nested objects](docs/ObjectGraphs.md). The [public API](docs/API.md) gives the
complete contract. The searchable documentation site is
[owebeeone.github.io/yidl-undoable](https://owebeeone.github.io/yidl-undoable/).

History is in memory and linear. A new commit after undo discards redo.
Only managed data is restored; caches, ordinary fields and external resources
are not rewound. Live handles follow the selected frame; use a
[snapshot](docs/Snapshots.md) to retain old committed managed values.

Version 0.1.2 adds field-specific generated accessors and optional
[compiled-builder caching](docs/Cache.md). Version 0.1.1 does not include these
additions; the transaction API remains the same.
The [original experiment](dev-docs/ExperimentResults.md),
[accessor experiment](dev-docs/SpecializedAccessorExperiment.md) and
[cache probe](dev-docs/SpecializedAccessorCacheProbe.md) preserve separate evidence
and measurement limits. Contributor details live in [CONTRIBUTING.md](CONTRIBUTING.md);
releases use [Gearu](RELEASE.md).
