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.2.tar.gz (20.1 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.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: figmaflet-0.0.2.tar.gz
  • Upload date:
  • Size: 20.1 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.2.tar.gz
Algorithm Hash digest
SHA256 12f9b806f2fb6a3132aadd9c4f1e24d954f805b24339d40795f597cd901560fa
MD5 d91f2af923a6b3f9b1ec3dc354f0ede9
BLAKE2b-256 5ab26c7226d80f2892f59528302d51a5093b1a06e0d958330c767c77eafb2cbe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: figmaflet-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e376cfee28d9c9d19e7087ab5719b47d082ec97e14a0e5fcd621b58f81e49ab6
MD5 7eb06b98d4ee0ab3d5b071b11d17f321
BLAKE2b-256 26ffa29ab035ffef7c2db224cc755679f86c011183f38f69316a45329d865e78

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