Skip to main content

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.

🦋Support Figmaflet

If this project resonate with you, consider supporting its development with a donation. Your contributions will help me maintain and enhance this project.

Thank you for your support! 💕

🌟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.
  • Graphical Interface: Provides an intuitive GUI for entering API tokens, file URLs, and output paths.
  • Images
  • Font-families
  • Shadow
  • Gradients:(Linear & Radial gradients)
  • TextFields

📦Installation

From Source

  1. Clone the repository:
git clone https://github.com/Benitmulindwa/figmaflet.git
cd figmaflet
  1. Install the dependencies:
pip install -r requirements.txt

From PyPI

pip install figmaflet

🚀Usage

  1. Launch the GUI to interactively input your API token, file URL, and output path:
python -m figmaflet.gui

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.
  1. Command-Line Interface (CLI) Once installed, use the CLI to generate Flet code:
figmaflet --apitoken YOUR_API_TOKEN --fileurl YOUR_FILE_URL --output YOUR_OUTPUT_PATH

Figma API Token

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.

🔥Examples:

figmaOriginal

figmaflet0 0 4

figmaflet-signup

🌱Upcoming Features

  • Icons
  • Buttons + Events handling(eg: on_hover)
  • UI Responsivity
  • Flexibility: 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.
  • ⭐Star this Repo: if you find it useful.

Contact

For questions, suggestions, or feedback, feel free to open an issue or reach out to mulindwabenit@gmail.com. Connect with me on LINKEDIN.

Metadata

Release files for figmaflet 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for figmaflet 0.0.6
File Size Uploaded
figmaflet-0.0.6.tar.gz 19.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for figmaflet 0.0.6
File Interpreter ABI Platform
figmaflet-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 39.6 kB

Release files / figmaflet-0.0.6.tar.gz

Download URL figmaflet-0.0.6.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6b07a183743af71d9041be5e3b26bb8f1cd8d5e3e067bbf19e3166a23c59de66
BLAKE2b-256 checksum
How to use checksums
1075f1a36f4b10aa0d53261c0bb64ed77279aa1bf36610c576c98d285ac0aa63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Release files / figmaflet-0.0.6-py3-none-any.whl

Download URL figmaflet-0.0.6-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d64c9f3c7702f4271b1f7859b78bdc9f57e196341a1fa3db2f7ed06fb7ccd271
BLAKE2b-256 checksum
How to use checksums
0c852d629a2c433bb93ad8a46472721f8674756c0b73fe894373b81b646847c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page