Skip to main content

Laranex Schema Viewer

Framework-independent schema documents, an interactive ERD, and read-only MCP tools for SQLAlchemy 2.x, SQLModel, Django, Tortoise ORM, and Peewee. Inspired by Laravel Schema Viewer.

Build once from model definitions, a live database's catalogs (read-only), or both reconciled with drift, then browse or query the saved JSON without starting your application. Every build writes a laranex-schema 2.0 document, the format the Laravel and Node.js schema viewers share. 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:

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

cd /absolute/path/to/application
laranex-schema-viewer init     # optional: save defaults in pyproject.toml
laranex-schema-viewer build    # finds your models package; writes schema-viewer.json
laranex-schema-viewer serve

Replace sqlmodel with your ORM's extra: sqlalchemy, django, tortoise, or peewee. In a Django project, build reads the settings module from manage.py.

With uv, add it to your application instead: uv add --dev 'laranex-schema-viewer[sqlmodel,mcp]', then prefix commands with uv run. The python3 bundled with macOS is 3.9 and is not supported; see installation.

Open http://127.0.0.1:8765 to search tables, inspect indexes and relationships, and navigate the graph. The viewer is the shared Laranex Schema Viewer UI, packaged prebuilt: it needs no Node.js or web framework and loads nothing from the internet.

Build only trusted modules: imports and mapper callbacks execute application code. A declared document describes model metadata, not deployed database state; review documents before sharing.

Security notice

  • The viewer is a development tool: never expose it in production. serve has no authentication and is for one developer on loopback only; reach it from elsewhere only through an authenticated HTTPS reverse proxy or tunnel.
  • Schema snapshots and every export of them (offline HTML, JSON, DBML, Mermaid, Markdown, SVG, PNG), and gate reports, reveal your schema. Never commit or publish them, even in a private repository.
  • If you serve the viewer or a document any other way, protect every delivery path server-side: page, assets, document, downloads and caches.
  • Run laranex-schema-viewer scan --tracked --untracked in a pre-commit hook and in CI, and fail on any non-zero exit.

See SECURITY.md and the shared viewer security policy.

Documentation

Install agent skills with npx skills add laranex/python-schema-viewer; see the skills guide.

Contributing

See CONTRIBUTING.md for synthetic fixtures, the allowlist and the pre-commit scan, and AGENTS.md for architecture, development commands, testing, and documentation maintenance. Validation and skill verification describe test coverage and limitations. Report vulnerabilities as described in SECURITY.md. Release notes are in the changelog.

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

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

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

License

MIT. See NOTICE for attribution.

Metadata

Release files for laranex-schema-viewer 0.6.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 laranex-schema-viewer 0.6.1
File Size Uploaded Provenance
laranex_schema_viewer-0.6.1.tar.gz 1.7 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for laranex-schema-viewer 0.6.1
File Interpreter ABI Platform
laranex_schema_viewer-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 3.4 MB

Release files / laranex_schema_viewer-0.6.1.tar.gz

Download URL laranex_schema_viewer-0.6.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
bd572649ecd0a69437960b96f727ee0d3f8a934f40ac4cb6dce60b8ea8cf54e6
BLAKE2b-256 checksum
How to use checksums
2acac330e26aee5c6dbae9fb3fbb155e9e755bb348932d935be60cc367c4712c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / laranex_schema_viewer-0.6.1-py3-none-any.whl

Download URL laranex_schema_viewer-0.6.1-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e7afe1c4d5308a1d010b3e5e185c1934d7d54f2402fd492df4036d9631c48553
BLAKE2b-256 checksum
How to use checksums
d029a50c22c6b36cebd21e137ad6f517719b0cc30bf6848605eedf06a006448c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for laranex-schema-viewer 0.6.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for laranex_schema_viewer-0.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

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.

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