Metadata-Version: 2.4
Name: stencil-ui
Version: 2.0.0
Summary: CLI tool to generate UI code for HTML, ImGui, or Curses from a simple config file
Author: Krishanth K
License: MIT License
        
        Copyright (c) 2025 Krishanth K
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML>=6.0.3
Requires-Dist: watchdog>=3.0.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: rich>=13.0.0
Provides-Extra: imgui
Requires-Dist: glfw; extra == "imgui"
Requires-Dist: PyOpenGL; extra == "imgui"
Requires-Dist: imgui[glfw]; extra == "imgui"
Dynamic: license-file

# 📘 Stencil

[![PyPI version](https://badge.fury.io/py/stencil-ui.svg)](https://pypi.org/project/stencil-ui/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Python Versions](https://img.shields.io/pypi/pyversions/stencil-ui.svg)](https://pypi.org/project/stencil-ui/)

**Quick throwaway UIs for developers testing logic or wrapping scripts.**

Write YAML → get a working UI in seconds. Terminal, desktop, or browser. No frontend knowledge required.

---

## Why Stencil?

You need a UI to test backend logic or wrap a script — not a production app, just something functional. Skip the boilerplate. Describe your UI once, generate it instantly.

**Backends:**
- **HTML** — browser-based, shareable
- **curses** — terminal UI, SSH-friendly
- **imgui** — desktop GUI, immediate mode

---

## Installation

```bash
pip install stencil-ui  # Python 3.12+
```

---

## Usage

```bash
stencil init              # create stencil.yaml
stencil                   # generate HTML (default)
stencil -b curses         # terminal UI
stencil -b imgui          # desktop GUI
stencil --watch           # auto-regenerate on changes
```

---

## Example Config

```yaml
config:
  backend: "html"

app:
  - title: "Task Manager"
  - input:
      label: "Task"
      placeholder: "Buy groceries..."
  - button:
      label: "Add"
      callback: "addTask"
  - separator
  - text: "© 2025"
```

**Components:** `title`, `text`, `input`, `button`, `separator`

---

## Extending

Add backends by dropping a folder in `stencil/backends/<name>/`:

```
mybackend/
  backend.yaml      # metadata
  _layout.j2        # wrapper template
  Button.j2         # component templates
  Input.j2
  Text.j2
```

No Python changes needed. Engine auto-discovers backends. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

---

## License

MIT — use it however you want.

**Contributing?** Open an issue or PR. Easiest contribution: add a new backend for your favorite framework.
