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

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.0
File Size Uploaded
mdmodels-0.4.0.tar.gz 569.4 kB Details

Built distribution (wheel)

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

Total release size: 736.8 kB

Release files / mdmodels-0.4.0.tar.gz

Download URL mdmodels-0.4.0.tar.gz
Size 569.4 kB
Tags Source
SHA-256 checksum
How to use checksums
47c5ac9b0351f4da3f3cceed356fa356f4bb1c263b462a9ee249a58e5b690f59
BLAKE2b-256 checksum
How to use checksums
81655698ee1bb1ccdf60e3a7b82dda7f0505c0c663fe20f5440b9da546178a25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.0-py3-none-any.whl

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

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

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