Metadata-Version: 2.4
Name: mdmodels
Version: 0.3.1
Summary: Python package for the MDModels Rust crate
Author-email: Jan Range <range.jan@web.de>
License-Expression: MIT
Requires-Python: >=3.11
Requires-Dist: astropy>=6.1.7
Requires-Dist: bigtree<0.22,>=0.21.1
Requires-Dist: dotenv>=0.9.9
Requires-Dist: dotted-dict<2,>=1.1.3
Requires-Dist: fastexcel>=0.19.0
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: mdmodels-core<0.3,>=0.2.9
Requires-Dist: nest-asyncio<2,>=1.6.0
Requires-Dist: pandas>=2.2.3
Requires-Dist: polars>=1.39.3
Requires-Dist: pydantic-xml<3,>=2.12.1
Requires-Dist: python-forge<19,>=18.6.0
Requires-Dist: python-jsonpath<2,>=1.2.0
Requires-Dist: rich<14,>=13.9.4
Requires-Dist: toml>=0.10.2
Requires-Dist: typer>=0.20.0
Requires-Dist: validators<0.35,>=0.34.0
Provides-Extra: chat
Requires-Dist: openai<2,>=1.57.0; extra == 'chat'
Requires-Dist: tabulate<0.10,>=0.9.0; extra == 'chat'
Provides-Extra: graph
Requires-Dist: neomodel<6,>=5.4.0; extra == 'graph'
Provides-Extra: graphql
Requires-Dist: strawberry-graphql>=0.296.0; extra == 'graphql'
Requires-Dist: uvicorn>=0.38.0; extra == 'graphql'
Provides-Extra: mcp
Requires-Dist: fastmcp[apps]>=3.2.0; extra == 'mcp'
Requires-Dist: toon-format==0.9.0b1; extra == 'mcp'
Provides-Extra: mysql
Requires-Dist: pymysql>=1.1.2; extra == 'mysql'
Requires-Dist: sqlmodel>=0.0.22; extra == 'mysql'
Provides-Extra: pgvector
Requires-Dist: fastembed>=0.7.3; extra == 'pgvector'
Requires-Dist: pgvector>=0.4.1; extra == 'pgvector'
Requires-Dist: psycopg2-binary>=2.9.11; extra == 'pgvector'
Requires-Dist: sentence-transformers<3,>=2.2.2; extra == 'pgvector'
Requires-Dist: sqlmodel<0.0.23,>=0.0.22; extra == 'pgvector'
Provides-Extra: postgres
Requires-Dist: psycopg2-binary>=2.9.11; extra == 'postgres'
Requires-Dist: sqlmodel<0.0.23,>=0.0.22; extra == 'postgres'
Provides-Extra: rest
Requires-Dist: fastapi>=0.123.8; extra == 'rest'
Requires-Dist: pyyaml>=6.0.3; extra == 'rest'
Requires-Dist: uvicorn>=0.38.0; extra == 'rest'
Provides-Extra: sqlserver
Requires-Dist: pyodbc>=5.3.0; extra == 'sqlserver'
Requires-Dist: sqlmodel>=0.0.22; extra == 'sqlserver'
Description-Content-Type: text/markdown

# Python MD-Models

![Tests](https://github.com/FairCHemistry/py-mdmodels/actions/workflows/test.yml/badge.svg)
![PyPI - Version](https://img.shields.io/pypi/v/mdmodels)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mdmodels)

Build metadata-first Python apps from Markdown-defined models. `mdmodels` is the Python package for the [MDModels Rust crate](https://github.com/FairCHemistry/md-models), 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):

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

Install the base package:

```bash
uv pip install mdmodels
```

Install optional feature sets:

```bash
# 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:

- [py-mdmodels.vercel.app](https://py-mdmodels.vercel.app/)

## Development

Run all tests:

```bash
uv run pytest
```

Run tests with coverage report:

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

Run tests in Docker:

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

Use the helper script:

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

Skip expensive tests:

```bash
uv run pytest -m "not expensive"
```
