PYTHON TOOLING, WITH A CLEARER PICTURE
Laranex.
Schema Viewer
Understand how your data fits together.
Tables, constraints, and ORM relationships — in one explorable view.
pip install 'laranex-schema-viewer[sqlmodel,mcp]'Requires Python 3.10+. Choose your ORM extra: sqlalchemy, sqlmodel, django, tortoise, or peewee; add mcp for agents.
From model definitions to a shared view
Laranex Schema Viewer extracts declared schema metadata from SQLAlchemy 2.x, SQLModel, Django, Tortoise ORM, and Peewee; see supported ORMs. It saves a laranex-schema 2.0 JSON document, the format shared with the Laravel and Node.js schema viewers, that powers an interactive ERD and read-only MCP tools for coding agents. It can also read a database's catalogs, read-only, and reconcile them with your models.
Inspired by Laravel Schema Viewer, this Python package works independently of FastAPI, Flask, or any application server. Django support reads model metadata only and never starts the project.
What you can explore
- Tables, columns, primary keys, foreign keys, unique constraints, and check constraints.
- Index expressions, PostgreSQL predicates, included columns, and index methods.
- ORM relationships, including self references and association tables.
- Separate graph layers for physical foreign keys and ORM declarations.
- Searchable table details, graph navigation, and portable JSON documents.
How it works
- Build: import trusted model definitions and extract metadata.
- Inspect: open the saved document in the viewer.
- Ask: connect Codex or Claude Code to the document through MCP.
Only the build step imports application modules. Neither the viewer nor MCP needs a running application or a database connection.
Declared metadata, not a database audit
A declared document describes loaded Python definitions. It does not prove that migrations have run or that a deployed database matches those definitions. Model imports can execute application code; choose trusted modules with safe initialization.