Skip to main content

pyside-iconify

Give QIcon a data source.

English | 中文 | 日本語 | 한국어 | Español | Français | Deutsch | Русский | Português (BR)

IconWidget("mdi:home", color="red")

One line, one icon. No SVG or PNG files to manage — icons are fetched on demand from the Iconify ecosystem by name and cached automatically. Everything still ends up as a standard QIcon, so it works with any widget that accepts icons.

Status: under active development, not yet published to PyPI. The public API may still change before the first release.

This project is not affiliated with the Iconify project.

Why

Without With pyside-iconify
QIcon("assets/home.svg") get_icon("mdi:home")
Managing SVG/PNG files and resource paths Icons by name from the Iconify ecosystem
Multiple asset sets for colors and sizes color, size, rotate as parameters
Per-widget icon plumbing Standard QIcon, works everywhere
Manual light/dark theme icon variants Follows the widget's palette automatically

Quick start

pip install "pyside-iconify[pyside6]"
from PySide6.QtWidgets import QApplication, QPushButton
from pyside_iconify import IconWidget, get_icon

app = QApplication([])

# A standalone icon widget
icon = IconWidget("mdi:home", size=24, color="red")

# Or hand a standard QIcon to any widget
button = QPushButton("Settings")
button.setIcon(get_icon("mdi:cog", size=20))

app.exec()

That is the whole API for the common case. Icons are downloaded on first use, cached on disk, and rendered locally afterwards.

Highlights

  • Theme aware — with no color set, icons follow the widget's text color and switch automatically between light and dark themes; disabled icons fade instead of turning gray (so multi-color icons fade correctly too)
  • Full color control — single color, {original: replacement} mapping for multi-color icons, and per-theme overrides (color_light_theme / color_dark_theme)
  • Sizes the way you think — numbers, (w, h), QSize, "24px", or "1.5em" (follows the widget's font)
  • HiDPI native — sizes are logical pixels; physical pixels are rendered per screen scale factor, no @2x/@3x asset sets
  • Loading vs. missing are distinct — loading shows blank, a confirmed miss shows a built-in placeholder and emits failed; optional fallback icon
  • QSS friendly — qss="toolbar primary" tags for grouping, style with native setStyleSheet(); priority: parameters → QSS → theme
  • Typed and logged — full type hints with py.typed, standard logging (silent by default)

Parameters

Shared by IconWidget and get_icon:

get_icon(name, *, size=24, color=None, color_light_theme=None,
         color_dark_theme=None, selected_color=None, opacity=1.0,
         width=None, height=None, rotate=0, spin=False,
         h_flip=False, v_flip=False)

IconWidget(name, *, ..., hover_color=None, qss=None, parent=None)
Parameter Meaning
name Icon name like "mdi:home", or inline icon data
size Number, (w, h), QSize, "24px", or "1.5em"
color A color, or a {original: replacement} mapping
color_light_theme / color_dark_theme Per-theme overrides, win over color
selected_color Color when the item is selected (item views)
hover_color IconWidget / set_icon hover color — explicit opt-in
opacity Overall opacity 0–1; multiplied with color alpha
width / height Non-square icons; win over size
rotate Any angle in degrees, auto-shrunk to avoid clipping
spin Continuous rotation for loading indicators
h_flip / v_flip Horizontal / vertical flip
qss QSS grouping tags, IconWidget[qss~="tag"] selector (IconWidget only)

Colors accept CSS/SVG names, HEX 3/4/6/8 digit (#RRGGBBAA order), rgb()/rgba()/hsl()/hsla(), tuples, QColor, and Qt.GlobalColor. Unparseable colors raise instead of silently turning black.

Offline packaging

For air-gapped machines or zero-external-dependency builds, pack icons at release time:

python -m pyside_iconify.pack -o icons.json
from pyside_iconify import load_bundle

load_bundle("icons.json")  # at app startup; works inside PyInstaller too

See src/pyside_iconify/pack.py and tests/test_pack_integration.py for the full CLI and API. Local data always takes priority over the network.

Performance

Three-layer cache (icon data → SVG text → rendered bitmaps) with a memory budget, per-frame work kept to a cache lookup and one drawPixmap. A 1000-row QListWidget builds in ~270 ms and scrolls at native speed. For large grids use item views with get_icon; IconWidget is meant for standalone icon slots.

Support scope

Item Scope
Python 3.10 – 3.14
Qt binding PySide6
OS Windows, macOS, Linux (CI on macOS)
PySide2/PyQt Not supported (PyQt6 maybe later)

Development

uv sync --extra pyside6 --group test
$env:QT_QPA_PLATFORM = "offscreen"
pytest -v

License

MIT. Icon collections are subject to their own licenses; Qt is licensed separately by its copyright holders.

Metadata

Release files for pyside-iconify 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyside-iconify 1.0.0
File Size Uploaded Provenance
pyside_iconify-1.0.0.tar.gz 110.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyside-iconify 1.0.0
File Interpreter ABI Platform
pyside_iconify-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 182.9 kB

Release files / pyside_iconify-1.0.0.tar.gz

Download URL pyside_iconify-1.0.0.tar.gz
Size 110.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6781df6eba9c34288af2a4d1fd8c211a68e643935cf2af3960847623138bec71
BLAKE2b-256 checksum
How to use checksums
8d737afeb6d45eb7a43ed6a4f20a9caf7e0a65a7670bd463e136ce0eb284a001
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / pyside_iconify-1.0.0-py3-none-any.whl

Download URL pyside_iconify-1.0.0-py3-none-any.whl
Size 72.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba4d288c24bf1bc07647f743da370251d7891248a7cc2f31aad5748274d749c8
BLAKE2b-256 checksum
How to use checksums
f6f3ebf021bce96e41323da1cbfc1e4637226edccfcfd4eef035db7703e7a9a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for pyside-iconify 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyside_iconify-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page