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.

🦋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

🌱Upcoming Features

  • Icons
  • Buttons + Events handling(eg: on_hover)
  • 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.
  • ⭐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.

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.5.tar.gz (18.9 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.5-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for figmaflet-0.0.5.tar.gz
Algorithm Hash digest
SHA256 53c7a1d2bccdeba57e0052ca1f9cdaad5f48cc73bf41bd5ebafaff345573f58f
MD5 ac582b2fd6f3f0273d6539c24ddb841b
BLAKE2b-256 9e1d1d5ef0491d53f584457eef6fb4036ce309984dc91d6fa4f4a24e3f65cbfd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for figmaflet-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cf24843596aeafeeb5b5833125e1b9db9db29e47570281b8edef47721e0f2b03
MD5 ee3f162673d1ad031aa42c2a14ff8fc9
BLAKE2b-256 4f67b01884e7e5e2d6840a16e8c24e572f94e0468c6caacd2a2a7c83c11047fc

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