Skip to main content

A CLI for the Flet framework.

Project description

Fletil

A CLI for the Flet framework.

Features

  • Exposes the standard run options for a Flet app.
  • Implements "hot reload": reloads the targeted source file whenever changes are saved, attempting to preserve the running state of controls.
    • State to preserve must be specified by passing a unique ID and list of attribute names as data to the controls, eg. TextField(value="hello world", data={"_cid": "greet_text", "_state_attrs": ["value"]}).
    • If a Syntax error is detected during a reload, it is aborted.
  • Developer buttons (a breakpoint button and code status indicator) can be temporarily injected into the page.

Installing

NOTE: this also installs Flet if it isn't present.

  • From PyPI:
    • $ pip install fletil.
  • From GitLab (NOTE: development is managed by Poetry):
    • $ git clone https://gitlab.com/skeledrew/fletil
    • $ cd fletil
    • $ poetry install

Usage

  • Ensure script is import-friendly, ie. invoke runner with (doc):
if __name__ == "__main__":
    flet.app(target=main)

and not:

flet.app(target=main)
  • Further help is available via $ fletil --help.

License

MIT.

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

fletil-0.3.0.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

fletil-0.3.0-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

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