Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/burakyilmaz321/pyheroicons
Ready to use Tailwindcss Heroicons components for Python
https://github.com/burakyilmaz321/pyheroicons
component django fastapi flask heroicons icon python svg tailwind tailwindcss ui
Last synced: 3 months ago
JSON representation
Ready to use Tailwindcss Heroicons components for Python
- Host: GitHub
- URL: https://github.com/burakyilmaz321/pyheroicons
- Owner: burakyilmaz321
- License: mit
- Created: 2023-12-27T13:37:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-27T22:27:06.000Z (about 1 year ago)
- Last Synced: 2024-09-29T02:21:52.661Z (4 months ago)
- Topics: component, django, fastapi, flask, heroicons, icon, python, svg, tailwind, tailwindcss, ui
- Language: Python
- Homepage:
- Size: 356 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `pyheroicons`
[![PyPI version](https://badge.fury.io/py/pyheroicons.svg)](https://pypi.org/project/pyheroicons)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python Versions](https://img.shields.io/pypi/pyversions/pyheroicons)](https://pypi.org/project/pyheroicons)
[![Package Status](https://img.shields.io/pypi/status/pyheroicons)](https://pypi.org/project/pyheroicons)
[![CI Build](https://github.com/burakyilmaz321/pyheroicons/actions/workflows/lint_and_test.yml/badge.svg)](https://github.com/burakyilmaz321/pyheroicons/actions/workflows/lint_and_test.yml)`pyheroicons` is a Python library that offers a convenient interface to the [Tailwind CSS Heroicons](https://heroicons.com/) icon set. This library allows developers to easily integrate Heroicons into Python-based web frameworks such as Django, Flask, or FastAPI by generating SVG icon template strings.
## Installation
To install `pyheroicons`, simply use pip:
```bash
pip install pyheroicons
```## Usage
Import `heroicon` function from `pyheroicons` and use it to generate icon templates:
```python
from pyheroicons import heroicon
```## `heroicon` API
- **name** The name of the Heroicon (e.g., "academic-cap").
- **variant** The variant of the icon ("outline", "solid", "mini", or "micro").
- **cls** Optional. A CSS class to apply to the SVG icon.
- **strokewidth** Optional. The stroke width of the icon. Only applicable if the original SVG contains a stroke-width attribute. i.e. Only works for the "outline" variant.## Example usage
```python
icon_svg = heroicon(name="academic-cap", variant="outline", cls="icon-class", strokewidth="2")
print(icon_svg)
```## Keeping Up-to-Date
`pyheroicons` aims to stay up-to-date with the Heroicons library. When a new version of Heroicons is released, `pyheroicons` will also release a corresponding version to ensure compatibility.
| pyheroicons Version | Heroicons Version |
| ------------------- | ----------------- |
| 1.1.0 | 2.1.1 |## Contributing
Contributions to `pyheroicons` are welcomed!
## License
`pyheroicons` is released under the MIT License.