Catalog PyPI
PACKAGE EXPLORERView in registry

affineui

PyPI

Python bindings for AffineUI — GPU-accelerated HTML/CSS UI for tools and game engines. EXPERIMENTAL preview; APIs will change.

Versions collected1
Direct dependencies0From release 0.4.2
Last observed20 Oct, 21:04 UTC

README

Version 0.4.2 documentation

AffineUI for Python

AffineUI running the Dender 3D-print slicer — the default Decius CSS look AffineUI rendering a Bootstrap dashboard

A small, HTML5-compliant, GPU-accelerated UI renderer with an integrated component framework — a native replacement for Electron and Qt, for Python.

Think Gradio, but native: describe your UI as a tree of typed components, get a real HTML/CSS renderer with a browser-quality cascade, animations, hit-testing, and 120 Hz paint — all in one binary, no browser embedded, no JavaScript runtime, no Electron. Bootstrap and Tailwind-style stylesheets render out of the box; the bundled default is Decius CSS.

Status: alpha. Broad standards coverage, real UIs run today, but expect bugs and expect APIs to move.

Note: this release carries no -alpha suffix in its version number, but AffineUI is alpha and pre-1.0. Features, APIs, and the set of supported platforms are all still in flux.

Verified on: Linux (Ubuntu, x86-64), macOS (Apple Silicon), and Windows (x86-64) — the full suite (600+ tests) passes on each. Other platforms and architectures are not yet supported.


Install

pip install affineui

Prebuilt wheels ship for CPython 3.9 – 3.13 on Linux (manylinux_2_28 x86_64), macOS (universal2 — Intel + Apple Silicon), and Windows AMD64.

For a source install from a clone of the main repo:

pip install ./bindings/python           # regular install
pip install -e ./bindings/python        # editable / dev

Hello, world

import affineui as ui

view = ui.View(ui.ViewTheme.Decius)
view.begin()
view.heading(1, "Hello from Python")
view.paragraph("AffineUI — native HTML/CSS, no browser, no JS.")
view.button("Click me", primary=True, key="go").on_click(lambda: print("clicked!"))
view.end()

app = ui.App(title="Hello", width=720, height=480)
app.load_view(view)
raise SystemExit(app.run())

Raw HTML

import affineui as ui

app = ui.App(title="Hello", width=720, height=480)
app.load_html("""
  <main style="padding: 24px; font-family: sans-serif;">
    <h1>Hello from Python</h1>
    <p>AffineUI is alive.</p>
    <button>Click me</button>
  </main>
""")
raise SystemExit(app.run())

Headless (no window — for CI and tests)

import affineui as ui

doc = ui.document(
    "<main><h1>Hello</h1><p>Layout without a window.</p></main>",
    "main { padding: 16px; } h1 { font-size: 32px; }",
    width=640, height=360,
)
print(ui.version(), doc.content_size())

A modest app

A live-updating counter — state lives in Python; the reconciler diffs your view and patches the DOM in place. CSS hover/focus/animation keeps running between updates.

import affineui as ui

count = 0
app = ui.App(title="Counter", width=480, height=240)

def build_view() -> ui.View:
    view = ui.View(ui.ViewTheme.Decius)
    view.begin()
    view.heading(1, f"Count: {count}")
    view.button("Increment", primary=True, key="inc").on_click(bump)
    view.button("Reset",                    key="reset").on_click(reset)
    view.end()
    return view

def bump():
    global count
    count += 1
    app.load_view(build_view())

def reset():
    global count
    count = 0
    app.load_view(build_view())

app.load_view(build_view())
raise SystemExit(app.run())

The main repo's bindings/python/examples/ ships larger runnable programs — a component gallery, a photo editor, and a full Bootstrap-styled panel demo.


Loading design-system CSS

Decius CSS is the default when you use the component API. To render your own HTML with a framework stylesheet, tell the app where its asset folder is:

app = ui.App(
    title="Bootstrap demo",
    width=1280,
    height=720,
    asset_folders=["examples"],          # so href="frameworks/..." resolves
)
app.load_html("""
  <link rel="stylesheet" href="frameworks/css/bootstrap-5.3.8.min.css">
  <div class="container py-4">
    <button class="btn btn-primary">Native Bootstrap</button>
  </div>
""")
raise SystemExit(app.run())

Bootstrap 4.6 / 5.3, Tailwind-style utility classes, and Ant-style component markup all render — this is a real CSS engine, not an HTML-shaped layout solver.


What AffineUI is not

  • Not a browser. No navigation, no fetch, no cookies.
  • Not a nerfed HTML5. Missing non-esoteric features are bugs.
  • Not a security sandbox. Never feed it untrusted HTML/CSS/JS.
  • Not an everything-included framework. No video decode, no audio, no 3D — those are your app's job.
  • Not (yet) a JS runtime. JS + React support is on the roadmap as an opt-in extension.

See the main README for the full picture, embedding notes, C++ / Rust / C# APIs, and the demo gallery.


Downloads & popularity

1downloads
1-day window · source-reported counts20 Oct 2026
80400
2026-07-23: 70 · observed 2026-10-21T10:05:46.8985824Z · period 2026-07-23–2026-07-232026-07-24: 25 · observed 2026-10-21T10:05:46.8985824Z · period 2026-07-24–2026-07-242026-07-25: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-07-25–2026-07-252026-07-26: 18 · observed 2026-10-21T10:05:46.8985824Z · period 2026-07-26–2026-07-262026-07-27: 10 · observed 2026-10-21T10:05:46.8985824Z · period 2026-07-27–2026-07-272026-07-28: 38 · observed 2026-10-21T10:05:46.8985824Z · period 2026-07-28–2026-07-282026-07-29: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-07-29–2026-07-292026-07-30: 80 · observed 2026-10-21T10:05:46.8985824Z · period 2026-07-30–2026-07-302026-08-01: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-01–2026-08-012026-08-02: 2 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-02–2026-08-022026-08-03: 51 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-03–2026-08-032026-08-06: 7 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-06–2026-08-062026-08-07: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-07–2026-08-072026-08-08: 18 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-08–2026-08-082026-08-09: 3 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-09–2026-08-092026-08-10: 3 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-10–2026-08-102026-08-14: 4 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-14–2026-08-142026-08-15: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-15–2026-08-152026-08-17: 16 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-17–2026-08-172026-08-20: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-20–2026-08-202026-08-21: 12 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-21–2026-08-212026-08-22: 6 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-22–2026-08-222026-08-23: 50 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-23–2026-08-232026-08-24: 11 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-24–2026-08-242026-08-26: 2 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-26–2026-08-262026-08-27: 49 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-27–2026-08-272026-08-28: 2 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-28–2026-08-282026-08-31: 2 · observed 2026-10-21T10:05:46.8985824Z · period 2026-08-31–2026-08-312026-09-06: 55 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-06–2026-09-062026-09-07: 8 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-07–2026-09-072026-09-08: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-08–2026-09-082026-09-09: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-10–2026-09-102026-09-12: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-12–2026-09-122026-09-13: 49 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-13–2026-09-132026-09-14: 11 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-14–2026-09-142026-09-16: 48 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-16–2026-09-162026-09-18: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-18–2026-09-182026-09-20: 49 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-20–2026-09-202026-09-21: 14 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-21–2026-09-212026-09-22: 20 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-22–2026-09-222026-09-23: 5 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-23–2026-09-232026-09-24: 48 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-24–2026-09-242026-09-25: 7 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-25–2026-09-252026-09-26: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-26–2026-09-262026-09-27: 3 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-27–2026-09-272026-09-28: 2 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-28–2026-09-282026-09-30: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-09-30–2026-09-302026-10-02: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-02–2026-10-022026-10-04: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-04–2026-10-042026-10-05: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-05–2026-10-052026-10-06: 17 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-06–2026-10-062026-10-07: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-07–2026-10-072026-10-08: 3 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-08–2026-10-082026-10-09: 2 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-09–2026-10-092026-10-10: 49 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-10–2026-10-102026-10-11: 19 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-11–2026-10-112026-10-13: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-13–2026-10-132026-10-14: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-14–2026-10-142026-10-16: 2 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-16–2026-10-162026-10-18: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-18–2026-10-182026-10-19: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-19–2026-10-192026-10-20: 1 · observed 2026-10-21T10:05:46.8985824Z · period 2026-10-20–2026-10-20
23 Jul20 Oct

pypistats · 63 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-2012026-10-21T10:05:46.8985824Z
2026-10-19 – 2026-10-1912026-10-21T10:05:46.8985824Z
2026-10-18 – 2026-10-1812026-10-21T10:05:46.8985824Z
2026-10-16 – 2026-10-1622026-10-21T10:05:46.8985824Z
2026-10-14 – 2026-10-1412026-10-21T10:05:46.8985824Z
2026-10-13 – 2026-10-1312026-10-21T10:05:46.8985824Z
2026-10-11 – 2026-10-11192026-10-21T10:05:46.8985824Z
2026-10-10 – 2026-10-10492026-10-21T10:05:46.8985824Z
2026-10-09 – 2026-10-0922026-10-21T10:05:46.8985824Z
2026-10-08 – 2026-10-0832026-10-21T10:05:46.8985824Z
2026-10-07 – 2026-10-0712026-10-21T10:05:46.8985824Z
2026-10-06 – 2026-10-06172026-10-21T10:05:46.8985824Z
2026-10-05 – 2026-10-0512026-10-21T10:05:46.8985824Z
2026-10-04 – 2026-10-0412026-10-21T10:05:46.8985824Z
2026-10-02 – 2026-10-0212026-10-21T10:05:46.8985824Z
2026-09-30 – 2026-09-3012026-10-21T10:05:46.8985824Z
2026-09-28 – 2026-09-2822026-10-21T10:05:46.8985824Z
2026-09-27 – 2026-09-2732026-10-21T10:05:46.8985824Z
2026-09-26 – 2026-09-2612026-10-21T10:05:46.8985824Z
2026-09-25 – 2026-09-2572026-10-21T10:05:46.8985824Z
2026-09-24 – 2026-09-24482026-10-21T10:05:46.8985824Z
2026-09-23 – 2026-09-2352026-10-21T10:05:46.8985824Z
2026-09-22 – 2026-09-22202026-10-21T10:05:46.8985824Z
2026-09-21 – 2026-09-21142026-10-21T10:05:46.8985824Z
2026-09-20 – 2026-09-20492026-10-21T10:05:46.8985824Z
2026-09-18 – 2026-09-1812026-10-21T10:05:46.8985824Z
2026-09-16 – 2026-09-16482026-10-21T10:05:46.8985824Z
2026-09-14 – 2026-09-14112026-10-21T10:05:46.8985824Z
2026-09-13 – 2026-09-13492026-10-21T10:05:46.8985824Z
2026-09-12 – 2026-09-1212026-10-21T10:05:46.8985824Z
2026-09-10 – 2026-09-1012026-10-21T10:05:46.8985824Z
2026-09-09 – 2026-09-0912026-10-21T10:05:46.8985824Z
2026-09-08 – 2026-09-0812026-10-21T10:05:46.8985824Z
2026-09-07 – 2026-09-0782026-10-21T10:05:46.8985824Z
2026-09-06 – 2026-09-06552026-10-21T10:05:46.8985824Z
2026-08-31 – 2026-08-3122026-10-21T10:05:46.8985824Z
2026-08-28 – 2026-08-2822026-10-21T10:05:46.8985824Z
2026-08-27 – 2026-08-27492026-10-21T10:05:46.8985824Z
2026-08-26 – 2026-08-2622026-10-21T10:05:46.8985824Z
2026-08-24 – 2026-08-24112026-10-21T10:05:46.8985824Z
2026-08-23 – 2026-08-23502026-10-21T10:05:46.8985824Z
2026-08-22 – 2026-08-2262026-10-21T10:05:46.8985824Z
2026-08-21 – 2026-08-21122026-10-21T10:05:46.8985824Z
2026-08-20 – 2026-08-2012026-10-21T10:05:46.8985824Z
2026-08-17 – 2026-08-17162026-10-21T10:05:46.8985824Z
2026-08-15 – 2026-08-1512026-10-21T10:05:46.8985824Z
2026-08-14 – 2026-08-1442026-10-21T10:05:46.8985824Z
2026-08-10 – 2026-08-1032026-10-21T10:05:46.8985824Z
2026-08-09 – 2026-08-0932026-10-21T10:05:46.8985824Z
2026-08-08 – 2026-08-08182026-10-21T10:05:46.8985824Z
2026-08-07 – 2026-08-0712026-10-21T10:05:46.8985824Z
2026-08-06 – 2026-08-0672026-10-21T10:05:46.8985824Z
2026-08-03 – 2026-08-03512026-10-21T10:05:46.8985824Z
2026-08-02 – 2026-08-0222026-10-21T10:05:46.8985824Z
2026-08-01 – 2026-08-0112026-10-21T10:05:46.8985824Z
2026-07-30 – 2026-07-30802026-10-21T10:05:46.8985824Z
2026-07-29 – 2026-07-2912026-10-21T10:05:46.8985824Z
2026-07-28 – 2026-07-28382026-10-21T10:05:46.8985824Z
2026-07-27 – 2026-07-27102026-10-21T10:05:46.8985824Z
2026-07-26 – 2026-07-26182026-10-21T10:05:46.8985824Z
2026-07-25 – 2026-07-2512026-10-21T10:05:46.8985824Z
2026-07-24 – 2026-07-24252026-10-21T10:05:46.8985824Z
2026-07-23 – 2026-07-23702026-10-21T10:05:46.8985824Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.4.213 Jul 20260

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
affineui/affineui

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:04 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:27fd6b415d96711044cba85ec1d3bef51196c7829e1484a9fe1d7432356a46bf