Skip to main content

⚡Flet-Easy is a user-friendly add-on package for Flet, offering a cleaner code structure with numerous customizable features like JWT, routers, decorators, middleware and more.

Project description

🔥Flet-Easy

githubpypi

image image image socket uv linting - Ruff Linters Tests Downloads

logo

Flet-Easy is a comprehensive package built as an add-on for Flet. It provides a clean, intuitive API with advanced routing, authentication, middleware, page caching, and responsive design capabilities for building modern desktop, web, and mobile applications.

✨ Features (v0.3.0)

  • Page Caching System: Optional state preservation across navigation for seamless user experience. (Docs)
  • NavigationBar Integration: Built-in support for ft.NavigationBar with automatic routing. (Docs)
  • Enhanced Middleware: Class-based middleware with page-specific application support. (Docs)
  • Simple page routing (Various ways to add pages). (Docs)
  • Dynamic routing, customization in the routes for greater accuracy in sending data. (Docs)
  • Routing protection (Docs)
  • Custom Page 404 (Docs)
  • Controlled data sharing between pages. (Docs)
  • Asynchronous support.
  • JWT support for authentication sessions. (Docs)
  • Working with other applications. (Docs)
  • CLI to create app structure FletEasy (fs init). (Docs)
  • Easy integration of on_keyboard_event in each of the pages. (Docs)
  • Use the percentage of the page width and height of the page with on_resize. (Docs)
  • ResponsiveControlsy control to make the app responsive. (Docs)
  • Supports Application Packaging for its distribution. (view)

📌 Flet events it handles

  • on_route_change : Dynamic routing
  • on_view_pop
  • on_keyboard_event
  • on_resize
  • on_error

💻 Ways to install

Install Flet-Easy Complete

[!NOTE] If you use the fs cli, it is important to have git installed.

Installs all the dependencies to use, you can use all the functionalities provided by FletEasy

pip install flet-easy[all]

Install clean Flet-Easy

[!TIP] Recommended for Flet Packaging Application.

Requires installation of Flet >= 0.28.0.

pip install flet[all]

If you do not use: CLI-to-create-app

pip install flet-easy

Install FletEasy if you need to use Basic-JWT

pip install flet-easy[JWT]

💻 Update

pip install flet-easy[all] --upgrade

🔥 Flet-Easy app example

Here is an example showcasing the new NavigationBar layout and routing features:

import flet as ft
import flet_easy as fs

app = fs.FletEasy(route_init="/home")

# 1. Define a Global View
# This layout (AppBar, NavigationBar, etc.) will be shared across pages
@app.view
def main_view(data: fs.Datasy):
    return fs.Viewsy(
        appbar=ft.AppBar(
            title=ft.Text("My Flet-Easy App"),
            bgcolor=ft.Colors.BLUE,
        ),
        navigation_bar=ft.NavigationBar(
            destinations=[
                ft.NavigationBarDestination(icon=ft.Icons.HOME, label="Home"),
                ft.NavigationBarDestination(icon=ft.Icons.INFO, label="About"),
            ],
            on_change=data.go_navigation_bar, # Handles automatic routing via index
        ),
        bgcolor=ft.Colors.GREY_50,
    )

# 2. Create the Home Page
@app.page("/home", title="Home", index=0) # index=0 matches the first Nav interface
def home_page(data: fs.Datasy):
    data.view.appbar.title = ft.Text("Welcome Home! 🏠")

    return ft.View(
        controls=[
            ft.Text("Welcome to Flet-Easy! 🎉", size=30, weight=ft.FontWeight.BOLD),
            ft.Text("Now with page caching and NavigationBar support!", size=16),
            ft.ElevatedButton(
                "Go to About",
                on_click=lambda _: data.go_route("/about"), # Direct navigation
            ),
        ],
        appbar=data.view.appbar,
        navigation_bar=data.view.navigation_bar,
        vertical_alignment="center",
        horizontal_alignment="center",
    )

# 3. Create the About Page
@app.page("/about", title="About", index=1)
def about_page(data: fs.Datasy):
    data.view.appbar.title = ft.Text("About Flet-Easy")

    return ft.View(
        controls=[
            ft.Text("About Flet-Easy", size=24),
            ft.Text("Build amazing apps with Python and new caching features!"),
            ft.ElevatedButton("← Back Home", on_click=lambda _: data.go_back()),
        ],
        appbar=data.view.appbar,
        navigation_bar=data.view.navigation_bar,
        vertical_alignment="center",
        horizontal_alignment="center",
    )

# 4. Run the application
if __name__ == "__main__":
    app.run()

🎬 Demo

app example

🚀 How to use Flet-Easy?

[!IMPORTANT] 📑 Documentation: https://daxexs.github.io/flet-easy/

👀 Code examples

[!TIP] https://github.com/Daxexs/flet-easy/tree/main/tests

🔎 Contribute to this project

Read the CONTRIBUTING.md file

🧾 License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flet_easy-0.3.0.dev25.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flet_easy-0.3.0.dev25-py3-none-any.whl (42.4 kB view details)

Uploaded Python 3

File details

Details for the file flet_easy-0.3.0.dev25.tar.gz.

File metadata

  • Download URL: flet_easy-0.3.0.dev25.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flet_easy-0.3.0.dev25.tar.gz
Algorithm Hash digest
SHA256 e4c1caf3ccd654c6c98d7a36db8dc9234041a13d7ae00d22ce154794f55125d2
MD5 18045c7ebe6de1077aca162cd12f2f54
BLAKE2b-256 d153f02f28ba6f84af8abd01686066d3cb7c3ff5d33e5c25e404fdfd1ac40eee

See more details on using hashes here.

File details

Details for the file flet_easy-0.3.0.dev25-py3-none-any.whl.

File metadata

  • Download URL: flet_easy-0.3.0.dev25-py3-none-any.whl
  • Upload date:
  • Size: 42.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flet_easy-0.3.0.dev25-py3-none-any.whl
Algorithm Hash digest
SHA256 d8eb1e15db0ed90484742e5dab029dc38e497fd01801bbd7ecb758c1b6a4c81a
MD5 1e020c5e100de19a3c9d83bfdc4874ff
BLAKE2b-256 2487964a2eb2ba2aaf46941bc6d534361284501dbeab89afebca2abd2b76ec54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page