Skip to main content

pyside6-widgets

This package is no longer maintained. It has been replaced by sciwidgets (pip install sciwidgets), which contains all of these widgets and more.

Old (pyside6_widgets) New
MathLabel from sciwidgets.labels import MathLabel
NumericLineEdit from sciwidgets.params import NumericLineEdit
MenuBarController, StatusBarController from sciwidgets.window import ...
dialogs from sciwidgets.dialogs import ...

Some arguments have changed; see the sciwidgets docs.

PyPI version

Reusable PySide6 GUI components for scientific applications.

Built from real scientific software, these widgets are production-tested and designed to be dropped into any PySide6 project with no external dependencies beyond PySide6 itself (plus Matplotlib for the SVG label).

Components

Widget / Module Description
MathLabel SVG-backed label with optional LaTeX rendering via Matplotlib
NumericLineEdit Validated numeric input with scientific notation and range checking
SciNumberValidator Qt validator for integer and float input
MenuBarController Build a full Qt menu bar from a Python dict — no boilerplate
StatusBarController State-aware status bar with live memory and elapsed-time display
dialogs General-purpose message, info, about, and confirmation dialogs

Installation

pip install pyside6-widgets

Quick Start

MathLabel

Renders math expressions using Matplotlib's mathtext engine. Pass use_tex=True only if a LaTeX distribution is installed on the system.

from pyside6_widgets import MathLabel

# Matplotlib mathtext (no LaTeX installation needed)
label = MathLabel(text=r"E=mc^2", font_size=20, text_color="black")

# Full LaTeX rendering (requires LaTeX installation)
label = MathLabel(text=r"E=mc^2", font_size=20, use_tex=True)

NumericLineEdit

from pyside6_widgets import NumericLineEdit

# Float input in range [0, 100]
edit = NumericLineEdit(init_val=1.5, min_limit=0.0, max_limit=100.0, val_fmt="{:.3g}")
edit.valueChanged.connect(lambda v: print(f"New value: {v}"))

# Integer input
edit = NumericLineEdit(init_val=10, value_is_int=True, min_limit=0, max_limit=999)

MenuBarController

from PySide6.QtWidgets import QMainWindow
from pyside6_widgets import MenuBarController

class MyWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        menu_spec = {
            "File": [
                {"id": "open", "text": "Open…", "shortcut": "Ctrl+O"},
                {"id": "sep"},
                {"id": "quit", "text": "Quit", "shortcut": "Ctrl+Q"},
            ],
            "View": [
                {"id": "dark_mode", "text": "Dark Mode", "checkable": True},
            ],
        }
        self.menu = MenuBarController(self, menu_spec=menu_spec)
        self.menu.actionTriggered.connect(self.on_action)

    def on_action(self, menu: str, action_id: str, checked: bool):
        print(f"{menu} → {action_id} (checked={checked})")

StatusBarController

from PySide6.QtWidgets import QMainWindow
from pyside6_widgets import StatusBarController, StatusState

class MyWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.status = StatusBarController(self)

    def run_solver(self):
        self.status.set_state(StatusState.SOLVING)   # starts timer
        # ... do work ...
        self.status.set_state(StatusState.READY)     # stops timer

Dialogs

from pyside6_widgets import (
    show_information, show_warning, show_critical,
    show_about_dialog, ask_question, AskResult,
)

# Simple message dialogs
show_information("Done", "The export completed successfully.")
show_warning("Warning", "File already exists.")
show_critical("Error", "Could not open file.")

# About dialog
show_about_dialog(
    title="My App",
    html_text="<p>Version 1.0</p><p>Author: Vahid Anari</p>",
    heading="My App",
)

# Confirmation dialog
result = ask_question("Confirm", "Are you sure you want to delete this?")
if result == AskResult.YES:
    delete()

Requirements

  • Python 3.10+
  • PySide6 >= 6.5
  • matplotlib >= 3.7 (required only for MathLabel)
  • psutil >= 5.9 (required only for StatusBarController)

License

MIT License — see LICENSE for details.

Author

Vahid Anari — GitHub · LinkedIn

Reusable PySide6 GUI components — validated numeric inputs, math labels, declarative menu bar, status bar, and dialogs.

Metadata

Release files for pyside6-widgets 0.1.1

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

Source distribution (sdist)

Source distribution for pyside6-widgets 0.1.1
File Size Uploaded Provenance Actions
pyside6_widgets-0.1.1.tar.gz 27.8 kB Without provenance Details for pyside6_widgets-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyside6-widgets 0.1.1
File Interpreter ABI Platform Actions
pyside6_widgets-0.1.1-py3-none-any.whl Python 3 none any Details for pyside6_widgets-0.1.1-py3-none-any.whl

Total release size: 56.5 kB

Release files / pyside6_widgets-0.1.1.tar.gz

Download URL pyside6_widgets-0.1.1.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c052a300f91bb67937f82ba222dba1245abf8c866a24923f8e694e0d0d923900
BLAKE2b-256 checksum
How to use checksums
cb40fad01972a6182ea893296263f6ca2f036abe0f029e4d364e031f443128e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / pyside6_widgets-0.1.1-py3-none-any.whl

Download URL pyside6_widgets-0.1.1-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a05bebf372059d3c56e239c2a23c92efc1c51af7049c47c511e29854b3b8b19
BLAKE2b-256 checksum
How to use checksums
d2800436e4dcf2207208e11cdde9ff930171157f25b7794a4bfe187f6e7f5a2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for pyside6-widgets 0.1.1

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

0.1.1 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