Registry / web-framework / flet

flet

JSON →
library0.84.0pypypi✓ verified 35d ago

Flet is a Python framework that enables developers to build interactive, real-time, multi-platform applications using a simple Python API. It renders UI using Flutter, allowing apps to run as web apps, desktop executables, or mobile apps from the same codebase. The current version is 0.84.0, and it maintains an active and frequent release cadence, often with bi-weekly updates.

web-frameworkhttp-networking
Install & Compatibility
Where this runs
tested against v0.85.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 2.249s · 29.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.7s · import 2.015s · 30MB
28MB installed
● package 28MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The primary package is 'flet', not 'flet_web'.

import flet as ft

Type hint for the Page object passed to the main function.

page: ft.Page

This quickstart demonstrates a simple counter application. It initializes a Flet page, creates a text field and two buttons, and defines event handlers to increment or decrement the counter. The `ft.app(target=main)` call runs the application, typically opening a desktop window by default.

import flet as ft def main(page: ft.Page): page.title = "Flet Counter" page.vertical_alignment = ft.MainAxisAlignment.CENTER txt_number = ft.TextField(value="0", text_align=ft.TextAlign.RIGHT, width=100) def minus_click(e): txt_number.value = str(int(txt_number.value) - 1) page.update() def plus_click(e): txt_number.value = str(int(txt_number.value) + 1) page.update() page.add( ft.Row( [ ft.IconButton(ft.icons.REMOVE, on_click=minus_click), txt_number, ft.IconButton(ft.icons.ADD, on_click=plus_click), ], alignment=ft.MainAxisAlignment.CENTER, ) ) ft.app(target=main)
flet --version
Debug
Known footguns
breakingThe `delta_x` and `delta_y` attributes on `PointerEvent` objects have been deprecated and removed. Using them will result in an `AttributeError`.
gotchaThe correct PyPI package name for Flet is `flet`, not `flet-web`. Although Flet supports web deployment, attempting to `pip install flet-web` or `import flet_web` will lead to installation issues or `ModuleNotFoundError`.
gotchaTo deploy or run a Flet application specifically as a web app, you need to configure the view and potentially use CLI commands. Simply running a Python script will often default to a desktop application.
gotchaThe `page.add()` method expects a single control argument. A common mistake for new users is to pass multiple controls as separate arguments directly to `page.add()`.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
15 hits · last 30 days
gptbot
4
ahrefsbot
4
dotbot
3
bytedance
3
script
1
Resources