Skip to main content

⚡ PyDataUI

PyDataUI Hero Banner

PyPI version PyPI Downloads Python Version Tests License Docs

The Full-Stack Python Framework: Streamlit Simplicity on the Surface, Next.js Performance Underneath.
Data Scientists • AI Engineers • Backend Developers • Full-Stack Pythonistas

🌐 Documentation Website • 10s Quickstart • Next.js Full-Stack SaaS • 20 Visual Themes • FastAPI Mounting


💡 Why PyDataUI?

In modern web development, developers are forced to choose between two painful trade-offs:

  1. Streamlit: Great 10-second prototyping DX, but re-executes lines 1–100 on every user click, leading to laggy UIs, session bugs, and zero built-in REST API capabilities.
  2. Next.js + FastAPI: Exceptional performance, but requires maintaining two languages (TypeScript + Python), 450 MB of node_modules, separate deployments, and constant API schema glue code.

PyDataUI eliminates this trade-off completely:

Architecture Comparison

  • 10-Second Procedural Simplicity: Write pdu.write(df), with pdu.sidebar():, and pdu.columns([1, 2]) just like Streamlit.
  • Zero Full-Script Re-runs: Powered by server-side HTMX DOM morphing — only the affected UI fragment updates.
  • 0ms In-Memory Model Access: Your UI and your AI models (PyTorch, LangChain, Ollama, Pandas) share the exact same process memory.
  • Native FastAPI Engine: Every state action can automatically expose an OpenAPI 3.1 REST route with interactive Swagger UI at /docs.
  • 20 Curated Themes + Custom Palettes: Gorgeous out-of-the-box Shadcn/Tailwind design with seamless dark mode.
  • One-Command Public Tunnel: Run with share=True and get a secure public HTTPS demo link in 3.5 seconds.

🎨 Visual Theme Showcase: One-Line Enterprise Aesthetics

Forget the rigid or dated look of traditional prototyping tools. PyDataUI gives you production-grade Shadcn & Tailwind aesthetics on day one. Switch between themes in 1 line of Python:

Theme Gallery Showcase

Theme Preset Ideal For Activate with 1 Line
Violet (theme="violet") AI Agent Copilots, LLM Workbenches, Chatbots pdu.set_page_config(theme="violet")
Emerald (theme="emerald") FinTech, Executive SaaS, Billing & MRR KPIs pdu.set_page_config(theme="emerald")
Zinc Dark (theme="zinc") DevOps, Kubernetes Telemetry, Dark Mode Analytics pdu.set_page_config(theme="zinc", dark_mode=True)
Amber (theme="amber") Logistics, E-Commerce Operations, Warehouse Fleet pdu.set_page_config(theme="amber")

📦 Installation

pip install pydataui

🚀 Track 1: Streamlit-Style Rapid Prototyping

Build complete data dashboards and AI interfaces with top-to-bottom procedural Python. No component trees, no classes, no decorators required:

import pydataui as pdu
import pandas as pd

# 1. Page Configuration & Theme
pdu.set_page_config(title="AI & Sales Intelligence", layout="wide", theme="zinc", dark_mode=True)

# 2. Modern Sidebar Controls
with pdu.sidebar():
    pdu.title("Controls")
    pdu.theme_toggle()
    model = pdu.selectbox("Select Model", ["Llama-3.3", "DeepSeek-R1", "GPT-4o"])
    temp = pdu.slider("Temperature", 0.0, 1.0, 0.7)
    dataset = pdu.file_uploader("Upload Evaluation CSV", accept=[".csv"])

# 3. Main Dashboard Header & Status
pdu.title("GPU Cluster Telemetry & Agent Dispatch")
pdu.success("All 16 H100 SXM5 nodes online. Telemetry streaming active.")

# 4. Multi-Column KPI Grid
col1, col2, col3 = pdu.columns([1, 1, 1])
with col1:
    pdu.metric("Active Sessions", "2,840", delta="+12.4%")
with col2:
    pdu.metric("P99 Inference Latency", "14.2ms", delta="-3.1ms")
with col3:
    pdu.metric("Token Throughput", "8.2k tokens/s", delta="+18.5%")

# 5. Interactive Tabs & Charts
tab_data, tab_chat = pdu.tabs(["Data Explorer", "Operations Copilot"])

with tab_data:
    df = pd.DataFrame({
        "Worker Node": [f"node-{i:02d}" for i in range(1, 5)],
        "GPU Utilization": ["88%", "92%", "78%", "95%"],
        "VRAM Allocated": ["72 GB", "76 GB", "64 GB", "78 GB"]
    })
    pdu.write(df)  # Polymorphic auto-renderer: renders interactive paginated table
    pdu.line_chart([65, 72, 80, 85, 92, 88, 91, 95])

with tab_chat:
    with pdu.chat_message("user"):
        pdu.write("Are there any thermal anomalies on worker nodes?")
    with pdu.chat_message("assistant"):
        pdu.write("All nodes operating within normal thermal limits. Peak VRAM was 78 GB on Node-04.")
    pdu.chat_input("Ask the operations assistant a question...")

if __name__ == "__main__":
    pdu.run(port=8000, share=True)  # Ready in 3.5s with instant public HTTPS link!

Run it directly:

python app.py
  • 🌐 Local Web UI: http://127.0.0.1:8000
  • 🔗 Instant Public Tunnel: https://a1d60ba6d715e7.app.lhr.life
  • 📖 Interactive Swagger UI: http://127.0.0.1:8000/docs

⚡ Track 2: Next.js-Style Full-Stack SaaS

When building complex, multi-page web applications, PyDataUI provides a Next.js App Router equivalent in pure Python:

from pydataui import App, Container, Card, Heading, Text, Button, Table, Row, state
from pydantic import BaseModel, Field

app = App(title="CloudAI Enterprise SaaS")

# 1. Server State & Server Actions (Next.js "use server" equivalent)
s = state(credits=1500, deployments=[{"id": "dep-01", "model": "Llama-3.3-70B", "status": "Running"}])

@s.action
def deploy_model(model_name: str = "Mistral-Large"):
    s.deployments.append({"id": f"dep-0{len(s.deployments) + 1}", "model": model_name, "status": "Running"})
    s.credits -= 100

# 2. Server-Rendered Component Page (app/page.tsx equivalent)
@app.page("/")
def dashboard_page():
    return Container(
        Row(
            Heading("Enterprise AI Dashboard", level=1),
            Button("+ Deploy Mistral", on_click=lambda: deploy_model("Mistral-Large"), variant="primary"),
            class_name="flex justify-between items-center mb-6"
        ),
        Card(
            Heading("Remaining Credits", level=4),
            Text(s.credits, class_name="text-2xl font-bold text-emerald-600"),
            Table(data=s.deployments),
            class_name="p-6 shadow-sm"
        ),
        class_name="max-w-5xl mx-auto p-8"
    )

# 3. Built-In FastAPI Route (Next.js route.ts / FastAPI API equivalent)
class PromptRequest(BaseModel):
    prompt: str = Field(..., min_length=1)

@app.api("/api/v1/generate", method="POST", tags=["AI Inference"])
async def generate_api(body: PromptRequest):
    return {"success": True, "output": f"Completion for: {body.prompt[:40]}..."}

if __name__ == "__main__":
    app.run(port=8000)

🔌 Native FastAPI Mounting

Already have an existing FastAPI backend or microservice? Unlike Streamlit (which runs on Tornado and cannot be mounted inside FastAPI), PyDataUI mounts with a single line:

from fastapi import FastAPI
from pydataui import App, Container, Heading

# 1. Existing Enterprise FastAPI Application
api = FastAPI(title="Core Microservice")

@api.get("/api/health")
def health():
    return {"status": "healthy"}

# 2. Build PyDataUI Dashboard
dashboard = App(title="Ops Portal")

@dashboard.page("/")
def ops_home():
    return Container(Heading("Operations Portal"))

# 3. Mount directly — 1 process, 1 port, 0ms in-memory access!
api.mount("/dashboard", dashboard._engine.app)

Run with standard Uvicorn:

uvicorn main:api --reload --port 8000
  • 📡 FastAPI API: http://127.0.0.1:8000/api/health
  • 📖 FastAPI Docs: http://127.0.0.1:8000/docs
  • 💻 PyDataUI Dashboard: http://127.0.0.1:8000/dashboard/

🎨 20 Modern Themes + Infinite Custom Palettes

PyDataUI ships with 20 official out-of-the-box color presets matching all standard Shadcn/Tailwind design systems:

20 Color Presets

Category Presets Available Hex Identifiers
Modern Neutrals zinc, slate, stone, neutral, gray #18181b • #0f172a • #1c1917 • #171717 • #111827
Greens & Cyans emerald, green, teal, cyan #059669 • #16a34a • #0d9488 • #0891b2
Blues & Purples blue, indigo, violet, purple #2563eb • #4f46e5 • #7c3aed • #9333ea
Pinks & Warm fuchsia, pink, rose, red, orange, amber, yellow #c026d3 • #db2777 • #e11d48 • #dc2626 • #ea580c • #d97706 • #ca8a04

🔮 1. AI Copilot & Agent Playground (theme="violet")

Built for LLM workbenches, multi-turn chat agents, and real-time inference telemetry. Features collapsible reasoning thought traces, token speed counters, and syntax-highlighted code output:

Violet AI Copilot Theme

import pydataui as pdu

# Activate Violet AI theme in 1 line
pdu.set_page_config(title="DeepAgent Copilot", theme="violet", dark_mode=True)

with pdu.sidebar():
    model = pdu.selectbox("Inference Model", ["DeepSeek-R1-Distill-70B", "Llama-3.3"])
    temp = pdu.slider("Temperature", 0.0, 1.0, 0.70)

with pdu.chat_message("user"):
    pdu.write("Analyze the P99 latency spike on cluster node-04 and remediate.")

with pdu.chat_message("assistant"):
    with pdu.expander("💡 Thought Process: 1,420 tokens analyzed (0.4s)"):
        pdu.write("Inspected Prometheus traces. Found cache compaction lock.")
    pdu.write("Remediation executed: Pods re-routed. Current P99: 12.1ms")

pdu.chat_input("Ask Copilot or type /command...")

💎 2. FinTech, Billing & Revenue Analytics (theme="emerald")

Engineered for SaaS metrics, ARR/MRR acceleration, transaction ledgers, and executive board reporting:

Emerald FinTech Theme

import pydataui as pdu

# Activate Emerald FinTech theme
pdu.set_page_config(title="ApexPay Financial", theme="emerald", layout="wide")

pdu.title("ApexPay Financial & Revenue Operations")
pdu.success("Stripe sync active • 99.99% payment gateway uptime")

col1, col2, col3, col4 = pdu.columns([1, 1, 1, 1])
with col1: pdu.metric("Annual Run Rate (ARR)", "$1,840,500", delta="+24.8%", icon="💳")
with col2: pdu.metric("Monthly Recurring (MRR)", "$154,200", delta="+18.2%", icon="📈")
with col3: pdu.metric("Paying Accounts", "2,840", delta="+142 mo", icon="👥")
with col4: pdu.metric("Net Retention Rate", "118.4%", delta="TOP 5%", icon="⚡")

pdu.subheader("ARR Growth Trajectory ($k)")
pdu.area_chart([92, 104, 118, 132, 145, 154])

⚡ 3. DevOps, Cluster Telemetry & Dark Mode Analytics (theme="zinc", dark_mode=True)

High-density, low-eye-strain telemetry for Kubernetes clusters, GPU farms, and real-time distributed systems:

Zinc Dark Mode Telemetry

import pydataui as pdu

# Activate Zinc Dark Mode theme
pdu.set_page_config(title="Cluster Telemetry", theme="zinc", dark_mode=True)

col1, col2, col3, col4 = pdu.columns([1, 1, 1, 1])
with col1: pdu.metric("P99 Latency", "12.8 ms", delta="-2.4ms")
with col2: pdu.metric("VRAM Allocated", "1,180 GB", delta="92.1%")
with col3: pdu.metric("Active Pods", "32 / 32", delta="100% OK")
with col4: pdu.metric("Token Throughput", "14.2k t/s", delta="+18%")

pdu.line_chart([140, 110, 125, 75, 60, 45])

Zero Theme Limitations: Custom Palettes & Brand Colors

You are never limited to presets. Define any custom brand palette via hex code or custom dictionary:

# 1. Built-in Preset
pdu.set_page_config(theme="violet")

# 2. Custom Brand Hex
pdu.set_page_config(theme="#4f46e5")

# 3. Unlimited Custom Dictionary Palette
pdu.set_page_config(theme={
    "primary": "#6366f1",
    "primary_hover": "#4f46e5",
    "bg": "#0f172a",
    "accent": "#a855f7"
})

📊 Side-by-Side Performance Comparison

Metric Next.js + FastAPI Streamlit PyDataUI (v1.3.1)
Languages Needed 2 (TypeScript + Python) 1 (Python) 1 (Pure Python)
Execution on Click Partial re-render ❌ Reruns lines 1-100 Surgical HTMX fragment swap
Node Modules Size 450 MB+ (300+ pkgs) 0 MB 0 MB (Zero npm)
UI-to-Model Latency 15ms - 45ms (HTTP hop) In-memory 0.02ms (In-Memory direct pointer)
FastAPI Mountable ❌ Separate service ❌ Incompatible (Tornado) Native 1-line mount
Auto REST API Docs Manual FastAPI config ❌ None Auto OpenAPI 3.1 Swagger UI
Public Demos Requires Vercel/Cloud ❌ Cloud account required share=True (3.5s instant tunnel)
Automated Tests Polyglot setup Basic 194 / 194 Passed (100% Green)

📦 Optional Extensions (Mobile, Desktop, TUI)

PyDataUI keeps its web core ultra-lean. Specialized native deployment targets are available as optional extensions:

  • 📱 Mobile Apps (Capacitor / iOS / Android): Package as native mobile apps with camera, GPS, and offline PWA support (Documentation).
  • 💻 Desktop Apps (Tauri / pywebview): Package into a standalone ~15 MB desktop .app or .exe with zero Electron bloat.
  • 📟 Terminal UI (TUI): Run headless telemetry monitors on remote SSH GPU clusters via pydataui tui app.py.

🤝 Community & Support

Licensed under the MIT License.

Metadata

Release files for pydataui 1.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydataui 1.3.7
File Size Uploaded Provenance Actions
pydataui-1.3.7.tar.gz 281.4 kB Without provenance Details for pydataui-1.3.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydataui 1.3.7
File Interpreter ABI Platform Actions
pydataui-1.3.7-py3-none-any.whl Python 3 none any Details for pydataui-1.3.7-py3-none-any.whl

Total release size: 520.0 kB

Release files / pydataui-1.3.7.tar.gz

Download URL pydataui-1.3.7.tar.gz
Size 281.4 kB
Tags Source
SHA-256 checksum
How to use checksums
785c08675302a680949e641783f594a00f65d51a2e404643983ce0f55df91ef6
BLAKE2b-256 checksum
How to use checksums
a6038931f5d15395819d5c4d0e4bcba0deee18146ccfb72d0c5ee7c4972a0bc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / pydataui-1.3.7-py3-none-any.whl

Download URL pydataui-1.3.7-py3-none-any.whl
Size 238.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
403e3b78904205ac3249b412cc1db83dfe1e1ee89253e07995179b25706784a7
BLAKE2b-256 checksum
How to use checksums
91dfa624d4ed31e400d6554392b8891e169d195f79aa8183905f74cb781f7e84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for pydataui 1.3.7

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.7 This release

2 release files No provenance

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