GUIDE / START

What is JanelKit?

A Python framework for desktop applications: what it does, what it is not, and the pieces every app is made of.

Core janelkit Included with janelkit. Nothing extra to install.
CHAPTER 01 / 29~3 min read · try examples at your own pace

How to read this documentation

No experience with web frameworks, HTML, or CSS is required. We assume you can read basic Python: variables, functions, lists, and imports. The documentation has three areas. The Guide teaches in order; everything in it ships with janelkit. The Reference is for looking up exact details. The Ecosystem covers the packages you add when you need them: navigation, shared data, system dialogs, translations and editor support.

  1. Build your first appA complete example, explained step by step.
  2. Meet the built-in elementsWindows, layout and controls included with janelkit.
  3. Look up a Python functionSignatures, behavior, and when to use each API.
  4. Explore the ecosystemWhat the core includes, and what each package adds.
Alpha / 0.2 — These pages document JanelKit 0.2 and its packages. Each series (0.1, 0.2…) may change the public API, always with migration notes: see Changes and migration. The website uses Svelte; the desktop examples use Python and JanelKit, not JavaScript.

What you will learn

  • What JanelKit is for and who it is written for.
  • The pieces of every JanelKit application, and which ones you write.
  • What JanelKit is not, so familiar-looking syntax does not mislead you.

A framework for desktop windows, written in Python

A graphical user interface, or GUI, lets people use a program through windows, buttons and text fields instead of typing commands. JanelKit is a framework for building those interfaces in Python. A framework is a library plus a structure: it handles drawing, input and updates, and you describe what your application contains and what it should do.

The applications are desktop programs for Windows, macOS and Linux. They are not websites and do not run in a browser. You describe each window in a .janel file and write its behavior in ordinary Python, so you can use any Python library you already know.

Every app has five pieces; you write three

Each piece has one job. You write the logic, the template and, optionally, the styles. JanelKit and Qt do the rest. Keeping these jobs apart is what makes a JanelKit file easy to read: data and functions in one place, the visible structure in another, appearance in a third.

PieceIts jobWho writes it
Script (Python)Holds the data and the functions: what the window knows and what happens on a click.You
TemplateDescribes what the window contains: which elements, in which order, showing which data.You
StylesDescribe how it looks: spacing, colors, sizes. Optional.You
JanelKitCompiles your file, runs your Python and keeps the window in step with your data.Provided
Qt Quick (through PySide6)Draws the window and its controls and delivers keyboard and mouse input.Provided

A first look at a .janel file

This is a complete JanelKit component: a window with a sentence and a button that counts clicks. Read it from top to bottom. You do not need to understand every line yet; the next chapters run it and explain each part.

janel
<script lang="python">
from janelkit import state
count = state(0)
</script>

<window title="Hello, JanelKit" width={480} height={320}>
  <column class="page">
    <text>You clicked {count} times.</text>
    <button variant="primary" on:click={count += 1}>Increment</button>
  </column>
</window>

<style>
.page { padding: 24px; gap: 16px; }
</style>
Copy

Complete component · Save as src/App.janel in a scaffolded project.

How it works

  1. The script is Python. state(0) creates a number the window watches; the name count refers to it.
  2. The template describes the window: a <column> (a vertical stack) containing a <text> and a <button>.
  3. {count} inside the text shows the current number. When count changes, the sentence updates by itself.
  4. on:click={count += 1} says what happens when the button is clicked: add one to count.
  5. The style section gives the <column> some inner space (padding) and space between its children (gap).

What you should see

A desktop window titled Hello, JanelKit shows You clicked 0 times. and an Increment button. Each click increases the number.

Learn moreYour first app ↗Anatomy of a .janel file ↗

What JanelKit is not

Some of the syntax looks like the web, because it borrows ideas that work well there: tags in angle brackets, a style section, values in braces. The meaning is different, and assuming otherwise causes most early mistakes.

The tags are desktop elements, not HTML: <button> is a JanelKit control and <div> does not exist. Expressions in braces are Python, not JavaScript. Styles are a supported subset of CSS-like properties, not a full browser stylesheet. You never write JavaScript or QML, the language Qt uses to describe interfaces; JanelKit generates the QML internally.

Common mistakes

  • Do not reach for HTML tags or attributes; use the built-in elements and their documented properties.
  • Write Python inside braces: True and False, and, or, not, len(items). JavaScript operators such as === and && are errors.
  • Do not paste browser CSS and expect it all to work; unsupported properties produce a warning and are ignored.

What you need, and what to know before you start

You need Python 3.10 or newer, and you should be comfortable reading basic Python: variables, functions, lists, dictionaries and imports. No web, HTML or CSS experience is required.

JanelKit is in alpha (version 0.2). Each series (0.1, 0.2…) may change the public API, always with migration notes and, where possible, janel migrate to update your project. A .janel script is ordinary Python and runs with your program’s permissions: there is no sandbox, so never open a .janel file you do not trust.

Learn moreInstallation ↗

Key points

  • JanelKit builds desktop applications in Python; it is not a web framework.
  • You write a script (data and functions), a template (what the window contains) and optional styles.
  • Braces hold Python expressions, tags are desktop elements, and styles are a CSS-like subset.

English documentation based on the JanelKit source. For additional details, browse the source docs ↗.