Metadata-Version: 2.4
Name: zolt
Version: 1.2.0
Summary: Write Python, render anywhere — web, desktop, and CLI from one codebase.
Project-URL: Homepage, https://github.com/12errh/zolt
Project-URL: Documentation, https://zolt.dev
Project-URL: Repository, https://github.com/12errh/zolt
Project-URL: Issues, https://github.com/12errh/zolt/issues
Author: Zolt Core Team
License: MIT
License-File: LICENSE
Keywords: cli,desktop,framework,fullstack,reactive,ui,web
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: User Interfaces
Requires-Python: >=3.10
Requires-Dist: aiohttp>=3.9
Requires-Dist: click>=8.1
Requires-Dist: jinja2>=3.1
Requires-Dist: rich>=13.0
Requires-Dist: structlog>=24.0
Requires-Dist: typing-extensions>=4.9
Requires-Dist: watchdog>=3.0
Provides-Extra: dev
Requires-Dist: hatch>=1.9; extra == 'dev'
Requires-Dist: mypy>=1.9; extra == 'dev'
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: e2e
Requires-Dist: playwright; extra == 'e2e'
Requires-Dist: pytest-playwright; extra == 'e2e'
Provides-Extra: images
Requires-Dist: pillow; extra == 'images'
Provides-Extra: qt
Requires-Dist: pyqt6; extra == 'qt'
Description-Content-Type: text/markdown

# Zolt

> **Write Python. Render anywhere.**  
> Web · Desktop · Terminal — from a single Python codebase.

[![PyPI](https://img.shields.io/pypi/v/zolt)](https://pypi.org/project/zolt)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://python.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Tests](https://github.com/12errh/zolt/actions/workflows/test.yml/badge.svg)](https://github.com/12errh/zolt/actions)

Zolt is a production-ready Python UI framework. Write your entire UI in pure Python — no HTML, no CSS, no JavaScript. One codebase compiles to a web app, a native desktop window, and a terminal UI.

---

## Install

```bash
pip install zolt
```

Requires Python 3.10+.

---

## Quick start

```bash
zolt new my-app
cd my-app
zolt run          # → http://localhost:8000
```

Or scaffold a dashboard:

```bash
zolt new my-dash --template dashboard
cd my-dash
zolt run
```

Or browse all templates interactively:

```bash
zolt templates
```

Available templates: `blank`, `dashboard`, `landing`, `admin`, `auth`, `agency`

The **agency** template is a dark premium AI agency landing page with glassmorphism effects, HLS video backgrounds, and animated headings — ready to run with `zolt run`.

---

## Hello World

```python
from pyui import App, Button, Flex, Heading, Page, Text, reactive

class HomePage(Page):
    title = "Home"
    route = "/"

    def compose(self):
        with Flex(direction="col", align="center", gap=6):
            Heading("Hello from Zolt", level=1)
            Text("Built with pure Python.").style("muted")
            Button("Get Started").style("primary").size("lg")

class MyApp(App):
    name = "My App"
    home = HomePage()
```

Run it:

```bash
zolt run app.py                    # web browser
zolt run app.py --target desktop   # native window
zolt run app.py --target cli       # terminal
```

---

## Reactive state

```python
from pyui import App, Button, Flex, Page, Text, reactive

_count = reactive(0)

class CounterPage(Page):
    title = "Counter"
    route = "/"

    def compose(self):
        with Flex(direction="col", align="center", gap=4):
            Text(lambda: f"Count: {_count.get()}").style("lead")
            with Flex(gap=3):
                Button("−").style("ghost").onClick(lambda: _count.set(_count.get() - 1))
                Button("+").style("primary").onClick(lambda: _count.set(_count.get() + 1))

class CounterApp(App):
    count = _count
    home = CounterPage()
```

---

## 47+ built-in components

| Category | Components |
|---|---|
| Layout | `Flex`, `Grid`, `Stack`, `Container`, `Section`, `Sidebar`, `Split`, `Divider`, `Spacer`, `List` |
| Display | `Text`, `Heading`, `BlurHeading`, `Badge`, `Tag`, `Avatar`, `Icon`, `Image`, `Link`, `Markdown`, `Video` |
| Input | `Button`, `Input`, `Textarea`, `Select`, `Checkbox`, `Radio`, `Toggle`, `Slider`, `DatePicker`, `FilePicker`, `Form` |
| Feedback | `Alert`, `Toast`, `Modal`, `Drawer`, `Tooltip`, `Progress`, `Spinner`, `Skeleton` |
| Navigation | `Nav`, `FloatingNav`, `Tabs`, `Breadcrumb`, `Pagination`, `Menu` |
| Media | `Video`, `VideoBg` |
| Feedback | `Alert`, `Toast`, `Modal`, `Drawer`, `Tooltip`, `Progress`, `Spinner`, `Skeleton` |
| Navigation | `Nav`, `Tabs`, `Breadcrumb`, `Pagination`, `Menu` |
| Data | `Table`, `Stat`, `Chart` |

---

## 6 built-in themes

```python
class MyApp(App):
    theme = "dark"   # light · dark · ocean · sunset · forest · rose
```

Custom theme:

```python
class MyApp(App):
    theme = {"color.primary": "#FF6B6B", "color.background": "#FFF5F5"}
```

---

## CLI reference

| Command | Description |
|---|---|
| `zolt new <name>` | Scaffold a new project (`--template blank\|dashboard\|landing\|admin\|auth\|agency`) |
| `zolt templates` | Browse all templates interactively and scaffold one |
| `zolt run [app.py]` | Start dev server with hot reload (`--target web\|desktop\|cli`) |
| `zolt build [app.py]` | Production build (`--target web\|desktop\|cli\|all`) |
| `zolt storybook` | Open component gallery |
| `zolt doctor` | Check environment health |
| `zolt lint [app.py]` | Lint component definitions |
| `zolt search <query>` | Search PyPI for `zolt-*` packages |
| `zolt publish` | Publish a component package to PyPI |
| `zolt info` | Show version info |

---

## Plugin system

```python
from pyui.plugins import PyUIPlugin, register_component

class ChartsPlugin(PyUIPlugin):
    name = "zolt-charts"
    version = "1.0.0"

    def on_load(self, app):
        register_component("LineChart", LineChartComponent)

class MyApp(App):
    plugins = [ChartsPlugin()]
```

---

## Example apps

Five full example apps are in [`examples/`](examples/):

| App | Description |
|---|---|
| [`dashboard/`](examples/dashboard/app.py) | Analytics dashboard with stats, chart, table |
| [`todo/`](examples/todo/app.py) | Reactive todo list |
| [`blog/`](examples/blog/app.py) | Content site with routing |
| [`ml-demo/`](examples/ml-demo/app.py) | ML inference UI |
| [`admin/`](examples/admin/app.py) | CRUD admin panel |

Run any example:

```bash
zolt run examples/dashboard/app.py
```

---

## What's included

- ✅ Web renderer (HTML + Tailwind CSS + Alpine.js)
- ✅ Desktop renderer (tkinter, optional sv-ttk)
- ✅ CLI renderer (Rich TUI)
- ✅ Reactive state (`reactive`, `computed`, `store`)
- ✅ Theme engine (6 built-in themes + custom tokens + Figma export)
- ✅ Plugin system with lifecycle hooks
- ✅ Hot reload (file save → browser update)
- ✅ Dev tools panel (state inspector, event log)
- ✅ Error overlay with structured error codes (`PYUI-NNN`)
- ✅ `zolt lint` — component tree validation
- ✅ `zolt doctor` — environment health check
- ✅ `zolt publish` — marketplace publishing via PyPI

---

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md). Issues labelled [`good-first-issue`](https://github.com/12errh/zolt/issues?q=label%3Agood-first-issue) are a great place to start.

## License

MIT — see [LICENSE](LICENSE).
