A full-stack Python framework for data and AI applications.
pip install pydataui==1.4.0 Copy PIP instructions
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
In modern web development, developers are forced to choose between two painful trade-offs:
PyDataUI eliminates this trade-off completely:
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:
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:
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:
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:
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:
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:
pyrustapi browser postgres data tunnel docs dev all
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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.
None of the files in this release were uploaded with provenance metadata.
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.




