Skip to main content

CLI tool to generate UI code for HTML, ImGui, or Curses from a simple config file

Project description

📘 Stencil

PyPI version License: MIT Python Versions

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

pip install stencil-ui  # Python 3.12+

Usage

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

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 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.

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

stencil_ui-2.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stencil_ui-2.0.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file stencil_ui-2.0.0.tar.gz.

File metadata

  • Download URL: stencil_ui-2.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for stencil_ui-2.0.0.tar.gz
Algorithm Hash digest
SHA256 20457d6746e818fb153198d9989a809e2e6987bc0b6a7e618381b9a7d9f766cd
MD5 3f8d9edf6b06193d7e8cc999cf355a23
BLAKE2b-256 8d5b05bacfae3063f136366fc9944cfa1bc9ccf3d6dc75c3a0edd8bed06f65c7

See more details on using hashes here.

File details

Details for the file stencil_ui-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: stencil_ui-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for stencil_ui-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8a2f90e97d38639a6c1aa9fff41f198a1fb62edee9ea32a10c8b9ac94ed26e3
MD5 ddb8e18b824c2d98dee0816006021625
BLAKE2b-256 8700a0f5816f4d3a2cf513650610d9a9d1f38cb90fdcd50cbb52968197fcadbc

See more details on using hashes here.

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