### Installing Python Test Dependencies Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This command uses `pip` to install `pytest` and `coverage`, which are essential Python packages for running tests and measuring code coverage within the project. These dependencies are required before executing any tests. ```Shell pip install pytest coverage ``` -------------------------------- ### Installing pytablericons Python Library Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This snippet demonstrates how to install the pytablericons library using pip, the Python package installer. It's the first step to integrate Tabler Icons into your Python project, ensuring all necessary components are available. ```python pip install pytablericons ``` -------------------------------- ### Integrating Tabler Icons with PyQt6 in Python Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This snippet provides an example of using a Tabler Icon within a PyQt6 application. It shows how to load an icon, convert it to a `QPixmap` using `toqpixmap()`, and then set it as the icon for a `QPushButton` within a `QMainWindow`. ```python from PyQt6.QtGui import QIcon from PyQt6.QtWidgets import QMainWindow, QPushButton from pytablericons import TablerIcons, OutlineIcon class Window(QMainWindow): def __init__(self): super().__init__(parent=None) # Load icon icon_rotate = TablerIcons.load(OutlineIcon.ROTATE, color='#000') # Create button with icon self.button = QPushButton(self) self.button.setText('Rotate') self.button.setIcon(QIcon(icon_rotate.toqpixmap())) ``` -------------------------------- ### Using Tabler Icons with Pillow in Python Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This example demonstrates loading a filled icon and integrating it with the Pillow (PIL) library. It shows how to display the loaded icon using `icon.show()` and access its size property, which is useful for image manipulation tasks. ```python from pytablericons import TablerIcons, FilledIcon icon = TablerIcons.load(FilledIcon.CIRCLE_CHECK) # Load icon icon.show() # Show icon print(icon.size) # Print icon size ``` -------------------------------- ### Using Tabler Icons with Tkinter in Python Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This example illustrates how to use Tabler Icons in a Tkinter application. It involves loading an icon, converting it to a `PIL.ImageTk.PhotoImage` object, and then assigning it to a Tkinter `Button` widget for display. ```python from PIL import ImageTk from tkinter import Tk, Button from tkinter.constants import * from pytablericons import TablerIcons, OutlineIcon # Create window root = Tk() # Load icon and convert to ImageTk icon_rotate = TablerIcons.load(OutlineIcon.ROTATE, size=16, color='#000', stroke_width=3.0) icon_rotate_tk_image = ImageTk.PhotoImage(icon_rotate) # Create button with icon button = Button(root, text='Rotate', image=icon_rotate_tk_image, compound=LEFT) button.pack(padx=50, pady=25) # Run event loop root.mainloop() ``` -------------------------------- ### Executing Pytest with Coverage Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This command runs the `pytest` test suite for the project while simultaneously collecting code coverage data using the `coverage` tool. It must be executed from the main project directory after cloning the repository. ```Shell coverage run -m pytest ``` -------------------------------- ### Loading Outline and Filled Icons in Python Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This snippet shows how to import `TablerIcons`, `OutlineIcon`, and `FilledIcon` from the `pytablericons` library and load specific outline and filled icons using the static `load()` method. Icons are identified by their uppercase names with hyphens replaced by underscores. ```python from pytablericons import TablerIcons, OutlineIcon, FilledIcon icon_rotate = TablerIcons.load(OutlineIcon.ROTATE) # Outline icon icon_check = TablerIcons.load(FilledIcon.CIRCLE_CHECK) # Filled icon ``` -------------------------------- ### Generating Code Coverage Report Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This command generates a comprehensive code coverage report, detailing which lines of code were executed during the tests. The `--ignore-errors` flag ensures the report is generated even if minor issues occur, and `-m` highlights missing coverage. ```Shell coverage report --ignore-errors -m ``` -------------------------------- ### Customizing Icon Size, Color, and Stroke Width in Python Source: https://github.com/niklashenning/pytablericons/blob/master/README.md This snippet illustrates how to customize the appearance of loaded icons by specifying `size`, `color` (hex or limited names), and `stroke_width` parameters when calling `TablerIcons.load()`. This allows for flexible styling of the SVG icons to match application themes. ```python # Width and height 100px (default: 24) icon_custom_size = TablerIcons.load(OutlineIcon.ROTATE, size=100) # Color red (default: '#FFF') icon_custom_color = TablerIcons.load(OutlineIcon.ROTATE, color='#ff0000') # Stroke width 1.5 (default: 2.0) icon_custom_stroke_width = TablerIcons.load(OutlineIcon.ROTATE, stroke_width=1.5) # Combining everything icon_custom = TablerIcons.load(OutlineIcon.ROTATE, size=100, color='#ff0000', stroke_width=1.5) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.