A tool to generate Flet UI from Figma designs.
Project description
FigmaFlet
FigmaFlet is a tool that generates Flet UI code directly from Figma designs. It streamlines the process of transforming your Figma prototypes into production-ready Python code using the Flet framework.
Features
- Figma Integration: Fetch designs directly from Figma using the file URL and API token.
- Automatic Code Generation: Generate Flet UI code from your designs with minimal manual effort.
- Multi-line Text Handling: Supports multi-line text elements seamlessly.
- Graphical Interface: Provides an intuitive GUI for entering API tokens, file URLs, and output paths.
Installation
From Source
- Clone the repository:
git clone https://github.com/Benitmulindwa/figmaflet.git
cd figmaflet
- Install the dependencies:
pip install -r requirements.txt
From PyPI
pip install figmaflet
Usage
- Launch the GUI to interactively input your API token, file URL, and output path:
python -m figmaflet.gui
How It Works
- Input your API token, file URL and output path.
- FigmaFlet fetches the design data using Figma's API token.
- The tool processes the design elements and generates Flet-compatible Python code.
- The generated code is saved to your specified output path.
- Command-Line Interface (CLI) Once installed, use the CLI to generate Flet code:
figmaflet --apikey YOUR_API_KEY --fileurl YOUR_FILE_URL --output YOUR_OUTPUT_PATH
Figma API Key You will need your Figma API token to access design files. Generate your key by visiting your Figma account settings.
File URL Provide the Figma file URL containing your design; This is your figma project's URL.
Results:
Figma design
Figmaflet output
Upcoming Features
- Images✅
- Icons
- TextFields✅
- Buttons + Events handling(eg: on_hover)
- Fonts support✅
- Style Improvements: better handling of shadows, gradients and other advanced figma styles
- UI Responsivity
- Flexibiliy: the generated code must be more flexible and easy to edit
- Animations
Contributing
Contributions to FigmaFlet are highly welcomed!
To contribute:
- Fork the repository.
- Create a feature branch.
- Submit a pull request with a detailed explanation of your changes.
License
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
Author
Benit Mulindwa - GitHub
Acknowledgments
Special thanks to the tkinterdesigner and Figma communities for their support and inspiration.
Contact
For questions, suggestions, or feedback, feel free to open an issue or reach out to mulindwabenit@gmail.com.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file figmaflet-0.0.4.tar.gz.
File metadata
- Download URL: figmaflet-0.0.4.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea4f8981a5191bf2ed9e2b5b6f237b6c929acafcd13669d04b756d660d04dcab
|
|
| MD5 |
e7a37227bf2cfca79c8534f216804f43
|
|
| BLAKE2b-256 |
2e00c2a9ddcc977604a73471c6cb5921408d293f0bf25ef728dddf325fcfd93f
|
File details
Details for the file figmaflet-0.0.4-py3-none-any.whl.
File metadata
- Download URL: figmaflet-0.0.4-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2da0f5801e19b6db60deef55d5357591bbb0218659d33aab3d896f989bb49b62
|
|
| MD5 |
91d5f4aa14e47dc1252e65fd8fed5ca4
|
|
| BLAKE2b-256 |
1aa14ada49a632f22680158078d641d7005ab3ef3d1221c4ce37dc903cfc3ffc
|