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.1.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.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pandera_ui-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5cb6edece48b52299fba53553b9c36d6582c0b228dbdce35ae9689c0f3f960be
MD5 c9c8f436c92e305d66061839bfb7f50e
BLAKE2b-256 411954054bbf0e3bc82be47725e5fdd1b58a1d9d5e647de70dfd3533a1e35e60

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandera_ui-1.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pandera_ui-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00371816f497e4539460bb2f3b3eb53f1daf1d2700e33dc46bd4eff94b550898
MD5 c325de9e1ef102ebe5022790ef28df8c
BLAKE2b-256 5bd13d0695b4fc6715969278088a715c40aefffb1e801ba268a199104fce6212

See more details on using hashes here.

Provenance

The following attestation bundles were made for pandera_ui-1.0.1-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