Skip to main content

Swagger-like UI for Pandera dataframe schemas

Project description

pandera-ui

Swagger for your Pandera schemas.
One command — instant searchable documentation for every dataframe schema in your project.

PyPI Python CI Codecov License: MIT

Documentation · Live Demo · PyPI · Changelog


The problem

You have 30 Pandera schemas spread across a data project. New team members ask: "Which columns does OrdersSchema have? Is amount nullable? What checks run on user_id?"

The answer is buried in code. There's no docs page, no searchable index — just grep and hope.

The solution

pip install pandera-ui
pandera-ui /path/to/myproject

pandera-ui scans your project, discovers every DataFrameSchema and DataFrameModel, and opens a Swagger-like UI at http://localhost:8765.

pandera-ui screenshot


Features

Feature Description
Zero config Point at a directory, get a UI. No decorators, no config files.
🔍 Two-pass extraction Runtime import for accuracy + AST fallback when imports fail (missing deps, DB connections, etc.)
👁 Live reload --watch reloads schemas automatically when .py files change
📄 Export --export markdown / --export html — static docs for README or Sphinx
📊 Coverage --coverage shows what % of schemas and columns are documented
🔧 CI-friendly --json exports structured metadata; /api/coverage for quality gates
🎨 Rich CLI Progress spinner and summary table when rich is installed
🌍 Team-ready Dark/light theme, EN/RU/FR/DE localization, full-text search

Quick start

# Install
pip install pandera-ui

# Scan current directory and open the UI
pandera-ui .

# Scan a specific project on a custom port
pandera-ui /path/to/myproject --port 9000

Terminal output (with pandera-ui[rich]):

Found 4 schema(s).

 Schema    Type             File                   Columns
 orders    DataFrameSchema  dataframe_schemas.py   5
 products  DataFrameSchema  dataframe_schemas.py   4
 users     DataFrameModel   schema_models.py       4
 events    DataFrameModel   schema_models.py       5

UI ready at http://127.0.0.1:8765

Open http://localhost:8765 in the browser — searchable sidebar, column table with dtypes and checks, AST/runtime badge, dark/light theme.


Installation

pip install pandera-ui            # core
pip install pandera-ui[rich]      # + spinner and summary table
pip install pandera-ui[watch]     # + --watch live-reload
pip install pandera-ui[rich,watch]  # everything

With uv:

uv add pandera-ui
uv add pandera-ui[rich,watch]

Requires Python 3.10+.

Docker

docker run --rm \
  -v /path/to/myproject:/project:ro \
  -p 8765:8765 \
  ghcr.io/darius-krsk/pandera-ui:latest

All CLI options

# Export schema docs (no server started)
pandera-ui . --export markdown > schemas.md
pandera-ui . --export html    > schemas.html

# Check documentation coverage
pandera-ui . --coverage

# Live reload on .py changes
pip install pandera-ui[watch]
pandera-ui . --watch

# Export raw JSON for CI / tooling
pandera-ui . --json > schemas.json

Full CLI reference:

Usage: pandera-ui [OPTIONS] [PROJECT_PATH]

Arguments:
  [PROJECT_PATH]  Project root to scan  [default: .]

Options:
  -p, --port INTEGER           Port for the UI server  [default: 8765]
  --host TEXT                  Host to bind  [default: 127.0.0.1]
  --json                       Print JSON to stdout, no server
  --export [markdown|html]     Export docs to stdout, no server
  --coverage                   Print coverage stats and exit
  -w, --watch                  Auto-reload schemas on .py changes
  --help                       Show this message and exit.

What gets extracted

Schema style Example Support
pa.DataFrameSchema(...) orders = pa.DataFrameSchema(...) Full
pa.DataFrameModel subclass class Orders(pa.DataFrameModel) Full
File with import errors imports a missing library AST fallback

Per column: name, dtype, nullable, required, checks (with parameters), title, description.

Per schema: name, coerce, title, description, index, source file, variable/class name.


Python API

from pandera_ui import scan_project

schemas = scan_project("./myproject")
for schema in schemas:
    print(schema.name, [c.name for c in schema.columns])

scan_project returns a list of SchemaMetadata Pydantic models — serialize with .model_dump().

# Compute coverage programmatically
from pandera_ui._coverage import compute_coverage, format_coverage
report = compute_coverage(schemas)
print(format_coverage(report))

# Export to Markdown
from pandera_ui._export import to_markdown
print(to_markdown(schemas))

Architecture

pandera_ui/
  scanner.py            # discovery: walks project, dispatches per file
  _extract_runtime.py   # pass 1: dynamic import + introspection
  _extract_ast.py       # pass 2: static AST parse (fallback)
  models.py             # Pydantic models: SchemaMetadata, ColumnMetadata …
  server.py             # FastAPI: GET /api/schemas, GET /api/coverage, GET /
  cli.py                # Typer CLI entry point
  _export.py            # Markdown and HTML renderers
  _coverage.py          # Documentation coverage calculator
  _console.py           # optional rich output (spinner, summary table)
frontend/
  index.html            # single-page UI (vanilla JS, no build step)

Development

git clone https://github.com/Darius1223/pandera-ui
cd pandera-ui
uv sync

make lint        # ruff check
make type        # mypy
make test        # unit tests
make test-cov    # unit tests + coverage report
make run         # start UI against test fixtures

See CONTRIBUTING.md for PR guidelines.


Changelog

See CHANGELOG.md.

License

MIT © 2025 Ildar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandera_ui-1.0.0.tar.gz (399.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandera_ui-1.0.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file pandera_ui-1.0.0.tar.gz.

File metadata

  • Download URL: pandera_ui-1.0.0.tar.gz
  • Upload date:
  • Size: 399.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pandera_ui-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4f53f5f1bede384957783e979c6d4fc554393a2bfdb0f7f81fc231ed6028555a
MD5 8764cd5059943de5f66fbddff53b8848
BLAKE2b-256 204af5965afa0a81d42aef484036a49fb73c0280236c0c7efaf95242df0af524

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandera_ui-1.0.0.tar.gz:

Publisher: publish.yml on Darius1223/pandera-ui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pandera_ui-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pandera_ui-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pandera_ui-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8dbf6ee44aef90a5f4aa75f7af2912cbcc66bca488b96d898505c856b5b2b11
MD5 d9216337d7344aecdad9df3627c5d834
BLAKE2b-256 b0296441b351c93257c6113de9a8ca542ec6d7c2cd7acfa140b7ea04c6f4c156

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandera_ui-1.0.0-py3-none-any.whl:

Publisher: publish.yml on Darius1223/pandera-ui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page