Versioned key-value store with git-like commit, branch, and merge semantics.
Project description
kvgit 🔀
Git-style versioning for your data. Commits, branches, and merges -- backed by a dict-like MutableMapping.
| Features | Description |
|---|---|
| Dict interface | MutableMapping[str, Any] -- reads and writes work like a dict |
| Commits | Immutable, content-addressable snapshots with rollback |
| Branches | Cheap forks with CAS-based optimistic concurrency |
| Three-way merge | Auto-merges non-overlapping changes; pluggable merge fns for conflicts |
| Garbage collection | High/low water rebase drops cold keys automatically |
| Pluggable backends | In-memory, disk (diskcache), git (GitPython), or bring your own KVStore |
Install
pip install kvgit # in-memory only
pip install kvgit[disk] # adds disk backend via diskcache
pip install kvgit[git] # adds git backend via GitPython (requires git on PATH)
Quick example
import kvgit
main = kvgit.store()
main["user"] = "alice"
main["score"] = 0
main.commit()
# Branch and diverge
dev = main.create_branch("dev")
dev["score"] = 999
dev.commit()
print(main["score"]) # 0 (main unchanged)
print(dev["score"]) # 999 (dev branch)
Development
uv sync --extra dev
uv run pytest
Documentation
See docs/ for detailed documentation:
- Quick Start -- common patterns with runnable examples
- API Reference -- full reference for all classes, methods, and types
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
kvgit-0.1.5.tar.gz
(28.6 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
kvgit-0.1.5-py3-none-any.whl
(32.7 kB
view details)
File details
Details for the file kvgit-0.1.5.tar.gz.
File metadata
- Download URL: kvgit-0.1.5.tar.gz
- Upload date:
- Size: 28.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b8a5c317ed4e4c3ce148842c7a97f25e79022159d419a39d328ba4ea2da6ff0
|
|
| MD5 |
c603f00e5b5ee7648d58fa1af51cad33
|
|
| BLAKE2b-256 |
b4f4fc6eb1bbfd066bd75aff5e57d9eacbefae6949b7bd88530b2b31262a59f7
|
File details
Details for the file kvgit-0.1.5-py3-none-any.whl.
File metadata
- Download URL: kvgit-0.1.5-py3-none-any.whl
- Upload date:
- Size: 32.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcbca7c8636af3f397d2356d7d8780641a7b42a0e9be74ef63ebc0d64959638e
|
|
| MD5 |
7c8d145bdf999e6c61faf2d5fdf318b0
|
|
| BLAKE2b-256 |
d6e48389159c92ee86a2edae068b64f82c2ce90b90d011d2e9c9e72cf42897a0
|