viur-revision
Automatic revision tracking and rollback for ViUR skeletons.
What it does
viur-revision snapshots the pre-write state of any tracked skeleton into a
companion datastore kind (<kind>_revision) on every write. Each revision
entity carries:
- a verbatim copy of all original entity properties
origin_key— the original entity's keyrevision_index— monotonically increasing counter per originrevision_date— UTC timestamp of the snapshotrevision_change_list— bone names that changed in this write
The package adds endpoints to list, view, restore, and delete revisions, plus a tiered retention task that thins out the history over time.
Requirements
- Python ≥ 3.12
- viur-core ≥ 3.7, < 4
Install
pip install spltz-viur-revision
Usage
1. Make a skeleton track revisions
from viur.revision import RevisionAbstractSkel
class ExampleSkel(RevisionAbstractSkel, Skeleton):
# Track every write (default):
pass
Or only react to changes on specific bones:
class ExampleSkel(RevisionAbstractSkel, Skeleton):
revision_fields = ["title", "body"]
2. Expose revision endpoints on the module
from viur.revision import RevisionModule
class Example(RevisionModule, List):
...
This adds:
GET /<module>/list_revision?key=<entity-key>GET /<module>/view_revision?key=<entity-key>&version=<n|latest>POST /<module>/apply_revision(skey-protected)POST /<module>/delete_revision(skey-protected)GET /<module>/cleanup_revisions_now(manual retention run)
All endpoints require either the root right or <moduleName>-manage.
3. Retention
A daily PeriodicTask thins history per origin_key:
| Age | Retention |
|---|---|
| < 24h | keep all |
| 1d–7d | 1 per hour (latest) |
| 7d–30d | 1 per day (latest) |
| > 30d | 1 per week (latest) |
Documentation
Full reference at sprengplatz.github.io/viur-revision.
Development
git clone https://github.com/sprengplatz/viur-revision
cd viur-revision
pip install -e ".[dev]"
pytest # 100% coverage required
mkdocs serve # docs at http://localhost:8000
License
MIT — see LICENSE.
Metadata
Release files for spltz-viur-revision 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spltz_viur_revision-0.1.0.tar.gz | 15.3 kB | With provenance | Details for spltz_viur_revision-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spltz_viur_revision-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for spltz_viur_revision-0.1.0-py3-none-any.whl |
Total release size: 26.7 kB
Release files / spltz_viur_revision-0.1.0.tar.gz
| Download URL | spltz_viur_revision-0.1.0.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f48ecde6866d3760028ef39eb63b5ebd83543a7c4a2f8abc1a0969a384a156e
|
|
BLAKE2b-256 checksum How to use checksums |
fa74a4ab4ad8e8c8c8ed4c0db1003421572719fc5ffcc40436b95dda5f14dd08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logRelease files / spltz_viur_revision-0.1.0-py3-none-any.whl
| Download URL | spltz_viur_revision-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2309451a513c2b811e2e83eec5b20e3420c2c6f2bcfa9a3d2df085ae2c09ebf3
|
|
BLAKE2b-256 checksum How to use checksums |
dffedd1260434a986001594740549991632c2cbec8e20af1f41cbcc527e36969
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logSecurity for spltz-viur-revision 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for spltz_viur_revision-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.