What is JanelKit?
A Python framework for desktop applications: what it does, what it is not, and the pieces every app is made of.
janelkit Included with janelkit. Nothing extra to install. 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.
- Build your first appA complete example, explained step by step.
- Meet the built-in elementsWindows, layout and controls included with janelkit.
- Look up a Python functionSignatures, behavior, and when to use each API.
- Explore the ecosystemWhat the core includes, and what each package adds.
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.
| Piece | Its job | Who writes it |
|---|---|---|
| Script (Python) | Holds the data and the functions: what the window knows and what happens on a click. | You |
| Template | Describes what the window contains: which elements, in which order, showing which data. | You |
| Styles | Describe how it looks: spacing, colors, sizes. Optional. | You |
| JanelKit | Compiles 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.
<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>CopyComplete component · Save as src/App.janel in a scaffolded project.
How it works
- The script is Python. state(0) creates a number the window watches; the name count refers to it.
- The template describes the window: a <column> (a vertical stack) containing a <text> and a <button>.
- {count} inside the text shows the current number. When count changes, the sentence updates by itself.
- on:click={count += 1} says what happens when the button is clicked: add one to count.
- 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.
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 ↗.