revlet
Salsa-inspired incremental computation for Python 3.9+, with no runtime dependencies.
Revlet caches function results and tracks the inputs each function reads. When an input changes, it recomputes affected queries and reuses results whose dependencies are unchanged. Each database has its own inputs and cache.
Revlet is independent of the Rust Salsa project.
Quick start
Install from GitHub (requires Git):
python -m pip install "git+https://github.com/pluveto/revlet.git"
from revlet import Database, tracked
db = Database()
price = db.input(10)
quantity = db.input(3)
@tracked
def subtotal(price, quantity):
return price.value * quantity.value
assert subtotal(price, quantity) == 30
assert subtotal(price, quantity) == 30 # Reuses the completed computation.
price.value = 12
assert subtotal(price, quantity) == 36
The inputs identify the database when you call a query. Nested queries use the same database. For a query without input arguments, bind it once:
@tracked
def invoice():
return subtotal(price, quantity)
calculate_invoice = db.bind(invoice)
assert calculate_invoice() == 36
You can reuse the same query definitions with inputs from different databases.
Mutable data
items = db.input([1, 2])
@tracked
def total(items):
return sum(items.value)
with items.edit() as values:
values.append(3)
assert total(items) == 6 # Evaluates current edits without using normal caches.
assert total(items) == 6
- Reads and query results expose read-only interfaces, including nested containers.
- Writes use property replacement or an explicit editing scope.
- A write scope registers possible changes even if its body raises. It does not roll back.
- Borrowed views expire when a managed write begins. Read the input or query again.
- Use
copy_value(view)for an explicit independent copy of supported built-in data. - If you keep the original collection passed to an input, change it through the input's editing scope so Revlet can track the update.
- In-place edits conservatively invalidate readers that might share mutable storage.
Working with larger applications
Use value adapters for custom data types, dependency tokens for external state, and cancellation tokens for long computations. You can inspect dependencies and prune caches explicitly. The user guide covers these APIs and custom cycle solvers.
Queries within one database run synchronously under a shared lock. Separate
databases can run independently. Async applications can call synchronous queries
through asyncio.to_thread.
The runtime supports Python 3.9+. Bundled type stubs use Python 3.12 syntax; see typing compatibility for IDE and type checker setup.
Documentation
- User guide
- How caching works
- Runtime and typing compatibility
- Executable examples
- Benchmarking
- Benchmark results
- Contributing
- Changelog
License
MIT © 2026 pluveto.
Metadata
Release files for revlet 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 | |
|---|---|---|---|---|
| revlet-0.1.0.tar.gz | 252.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| revlet-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 270.6 kB
Release files / revlet-0.1.0.tar.gz
| Download URL | revlet-0.1.0.tar.gz |
|---|---|
| Size | 252.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30c541b892bb97302fc3c7a5bf815a6830a3d3b3fcbf9f59a625a640d0796a32
|
|
BLAKE2b-256 checksum How to use checksums |
f9ebd47d68583c16ab290b6d3f006a16f7e129e5ab14f649ab1fb49dae441fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 6, 2026.
Transparency logRelease files / revlet-0.1.0-py3-none-any.whl
| Download URL | revlet-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e9d22a942173797c6617ad66d2ae6b52e7418cf387f41b35368c607f9084701
|
|
BLAKE2b-256 checksum How to use checksums |
4444a3c3237ba6f47a5c024f91103dd84b0dda6a4f6675b722521aedf87cad05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 6, 2026.
Transparency logSecurity for revlet 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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for revlet-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 Oct 6, 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.