Skip to main content

Python MD-Models

Tests PyPI - Version PyPI - Python Version

Build metadata-first Python apps from Markdown-defined models. mdmodels is the Python package for the MDModels Rust crate, with batteries included for data modeling, AI workflows, SQL/graph backends, and API generation. 🚀

Why MD-Models?

  • 🧩 Model once in Markdown, then generate strongly typed Python models
  • 🤖 Work with AI for extraction, mapping, Q&A, and similarity search
  • 🗃️ Persist and query with SQL, vectors, and graph databases
  • 🌐 Ship interfaces fast via REST, GraphQL, and MCP helpers

What's in the bag? 🎒

  • 🧱 Core model tooling - Load, inspect, and work with metadata models
  • 🐍 Pydantic generation - Generate rich Python model classes from MD-Models
  • 🤖 LLM workflows - Extract, map, search, and answer questions over metadata
  • 🗄️ SQL and vector search - Build SQL-backed stores and pgvector-style embedding workflows
  • 🕸️ Graph databases - Build and query graph representations of your models
  • 🌐 API generation - Expose model-backed services through REST and GraphQL helpers
  • 🔌 MCP integrations - Create MCP-compatible interfaces for model and SQL workflows

Note: This package is actively evolving and APIs may change. Feedback and contributions are welcome. 🙌

Installation

We recommend using uv for a fast, reproducible Python workflow.

Install uv (if needed):

curl -LsSf https://astral.sh/uv/install.sh | sh

Install the base package:

uv pip install mdmodels

Install optional feature sets:

# LLM tools
uv pip install "mdmodels[chat]"

# Graph database tools
uv pip install "mdmodels[graph]"

# SQL backends
uv pip install "mdmodels[postgres]"
uv pip install "mdmodels[mysql]"
uv pip install "mdmodels[sqlserver]"

# Vector search (pgvector + embeddings)
uv pip install "mdmodels[pgvector]"

# API integrations
uv pip install "mdmodels[rest]"
uv pip install "mdmodels[graphql]"

# MCP integration
uv pip install "mdmodels[mcp]"

Documentation 📚

Guides, tutorials, and API usage:

Development

Run all tests:

uv run pytest

Run tests with coverage report:

uv run pytest --cov=mdmodels --cov-report=html

Run tests in Docker:

docker build --build-arg PYTHON_VERSION=3.12 -t mdmodels .
docker run -v $(pwd):/app mdmodels

Use the helper script:

./run-tests.sh --python=3.12

Skip expensive tests:

uv run pytest -m "not expensive"

Metadata

Release files for mdmodels 0.4.1

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

Source distribution (sdist)

Source distribution for mdmodels 0.4.1
File Size Uploaded Provenance Actions
mdmodels-0.4.1.tar.gz 569.8 kB Without provenance Details for mdmodels-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mdmodels 0.4.1
File Interpreter ABI Platform Actions
mdmodels-0.4.1-py3-none-any.whl Python 3 none any Details for mdmodels-0.4.1-py3-none-any.whl

Total release size: 737.5 kB

Release files / mdmodels-0.4.1.tar.gz

Download URL mdmodels-0.4.1.tar.gz
Size 569.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5095a4605a6b092f2c893d787e48dd903a42ef6970b5ab42e27d9f509d61c84c
BLAKE2b-256 checksum
How to use checksums
60fa4ac3ce00e5ef8dce4a02131fe9b6e03b08d2c34e036d25da668f96f69727
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mdmodels-0.4.1-py3-none-any.whl

Download URL mdmodels-0.4.1-py3-none-any.whl
Size 167.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ff013dcd21fbe34966a8bd63e9a15acd43066570d4f61bd0ad25e71a9191e12
BLAKE2b-256 checksum
How to use checksums
3d433e9e70c98fbdbf6120cb12968710972ed86eca99ec65282d6d85d34ad236
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for mdmodels 0.4.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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