tool ·virtuals

Python collections over any storage.

Dicts, lists, sets, and trees that feel native to Python but live in RocksDB, LMDB, or memory.

Powersnu.kv

What it is.

The KV foundation under nu.kv. Standalone, dependency-light, usable on its own.

Native feel. Flat KV under.

Point a variable at storage. Read and write like a dict or a list. Nothing materializes until you touch it.

Views compose data-structure logic over flat tuple-key storage. Any store that implements the storage protocol gets every collection for free.

What you get.

SQLAlchemy-shaped ergonomics without the SQL. No ORM, no schema, no server process to run.

Every collection carries the same four properties, backend to backend. The API you learn on an in-memory store is the API you keep on RocksDB.

Backend-agnostic.

RocksDB, LMDB, in-memory. Bring your own.

Transactional.

Full ACID when the backend supports it.

Observable.

Watch changes at any level of the hierarchy.

Lazy.

Nothing loads until you access it.

Sixty seconds of code.

Open a root. Assign nested dicts. Open a list underneath. Commit.

Swap InMemoryStorage for RocksDBStorage and the same lines write to disk.

basic.py
python · 20 locpy
from virtuals import Navigator
from virtuals.views import EagerListView
from virtuals.storages.mem import InMemoryStorage
from virtuals.codecs import NoOpCodec
nav = Navigator(InMemoryStorage(codec=NoOpCodec()))
with nav.storage as storage, storage.transaction() as tx:
root = nav.root(tx)
# feels like a plain dict
root["alice"] = {"age": 30}
root["bob"] = {"age": 25}
# open a list under the same root
scores = root.open_child("scores", EagerListView)
scores.store([100, 200, 300])
scores.append(400)
# swap InMemoryStorage for RocksDB or LMDB, same code

Like what you see?

The project is young. Star it, join the room, watch what we ship next.