Skip to main content

SWUbanner

QtMDi (Qt Material Design icons)

license pypi version PyPI Python Version

Copyright 2023 Yaroshenko Dmytro (https://github.com/o-murphy)

The extension for QtAwesome with the latest variable icon fonts for Material Symbols

(Python 3, PySide, PyQt)

Installation

QtMDi is built on QtAwesome and qtpy, which is just an abstraction layer over Qt bindings - it doesn't ship a Qt binding itself, so you need to install one (PyQt5, PySide2, PyQt6 or PySide6) alongside it:

pip install QtMDi PyQt6

Install the latest release from PyPi:

pip install QtMDi

Install the latest updated version from github:

pip install https://github.com/o-murphy/QtMDi

Using qtmdi-browser as a standalone tool

If you just want to run the icon browser (see Available Icons) without installing QtMDi into a project, use uv tool install (or pipx) with a Qt binding as an extra dependency:

uv tool install qtmdi --with pyqt6
# or
uv tool install qtmdi --with pyside6

qtmdi-browser

Usage

Supported Fonts

QtAwesome identifies icons by their prefix and their icon name, separated by a period (.) character.

The following prefixes are currently available to use:

Example

Import qtawesome and qtmdi in your python file:

import qtawesome
import qtmdi

Icon creation example

# basic rounded
qtawesome.icon("mds-rounded-base.home")

# rounded with 700 width
qtawesome.icon("mds-rounded-700.home")

# rounded with 400 width
qtawesome.icon("mds-sharp-400.home")

# basic variablefont ttf based icon
qtawesome.icon("mdf-sharp.home")

# simpleicons variablefont icon
qtawesome.icon("si.cplusplus")

Create an app

from qtpy import QtWidgets


class Example(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        self.lt = QtWidgets.QVBoxLayout(self)
        self.btn = QtWidgets.QToolButton(self)
        self.btn.setIcon(
            qtawesome.icon("mds-rounded-700.home"),
        )
        self.btn.setFixedSize(48, 48)
        self.btn.setIconSize(32, 32)
        self.lt.addWidget(self.btn)

Load extension on your app instance

import sys
from qtpy import QtWidgets
import qtawesome
import qtmdi


# Create an app
class Example(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        self.lt = QtWidgets.QVBoxLayout(self)
        self.btn = QtWidgets.QToolButton(self)
        self.btn.setIcon(
            qtawesome.icon("mds-rounded-700.home"),
        )
        self.btn.setFixedSize(48, 48)
        self.btn.setIconSize(32, 32)
        self.lt.addWidget(self.btn)


def run():
    app = QtWidgets.QApplication()

    # Load extension on your app instance
    qtmdi.load(app)

    qtawesome.dark(app)
    w = Example()
    w.show()
    sys.exit(app.exec_())


if __name__ == "__main__":
    run()

Available Icons

To see available icons run qtmdi-browser in your terminal

qtmdi-browser

Development

This project uses uv for dependency management and packaging.

Font binaries under src/qtmdi/icons and src/qtmdi/brands aren't committed to git (they're fetched fresh at build/CI time to keep the repo small) - after cloning, run the fetch scripts once to populate them locally. fetch_fonts.py downloads the Material Symbols variable fonts straight from Google's material-design-icons repository and generates the per-weight static files with fonttools; fetch_brand_icons.py downloads the Simple Icons font + metadata from its GitHub Releases. Neither needs npm/node/woff2:

# install dependencies (including dev tools)
uv sync

# fetch the fonts (one-time, or whenever you want the latest icons)
uv run python scripts/fetch_fonts.py
uv run python scripts/fetch_brand_icons.py
uv run python scripts/fix_font_families.py
uv run python scripts/create_symbols_charmap.py

# run the test suite
uv run pytest

# lint
uv run ruff check
uv run flake8 .

# launch the icon browser against your local checkout
uv run qtmdi-browser

Font binaries are refreshed automatically by the symbols-update workflow (via scripts/fetch_fonts.py and scripts/fetch_brand_icons.py), which also fixes the Material Symbols fonts' internal family names so weight/style selection resolves correctly in Qt (scripts/fix_font_families.py), regenerates icons/charmap.json (scripts/create_symbols_charmap.py), and writes manifest.json - a checksum of every font file, committed instead of the binaries themselves, so the workflow can tell whether the fonts actually changed and only cut a release when they did (scripts/write_font_manifest.py). You normally shouldn't need to touch any of these by hand.

Known issues

  • Filled icons not shown as expected
  • Grade property currently unsupported
  • Optical size property currently unsupported

License

Fonts bundled by QtMDi itself (mdf, mds, si)

Fonts available transitively through the QtAwesome dependency

QtMDi doesn't bundle the fonts below itself - they ship as part of the qtawesome package (a QtMDi dependency), which carries its own licensing for them; they're listed here only because QtMDi's load()/qtawesome.icon() gives you access to their prefixes too.

Metadata

Release files for QtMDi 2.0.15

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

Source distribution (sdist)

Source distribution for QtMDi 2.0.15
File Size Uploaded Provenance Actions
qtmdi-2.0.15.tar.gz 33.7 MB Without provenance Details for qtmdi-2.0.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for QtMDi 2.0.15
File Interpreter ABI Platform Actions
qtmdi-2.0.15-py3-none-any.whl Python 3 none any Details for qtmdi-2.0.15-py3-none-any.whl

Total release size: 67.5 MB

Release files / qtmdi-2.0.15.tar.gz

Download URL qtmdi-2.0.15.tar.gz
Size 33.7 MB
Tags Source
SHA-256 checksum
How to use checksums
5e5bd4f374c94059e07fb09284ccc85a5958ada8ffa14be8ee4beb517481a7d0
BLAKE2b-256 checksum
How to use checksums
83e4e155bb667b3f1a61f77be013ecaf25b40470eae81d80563bfc0c42e9c3f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qtmdi-2.0.15-py3-none-any.whl

Download URL qtmdi-2.0.15-py3-none-any.whl
Size 33.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b2b8cb24758dca98c8d47cad7e13f1b302c5032b30baa9b2176e206004835a88
BLAKE2b-256 checksum
How to use checksums
2953af9fccdd78ea1aeaafcaf4c05da0787b9d4c960eb103fa5b662c6f57fd74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for QtMDi 2.0.15

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

2.0.15 This release

2 release files No provenance

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