Skip to main content

A Lucide icon library package for Python applications

Project description

Lucide Python

A Python implementation of the lucide icon library that can be used with the tagflow package to easily render icons in your Python web applications.

This project provides a full set of lucide icons as Python context managers, along with a demo application to browse and search all available icons.

Features

  • Complete set of lucide icons: All icons from the lucide library are available.
  • Easy to use: Icons can be rendered as context managers using tagflow.
  • Customizable: Icons can be customized with width, height, and other SVG attributes.
  • Demo application: A web application to browse, search, and filter all icons.

Screenshot

App Screenshot

Setup and Installation

  1. Clone the repository:

    git clone https://github.com/dotlabshq/lucide-py.git
    cd lucide-py
    
  2. Build the environment: This will create a virtual environment and install all the necessary dependencies.

    make build-env
    
  3. Download the icons: This will clone the original lucide repository to download the SVG icon assets.

    make setup-resources
    
  4. Generate the icon library: This will generate the Python modules for each icon from the SVG assets.

    make generate-icons
    

Running the Demo Application

To browse all the available icons, you can run the demo application.

make run

This will start a web server on http://127.0.0.1:8000. Open this URL in your browser to see the icon library.

The demo application allows you to:

  • View all icons grouped by category.
  • Filter icons by category.
  • Search for icons by name.

Usage in Your Application

You can use the generated icons in any application that uses tagflow.

Here's an example of how to use an icon:

from lucide.icons import Activity
from tagflow import document

with document() as doc:
    with Activity(width="48", height="48", classes="text-blue-500"):
        pass

print(doc.to_html())

This will produce the following HTML:

<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke_width="2" stroke_linecap="round" stroke_linejoin="round" class="text-blue-500">
    <path d="M22 12h-4l-3 9L9 3l-3 9H2"></path>
</svg>

Running Tests

To run the test suite, which verifies that all icons are generated correctly:

make test

License

Lucide is licensed under the MIT license. See LICENSE.

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

lucide_py-0.3.3.tar.gz (148.7 kB view details)

Uploaded Source

Built Distribution

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

lucide_py-0.3.3-py3-none-any.whl (777.3 kB view details)

Uploaded Python 3

File details

Details for the file lucide_py-0.3.3.tar.gz.

File metadata

  • Download URL: lucide_py-0.3.3.tar.gz
  • Upload date:
  • Size: 148.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for lucide_py-0.3.3.tar.gz
Algorithm Hash digest
SHA256 6ee9535800a17aba077a2981386689de156e963e8e390d483abc36d2c0433106
MD5 77f6ac697a4373c64b29bca8bdeaf102
BLAKE2b-256 814b210b23d92510df0580ee28c6b42bf00bb34485b04a9f717d1fda6ef993f3

See more details on using hashes here.

File details

Details for the file lucide_py-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: lucide_py-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 777.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for lucide_py-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4a70f9bec256d220d11b63f8f1022ff7ff2b107d02ba651b25e1b1e4399a9ee5
MD5 090ed7a9a95676a2d343a2f22aeb5dd2
BLAKE2b-256 12a13c491238237eb52d963a0167388834d3a7e81ce377dac3aa8758505bf169

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