GithubHelp home page GithubHelp logo

lineindent / fletxible Goto Github PK

View Code? Open in Web Editor NEW
82.0 6.0 10.0 1.37 MB

Python boilerplate for rapid application development with Flet.

License: MIT License

Python 100.00%
flet-dev python theme application desktop-application website-template

fletxible's Introduction

fletxible.


Fletxible is a Python web boilerplate project designed to provide a solid foundation for building web applications with Python and Flet. The project comes pre-configured with a range of tools and features to make it easy for developers to get started building their applications, without the need to spend time setting up infrastructure or configuring tools.

Installation

To use Fletxible, you need to have the following installed:

  • Latest version of Flet
  • Python 3.5+

If you don't have Flet installed, installing Fletxible automatically installs it for you. You can install Fletxible using the following command:

$ pip install Fletxible

Application Setup

After installing Fletxible, you can test if it's working properly by running the following command:

$ fx-init

If the package was installed correctly, a folder called src will be generated inside the root directory. Other directories and files will also be generated.

3. Quick Start

Open the config.py file inside the src folder and configure the document as needed. Change the site name, repository link, as well as any theme-related settings. You can also add/remove the navigation section as needed.

When you're ready, change directories to the source folder, cd src, and then run the following command to generate your files/pages:

python3 scripts/build.py

If successful, the script should generate the files inside the pages folder that correspond to the config.py navigation map.

You can then run the following command to see your application:

python3 main.py

If the setup has no error, you can start customizing your pages by adding in your personal layout directly within the generated pages inside the pages directory.

Current Algorithm Functions

This algorithm is a script that loads and processes data from a YAML file flet_config.yml that contains navigation information for a web application. The script then updates and creates various files and directories necessary for the application to function.

Here is a summary of what the algorithm does (v0.2.0):

  1. Import necessary libraries and functions

  2. Define a dictionary variable to hold route keys

  3. Define several functions to perform various tasks:

    1. open_yaml_script(): Loads data from the "fx_config.yml" file.
    2. check_pages_directory_script(): Checks if a "pages" directory exists and creates one if not.
    3. update_pages_directory_script(docs: dict): Loops over the files in the "pages" directory and deletes any files that are not listed in the navigation information.
    4. handle_navigation_routing_script(docs: dict): Loops over the navigation information and writes route strings to a temporary file.
    5. set_application_routing_script(docs: dict): Reads the temporary file created in the previous step, creates a route.py file with the appropriate routes, and deletes the temporary file.
    6. set_default_methods_script(docs: dict): Loops over the navigation information and creates default pages for each page listed, and creates a route.pickle file with information about the modules used in the application.
    7. map_yaml(yaml_file_path, output_file_path): Reads a YAML file and writes its contents to a Python file with a specified filename.
    8. script(page: ft.Page): Main function that calls the other functions to process the data and set up the application.

Overall, the script is part of a larger application development process that involves reading and processing data from a YAML file, creating and updating various files and directories, and setting up routing information for a web application.

Contributing

Contributions are highly encouraged and welcomed.

License

Fletxible is open-source and licensed under the MIT License.

fletxible's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fletxible's Issues

watchdog version not compatibles

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
reflex 0.3.4 requires watchdog<3.0.0,>=2.3.1, but you have watchdog 3.0.0 which is incompatible.

Cannot install fletxible

While writing pip install Fletxible it shows "ERROR: Failed building wheel for pickle5" if i try to install pickle5 it shows "Failed building wheel for pickle5
Running setup.py clean for pickle5
Failed to build pickle5
ERROR: Could not build wheels for pickle5, which is required to install pyproject.toml-based projects"
Need your help

Index out of range error in Drawer.py

Hi,
Thank you for making this template.
I tried to install it using pypi and then run fletxible-init.
The web page wont show up and I got this error message:

File "/Users/hurricane/Documents/pscripts/core/drawer.py", line 28, in init
primary = self.docs["theme"][1]["primary"]
~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Is there anyway to fix it?

FileNotFoundError: [WinError2] The system cannot find the file specified

(.venv) C:\src\flet\airbnb>fx-init
Creating source directory...
Source directory created successfully.
Running build scripts...
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\src\flet\airbnb.venv\Scripts\fx-init.exe_main
.py", line 7, in
File "C:\src\flet\airbnb.venv\Lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\src\flet\airbnb.venv\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\src\flet\airbnb.venv\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\src\flet\airbnb.venv\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\src\flet\airbnb.venv\Lib\site-packages\scripts\create.py", line 86, in create
subprocess.run(
File "C:\Program Files\Python311\Lib\subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\Python311\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.