A reversible-operations journal library with session-based history and undo orchestration.
Project description
unmake
unmake is a Python library for recording destructive operations in sessions and orchestrating undos later.
It is intentionally split into:
- Storage backend (you choose persistence strategy, e.g., SQLite)
- Operation payload (you define schema and reconstruction)
- Undo orchestration (library provides session + operation ordering)
Install
uv sync
Quickstart
from pathlib import Path
from unmake import HistoryManager, OperationRegistry, SQLiteStorage
manager = HistoryManager(SQLiteStorage("history.db"))
# Record a run
with manager.start_session(script="dangerous_script.py", args=["--force"]) as session:
Path("a.txt").rename("b.txt")
session.record_operation("fs.move", {"src": "a.txt", "dst": "b.txt"})
# Register reconstruction logic for undo
class MoveUndo:
def __init__(self, payload: dict):
self.src = payload["src"]
self.dst = payload["dst"]
def undo(self) -> None:
Path(self.dst).rename(self.src)
registry = OperationRegistry()
registry.register("fs.move", MoveUndo)
# Undo all operations in reverse order
session_id = manager.list_sessions(limit=1)[0].session_id
manager.undo_session(session_id, registry)
Development workflow
This project is configured for uv, make, and PEP 621 metadata.
make install
make test
make lint
make build
Publish
# Configure token in env first
# export UV_PUBLISH_TOKEN=...
make publish
Bump version
make bump-patch
make bump-minor
make bump-major
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
unmake-0.1.2.tar.gz
(7.2 kB
view details)
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 unmake-0.1.2.tar.gz.
File metadata
- Download URL: unmake-0.1.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
586561e756666e0b284ddc539c001e12d99ae335fddb6454eaefbebafa321bca
|
|
| MD5 |
61842bba86abfc301dc6b8dae8406c94
|
|
| BLAKE2b-256 |
33df4b00d95b14f1c0506d7e4968c2ac9c3d00282d2f9bab7d810abd967009d5
|
File details
Details for the file unmake-0.1.2-py3-none-any.whl.
File metadata
- Download URL: unmake-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae055a2d696594548caf3b9800bb73ec7b794a3745561b389af35bfd0fe314b2
|
|
| MD5 |
88023d8b781442863f00429818cef47a
|
|
| BLAKE2b-256 |
f77f9d5686851043d83700ee8babbc84578b0564d53928ce109e5b194d92db7b
|