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, SQLite, 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.12

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.12
File Size Uploaded Provenance Actions
virtuals_py-0.1.12.tar.gz 225.2 kB With provenance Details for virtuals_py-0.1.12.tar.gz

Built distribution (wheel)

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

Total release size: 528.1 kB

Release files / virtuals_py-0.1.12.tar.gz

Download URL virtuals_py-0.1.12.tar.gz
Size 225.2 kB
Tags Source
SHA-256 checksum
How to use checksums
40c69bca72e86d6543ca1fbb2a74c9ce23e1aa1ce03ce7a98f48b8cf2f8ac481
BLAKE2b-256 checksum
How to use checksums
76226cf68d2a046456f7e94dbd05f4e8e445d8e7e3f22ba8a24e9ef68350fc2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

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

Download URL virtuals_py-0.1.12-py3-none-any.whl
Size 302.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e25ad994288672e5e3ca1e0a89e4b75d28b5f5b43623cb22f2a0730303fe8ad
BLAKE2b-256 checksum
How to use checksums
331501f366504b312f22fa5079e7e1ab3916b15d60aa90336f88073b439c65d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

Security for virtuals-py 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for virtuals_py-0.1.12.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 Nov 3, 2026.

Transparency log

A 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.

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