Skip to main content

Virtuals

Virtual Python collections over any storage.

Dict, list, set, indexed dict, tree — they look and feel like native Python, but they don't physically exist as in-memory collections. They're virtual: lazy views that compose data structure logic over flat tuple-key storage. Any backend that implements the storage protocol gets every data structure for free.

Like SQLAlchemy for Python collections. No SQL, no specific backend. Define your structure, plug in a store.

PyPI: virtuals-py | Import: virtuals

What It Does

from virtuals import View, Container
from virtuals.storages.mem import InMemoryStorage
from virtuals.codecs import NoOpCodec

storage = InMemoryStorage(codec=NoOpCodec())
storage.open()

with storage.transaction() as tx:
    users = DictView.open_root(tx)
    users["alice"] = {"name": "Alice", "age": 30}
    users["bob"] = {"name": "Bob", "age": 25}

    # Navigate naturally
    for user_id, profile in users.items():
        print(f"{user_id}: {profile['name']}")

# Under the hood: flat KV pairs with tuple keys
# ("users", "alice", "name") -> "Alice"
# ("users", "alice", "age")  -> 30

Three Layers

Layer 1: Storage

Generic tuple-key KV store with lexicographic ordering.

storage.put(("users", "alice", "name"), "Alice")
value = storage.get(("users", "alice", "name"))

Layer 2: Container

Hierarchy and parent-child relationships over flat keys.

container = Container(storage, ("users", "alice"))
container.create()
children = container.children()  # ["name", "age"]

Layer 3: View

Data structure abstractions (dict, list, set) over containers.

users = DictView.open_root(tx)
users["alice"] = "data"

Installation

pip install virtuals-py
pip install virtuals-py[rocksdb]  # with RocksDB backend

Features

  • Virtual collections: Work with dicts, lists, sets over any KV backend
  • Tuple keys: Natural hierarchical addressing with lexicographic ordering
  • Backend agnostic: Works with any ordered KV store (RocksDB, LMDB, in-memory)
  • Observable: Watch for changes at any level of the hierarchy
  • Transactional: Full ACID support when the backend provides it
  • Lazy: Nothing materializes until accessed

License

Apache-2.0

Metadata

Release files for virtuals-py 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for virtuals-py 0.1.7
File Size Uploaded
virtuals_py-0.1.7.tar.gz 172.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for virtuals-py 0.1.7
File Interpreter ABI Platform
virtuals_py-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 417.0 kB

Release files / virtuals_py-0.1.7.tar.gz

Download URL virtuals_py-0.1.7.tar.gz
Size 172.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b4be590479ded9c674712229730a09691298de93c2c91c81b39524d167eafcdf
BLAKE2b-256 checksum
How to use checksums
6d8d2cc227da1d49b8411d4009e18b2dda13c969521d646fd7bf272e943114e4
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 Aug 19, 2026.

Transparency log

Release files / virtuals_py-0.1.7-py3-none-any.whl

Download URL virtuals_py-0.1.7-py3-none-any.whl
Size 244.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df49ac112dc3ff42102011e952d1fdf3a3c3ec52e78706ea2fddf9e960b632d2
BLAKE2b-256 checksum
How to use checksums
b1f1b07b2b3471e0e510b36efb932774c5a923e5f74fa4e198c711fb9c48883e
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 Aug 19, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page