Skip to main content

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 key.
  • 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 keys, file URLs, and output paths.

Installation

From Source

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

From PyPI

Coming soon! Stay tuned for our PyPI release.

pip install figmaflet

Usage

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

figmaflet_gui

How It Works

  • Input your API key, file URL and output path.
  • FigmaFlet fetches the design data using Figma's API.
  • 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:
python -m figmaflet --apikey YOUR_API_KEY --fileurl YOUR_FILE_URL --output YOUR_OUTPUT_PATH

Figma API Key You will need your Figma API key to access design files. Generate your key by visiting your Figma account settings.

File URL Provide the Figma file URL containing your design.

Results:

Figma design

figmaOriginal

Figmaflet output

figmaflet_5th_try

Upcoming Features

  • Images and Icons
  • TextFields
  • Buttons + Events handling(eg: on_hover)
  • Fonts support
  • Style Improvements: better handling of shadows, gradients and other advanced figma styles
  • 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

figmaflet-0.0.1.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

figmaflet-0.0.1-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file figmaflet-0.0.1.tar.gz.

File metadata

  • Download URL: figmaflet-0.0.1.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for figmaflet-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e6b5ca430f4c8182578e34c19ebd3e40ddb4774320433e87201d4bf4bb76eca9
MD5 d532d4d6e55119661c645b1928e55dbe
BLAKE2b-256 3de22debbc3032b3d138ee26498a51fd0b0bc045adbe5d39035addff3f0163d7

See more details on using hashes here.

File details

Details for the file figmaflet-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: figmaflet-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for figmaflet-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b00f0d9e73436defd6380b50f2552289cb4ff36c2b3442016f187e2179d012a1
MD5 b968f72fd35ae5279d74a2003a20310f
BLAKE2b-256 176586c5720b49ec51c8f7db24dd99afbf577676a50ba06c3e55cbff0b544d5a

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