Metadata-Version: 2.5
Name: laranex-schema-viewer
Version: 0.1.0
Summary: Framework-independent SQLAlchemy and SQLModel schema snapshots, ERD viewer, and read-only MCP tools
Project-URL: Homepage, https://github.com/laranex/python-schema-viewer
Project-URL: Documentation, https://laranex.github.io/python-schema-viewer/
Project-URL: Repository, https://github.com/laranex/python-schema-viewer
Project-URL: Issues, https://github.com/laranex/python-schema-viewer/issues
Author-email: Soe Thura <thixpin@gmail.com>
License-Expression: MIT
License-File: LICENSE
License-File: NOTICE
Keywords: database,erd,mcp,schema,sqlalchemy,sqlmodel
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Documentation
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pydantic<3,>=2.7
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mcp<3,>=2.3; extra == 'dev'
Requires-Dist: pyyaml<7,>=6; extra == 'dev'
Requires-Dist: ruff<0.18,>=0.8; extra == 'dev'
Requires-Dist: sqlalchemy<3,>=2.0; extra == 'dev'
Requires-Dist: sqlmodel<0.1,>=0.0.22; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.3; extra == 'mcp'
Provides-Extra: sqlalchemy
Requires-Dist: sqlalchemy<3,>=2.0; extra == 'sqlalchemy'
Provides-Extra: sqlmodel
Requires-Dist: sqlalchemy<3,>=2.0; extra == 'sqlmodel'
Requires-Dist: sqlmodel<0.1,>=0.0.22; extra == 'sqlmodel'
Description-Content-Type: text/markdown

# Laranex Schema Viewer

Framework-independent schema snapshots, an interactive ERD, and read-only MCP tools for **SQLAlchemy 2.x and SQLModel**. Inspired by [Laravel Schema Viewer](https://github.com/laranex/laravel-schema-viewer).

Build once from model definitions, then browse or query the saved JSON without starting your application or accessing its database. Foreign keys and declared ORM relationships remain separate throughout extraction, viewing, and MCP queries.

## Quick start

Requires Python 3.10+. Install from PyPI in an isolated environment:

```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install 'laranex-schema-viewer[sqlmodel,mcp]'

laranex-schema-viewer build \
  --project-root /absolute/path/to/application \
  --module myapp.models --recursive \
  --output schema-viewer.json

laranex-schema-viewer serve --snapshot schema-viewer.json
```

Open **http://127.0.0.1:8765** to search tables, inspect indexes and relationships, and navigate the graph. The viewer needs no Node build or web framework.

Build only trusted modules: imports and mapper callbacks execute application code. Snapshots describe declared metadata, not deployed database state; review them before sharing.

## Documentation

- [Installation](https://laranex.github.io/python-schema-viewer/installation.html) and [quick start](https://laranex.github.io/python-schema-viewer/quick-start.html)
- [SQLAlchemy](https://laranex.github.io/python-schema-viewer/sqlalchemy.html), [SQLModel](https://laranex.github.io/python-schema-viewer/sqlmodel.html), and [model discovery](https://laranex.github.io/python-schema-viewer/discovery.html)
- [CLI reference](https://laranex.github.io/python-schema-viewer/cli.html) and [interactive viewer](https://laranex.github.io/python-schema-viewer/viewer.html)
- [MCP for Codex and Claude Code](https://laranex.github.io/python-schema-viewer/mcp.html)
- [Agent skills](https://laranex.github.io/python-schema-viewer/agent-skills.html) and [troubleshooting](https://laranex.github.io/python-schema-viewer/troubleshooting.html)

Install agent skills with `npx skills add laranex/python-schema-viewer`; see the [skills guide](https://laranex.github.io/python-schema-viewer/agent-skills.html).

## Contributing

See [AGENTS.md](https://github.com/laranex/python-schema-viewer/blob/main/AGENTS.md) for architecture, development commands, testing, and documentation maintenance. [Validation](https://github.com/laranex/python-schema-viewer/blob/main/docs/validation.md) and [skill verification](https://github.com/laranex/python-schema-viewer/blob/main/docs/agent-skills-validation.md) describe test coverage and limitations. Report vulnerabilities as described in [SECURITY.md](https://github.com/laranex/python-schema-viewer/blob/main/SECURITY.md).

Documentation Markdown lives in `docs/`; VitePress tooling lives in `.gh-page/`:

```bash
cd .gh-page
npm install
npm run dev -- --port 5173 --strictPort
```

Preview at **http://127.0.0.1:5173/python-schema-viewer/**.

## License

[MIT](https://github.com/laranex/python-schema-viewer/blob/main/LICENSE). See [NOTICE](https://github.com/laranex/python-schema-viewer/blob/main/NOTICE) for attribution.
