Skip to main content

Store Pydantic and dataclass models in a typed embedded database — validation, indexes, migrations, single-file deployment.

Project description

modelvault (Python)

CI PyPI Docs

Store Pydantic models directly

Schema-first typed storage for application models. Official CPython bindings for ModelVault (PyO3).

Store dataclasses and Pydantic v2 models with validation, indexes, migrations, and single-file deployment — no low-level schema JSON required for the recommended path.

Asyncio: AsyncDatabase runs engine work on a thread pool and supports concurrent reads on one handle (await asyncio.gather(...) for many get / query calls). Writes and transactions remain exclusive. See Async policy.

Read the docs: modelvault.readthedocs.io

Why ModelVault Positioning and tradeoffs
Pydantic guide Model-first schemas
FastAPI guide Async API services with AsyncDatabase
Async policy AsyncDatabase, concurrent reads
Quickstart First insert in minutes
Why ModelVault Positioning and design goals

Install

CPython 3.9+ · stable ABI wheels (cp39-abi3)

pip install "modelvault>=0.15.0,<0.16"

Quick start (Pydantic)

from pydantic import BaseModel
import modelvault

class Book(BaseModel):
    __modelvault_primary_key__ = "title"
    title: str
    year: int

db = modelvault.Database.open_in_memory()
books = modelvault.models.collection(db, Book)
books.insert(Book(title="ModelVault", year=2020))
print(books.get("ModelVault"))
print(modelvault.__version__)

Output:

title='ModelVault' year=2020
0.15.0

Dataclass example and indexed queries: Quickstart · Python guide

FastAPI: open with await AsyncDatabase.open(...), use modelvault.models.async_collection, and async def route handlers — FastAPI guide · runnable examples/fastapi_app.

Build from source

Requires Rust, Python 3.9+, and maturin.

cd python/modelvault && maturin develop --release && pytest -q

Contributor layout: python/README.md · full pipeline: make check-full from repo root

License

MIT — LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modelvault-0.15.0.tar.gz (210.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

modelvault-0.15.0-cp39-abi3-win_arm64.whl (1.8 MB view details)

Uploaded CPython 3.9+Windows ARM64

modelvault-0.15.0-cp39-abi3-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

modelvault-0.15.0-cp39-abi3-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

modelvault-0.15.0-cp39-abi3-musllinux_1_2_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

modelvault-0.15.0-cp39-abi3-manylinux_2_28_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

modelvault-0.15.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

modelvault-0.15.0-cp39-abi3-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

modelvault-0.15.0-cp39-abi3-macosx_10_12_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file modelvault-0.15.0.tar.gz.

File metadata

  • Download URL: modelvault-0.15.0.tar.gz
  • Upload date:
  • Size: 210.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for modelvault-0.15.0.tar.gz
Algorithm Hash digest
SHA256 ec39784c412c59fa349ecc29505f73cfae172909b14e68a846733ec438a76354
MD5 8eb00922dcf3159734c22df706803f45
BLAKE2b-256 908092db401d7e0ac9be037a70ca4e2dace9893a1bfbef6f86a8fec9d6b198ff

See more details on using hashes here.

File details

Details for the file modelvault-0.15.0-cp39-abi3-win_arm64.whl.

File metadata

  • Download URL: modelvault-0.15.0-cp39-abi3-win_arm64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.9+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for modelvault-0.15.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 9389de62f68f0253fb4c472a96f172588bfea9025945979b4f8ccbdde114ba15
MD5 e6977e085e0fa30fffbc21e1aec653fb
BLAKE2b-256 37e4c56d8eb0f359abd9a2e06ed6d72b9023ec57e4a5b5fab7ccbc9febee2386

See more details on using hashes here.

File details

Details for the file modelvault-0.15.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: modelvault-0.15.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for modelvault-0.15.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f8f2688c2b64ed7333dd2753b9766e45e3ab4d96c0b37098cf2b6260631f3d3f
MD5 b53ea86e8ea966895ed57982660aa3ad
BLAKE2b-256 44417773e83b3f7f98f116b2524ef707604f11b796faa544839e6c7c33251bd5

See more details on using hashes here.

File details

Details for the file modelvault-0.15.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for modelvault-0.15.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6c206ba5c9d7b8b9fc32ec7642154ff5a1a714078de5adb3902cf8488f0db085
MD5 18b5371258c44a37f23ad016e362d276
BLAKE2b-256 eb29ccb107c646cdb023839a0dc7b9b5c64bbdb4755a7ceff8f11b3986be972f

See more details on using hashes here.

File details

Details for the file modelvault-0.15.0-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for modelvault-0.15.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ddc138ac0ef04dcb35650013ae47f79dce441bc1b70474a10e2e051e2cf2f0c1
MD5 e7ffac113b9bb39c06217189ac7f9ce8
BLAKE2b-256 fbf66221bcae236107061af4e589c7d72e2d9175fd25e74a91f2ad86e9ee302d

See more details on using hashes here.

File details

Details for the file modelvault-0.15.0-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for modelvault-0.15.0-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b652a80487c601dc93adbc2d44d2785bc3cda5695e2239db164e27670d3088a9
MD5 70b1667c36eea3c99dad2abbf554dc6e
BLAKE2b-256 2e367b049d4c33278d7f519f09b96054777e464ef2c73a9343db3924f4a91f7f

See more details on using hashes here.

File details

Details for the file modelvault-0.15.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for modelvault-0.15.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dee063d22059f7adefa1fe8c749797c4b7da784d927832aa7af2c7b462df20ed
MD5 746972d464d45d475654b12cebe3d911
BLAKE2b-256 bd84ffedc62d878147c1c70dc4034a30d61a3ed5b1195a421191b32dd43a6db4

See more details on using hashes here.

File details

Details for the file modelvault-0.15.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for modelvault-0.15.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3c5899b27288ed02e81c32cc51970e732c1e2f0ea7603631f1421b120965156
MD5 4f206aaa9346b4ca9027b2358d7679ab
BLAKE2b-256 d657bdb3a452ae3389274f816cd5b498cfceacbac9d4212f1490c1557703dc31

See more details on using hashes here.

File details

Details for the file modelvault-0.15.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for modelvault-0.15.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f5ae8a06e3cf12fc93098dab111564ecc3ecee906332ee0f4223a47aff65eab9
MD5 516b99d58f2175811dd9606d7f224af0
BLAKE2b-256 b446f303f38dc821fadc99403229c6358e5a54ab7ae6ed0f82dc2b1cae5a48c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page