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


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.)
Rich CLI Progress spinner and summary table when rich is installed
CI-friendly --json flag exports structured metadata for linting, diffing, or downstream tooling
Fast navigation Filter by type, sort by name/file/columns, full-text search
Team-ready Dark/light theme, EN/RU/FR/DE localization

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

# Pretty terminal output (spinner + summary table)
pip install pandera-ui[rich]
pandera-ui .

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

What you get

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

Browser UI: searchable sidebar, column table with dtypes and checks, AST/runtime badge, dark/light theme.


Installation

# Core
pip install pandera-ui

# With beautiful terminal output
pip install pandera-ui[rich]

With uv:

uv add pandera-ui
uv add pandera-ui[rich]   # optional rich UI

Requires Python 3.10+.

Docker

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

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.

AST fallback

When a file can't be imported (missing dependency, DB connection at module level, etc.), pandera-ui falls back to static AST analysis — no import side effects, no crashes. Schemas extracted this way get an AST badge in the UI.


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. See pandera_ui/models.py for the full structure.


CLI reference

Usage: pandera-ui [OPTIONS] [PROJECT_PATH]

  Scan PROJECT_PATH for Pandera schemas and serve a documentation UI.

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, do not start server
  --help              Show this message and exit.

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, CheckMetadata
  server.py             # FastAPI: GET /api/schemas, GET /
  cli.py                # Typer CLI entry point
  _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/darius-krsk/pandera-ui
cd pandera-ui
make setup            # uv sync
make setup-ui-tests   # install Playwright browser

make lint             # ruff check
make type             # mypy
make test             # unit tests
make test-cov         # unit tests + coverage report

make test-ui          # Playwright E2E tests (requires Playwright)
make run              # start UI against test fixtures

See CONTRIBUTING.md for raw commands and 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-0.2.0.tar.gz (373.2 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-0.2.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pandera_ui-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6fffdb05db88511d9c1026eea5f7f1b10951e7dc0250a8cf935c86921a198a33
MD5 c47db1d96082c67754b3c4cbc99cee3c
BLAKE2b-256 12ca56001f9d25a15450298a43082226dea79bab0ccee9d314a5b00f3e18e3cd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pandera_ui-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 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-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 305ce46dc9d610429a07fb7bce13d273ed36df08f4f12ed28c27df4be826d18b
MD5 395c5ae097e4ec69eabe6bbeebdf345a
BLAKE2b-256 88132cb860936326035d44ae406d4abb052b65e9a03c885c77f12c07d008c8c0

See more details on using hashes here.

Provenance

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