flet README

The project's README from github.com/flet-dev/flet. As one markdown file: README.md.

Flet logo

Build multi-platform apps in Python. No frontend experience required.

License Package version Monthly downloads Python >= 3.10 Build status Docstring coverage


Flet is a framework that allows building mobile, desktop and web applications in Python only without prior experience in frontend development.

   Single code base for any device

Your app will equally look great on iOS, Android, Windows, Linux, macOS and web.

   Build an entire app in Python

Build a cross-platform app without knowledge of Dart, Swift, Kotlin, HTML or JavaScript - only Python!

   150+ built-in controls and services

Beautiful UI widgets with Material and Cupertino design: layout, navigation, dialogs, charts - Flet uses Flutter to render UI.

   50+ Python packages for iOS and Android

Numpy, pandas, pydantic, cryptography, opencv, pillow and other popular libraries.

   Full web support

Flet apps run natively in modern browsers using WebAssembly and Pyodide, with no server required. Prefer server-side? Deploy as a Python web app with real-time UI updates.

   Built-in packaging

Build standalone executables or bundles for iOS, Android, Windows, Linux, macOS and web. Instantly deploy to App Store and Google Play.

   Test on iOS and Android

Test your project on your own mobile device with Flet App. See your app updates as you make changes.

   Extensible

Easily wrap any of thousands of Flutter packages to use with Flet or build new controls in pure Python using built-in UI primitives.

   Accessible

Flet is built with Flutter which has solid accessibility foundations on Android, iOS, web, and desktop.

Flet app example

Below is a simple "Counter" app, with a text field and two buttons to increment and decrement the counter value:

import flet as ft

def main(page: ft.Page):
    page.title = "Flet counter example"
    page.vertical_alignment = ft.MainAxisAlignment.CENTER

    input = ft.TextField(value="0", text_align=ft.TextAlign.RIGHT, width=100)

    def minus_click(e):
        input.value = str(int(input.value) - 1)

    def plus_click(e):
        input.value = str(int(input.value) + 1)

    page.add(
        ft.Row(
            alignment=ft.MainAxisAlignment.CENTER,
            controls=[
                ft.IconButton(ft.Icons.REMOVE, on_click=minus_click),
                input,
                ft.IconButton(ft.Icons.ADD, on_click=plus_click),
            ],
        )
    )

ft.run(main)

To run the app, install flet:

pip install 'flet[all]'

then launch the app:

flet run counter.py

This will open the app in a native OS window - what a nice alternative to Electron! 🙂

To run the same app as a web app use --web option with flet run command:

flet run --web counter.py

Learn more

Community

Contributing

Want to help improve Flet? Check out the contribution guide.

flet (flet-dev/flet)

Searching Database…

17.4K ·GitHub
What is this?Flet is a Python framework for building web, mobile and desktop apps from a single Python codebase - no frontend experience required, with Flutter rendering the UI.
So it's a framework, not an app builder - what do I actually write?You write the entire app in Python using Flet's controls; the framework handles UI rendering via Flutter, multi-platform output and packaging.
How do I get a first app running?Install flet, then launch with 'flet run' - the app opens in a native OS window; add the '--web' flag to run the same app in a browser instead.
Do I need Dart, Swift or JavaScript on top of Python?No - Python only. Flet even bundles 50+ popular Python packages for iOS and Android, including numpy, pandas, pydantic, cryptography, opencv and pillow.
Does the same code really cover phones, desktops and the browser?Yes - one codebase targets iOS, Android, Windows, Linux, macOS and web. In the browser it runs natively via WebAssembly and Pyodide with no server, or you can deploy server-side with real-time UI updates.
What UI building blocks does it ship with?150+ built-in controls and services styled with Material and Cupertino design: layout, navigation, dialogs and charts.
How do I test the app on my phone while developing?Open the project on your own iOS or Android device with the Flet App and see updates appear as you make changes.
How do I distribute the finished app?Built-in packaging creates standalone executables or bundles for iOS, Android, Windows, Linux, macOS and web, ready to deploy to the App Store and Google Play.
Can I add controls that Flet doesn't include?Yes - wrap any of thousands of existing Flutter packages for use with Flet, or build new controls in pure Python from built-in UI primitives.
Creator
flet-dev
Size
217.5 MB
Stars
17.4K
Age
4y
Commits · 90 Days