Skip to content

Tesserae

Write desktop apps in Python and TDL. A Tesserae app is TDL views (what the screen looks like), each paired with a Python ViewModel (what it does), drawn by the Tesserae Render Engine (tess_re): rendering, layout, animation and accessibility in Rust underneath, which you never have to touch.

---
TDL: 0.2
Name: Counter
Tesserae: "0.6"
---
# Counter_View.tdl
Container {
  Name: Counter
  Style { Flex_Direction: vertical, Gap: 12, Padding: 24, Background: surface }
  Children {
    Text {
      Name: label
      Text: Count: <| count |>
      Typography_Role: headline_medium
      Style { Foreground: on_surface }
    }
    Button {
      Name: button
      Label: Count
      Style { Width: 120 }
      Handlers { On_Click: increment }
    }
  }
}
# Counter_ViewModel.py
from tess_ui import Signal, ViewModel

class CounterViewModel(ViewModel):
    views = "Counter"             # the view it serves

    def __init__(self):
        super().__init__()
        self.count = Signal(0)

    def increment(self):
        self.count.update(lambda n: n + 1)
# app.py
from tess_ui import App
from Counter_ViewModel import CounterViewModel

app = App(width=240, height=160, title="Counter", search=["."])
app.bind(CounterViewModel)
app.open_view("Counter")      # Counter_View.tdl
app.show("Counter")
app.run()

Tesserae is on PyPI as tesserae-ui, pre-alpha, and runs on Linux, macOS and Windows.

What you get

Where to go

Installation pip install tesserae-ui
Getting Started Your first window and node, declaratively and from Python
Tutorial and the same as a project A Tasks app in six steps: components, styling, screens, a custom window; in one flat folder, then as a tesserae new project
Guide How each part works
Components and Stylesheets Every MD3 component, its TDL and its look
Themes Colour, shape, type, light and dark
Python API and TDL reference Every class, function and key
Architecture How it fits together
Changelog and Migrating What changed, release by release

Files: Tesserae reads them, tess_re gets data

You always give Tesserae file paths or names: views, images, themes, stylesheets and fonts. Tesserae reads, parses and decodes them itself and hands tess_re only data. Every error names the file, line and column you wrote, and the nearest name when you misspelt one.