Skip to main content

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

Project description

ModelVault

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.16.0,<0.17"

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.16.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.16.0.tar.gz (236.2 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.16.0-cp39-abi3-win_arm64.whl (1.9 MB view details)

Uploaded CPython 3.9+Windows ARM64

modelvault-0.16.0-cp39-abi3-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

modelvault-0.16.0-cp39-abi3-musllinux_1_2_x86_64.whl (2.1 MB view details)

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

modelvault-0.16.0-cp39-abi3-musllinux_1_2_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

modelvault-0.16.0-cp39-abi3-manylinux_2_28_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

modelvault-0.16.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

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

modelvault-0.16.0-cp39-abi3-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

modelvault-0.16.0-cp39-abi3-macosx_10_12_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for modelvault-0.16.0.tar.gz
Algorithm Hash digest
SHA256 aa8378dbb9f6beffa76ae8cbbfacf549486d0e195a72e28ca299b737cc839eef
MD5 8994a7a2d0dc15d73afbd2f4c2d88b53
BLAKE2b-256 8ac8e2d64e9d80040efd1e01fe25ef121f5faa473ce40631c34dbe4e66c1f271

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modelvault-0.16.0-cp39-abi3-win_arm64.whl
  • Upload date:
  • Size: 1.9 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.16.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 7b3defb3ce620039e63eef90bb7973d727b42ab8e3bc8303490429f9bc32c96b
MD5 df59a3881e5a2c0e7951d5701bb7ee96
BLAKE2b-256 a944352248e4a1723994dd3b6ccd1306b74b3c6c2bd5b8e02c66572626e5ae66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modelvault-0.16.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.1 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.16.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 95e42e53aba0de5c8f798863ab25a3271ef8405c51728a15399977e39a187a66
MD5 6ad6ec1561ec2f8702b04986068cf069
BLAKE2b-256 0a29e250a6edd613451c680dbf20ddcbe528c68762d369f0f5bf3ac31090796a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for modelvault-0.16.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1b2b65d4017f83675f9c1a8c0c9b9e8e1ea541526776e57c6e698e81f677b4a2
MD5 1c7c4d8428297af1251b6428b046110e
BLAKE2b-256 49eda8c0b32454e5a315e55ad3f3b70671b9f66495915d658419aa8484c46cd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for modelvault-0.16.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5cafa8505f9c0e4d15eaa43e320430c688551968bbe8cfe7510d2c9f63afab68
MD5 69b63f77eabcad206f523e86d7fad301
BLAKE2b-256 c9e996e0a637d080419b221e63a4ee393d18aaef3b9132bcecfaa528b5c6f55f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for modelvault-0.16.0-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 55f1e962e785da4c896b15476897f81b300d7147f6d5b51f6666497c5d8d3674
MD5 b7b11fe76d89328b0a4fe018d9d7fea8
BLAKE2b-256 35a30042eb943d36b449d45b2d617ec02db11459328f4111a48683c2965331dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for modelvault-0.16.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1245e57151e7508606fd34e4d8510a460c1f3810157c09a4449936cf3a798bde
MD5 1c5fcd5d3c49905dcd0a9811783984ec
BLAKE2b-256 d04427fcfc8ac0536e0a20cc8bb9ee01a87063b2ff2cef43d916f48bfa171f4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for modelvault-0.16.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec12950aa612690991692d7973e74f4e15bbb3f8d67e92d11532eb436d42f39d
MD5 2d3a30c3a4dbc7d0dae993a8e8a5a5dc
BLAKE2b-256 75ec2a83eca634b8576494a9aa795d8da6b204003ebf17e63d44f33ef368c4e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for modelvault-0.16.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a0a33a00387d2bf41c8aa69532a4669275614ba758decd502f5d6ec0f417442d
MD5 d975d21590538429faf3a4085955a450
BLAKE2b-256 a9212ce73f22e30413f9167324e5e61bcad4dd7a50b038c2b08c3aa0150774e8

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