Skip to main content

Reusable dark-themed PyQt5 components for Scientific Instruments tools

Project description

si-ui

Reusable dark-themed PyQt5 components for Scientific Instruments desktop tools.

Built on a Catppuccin Mocha-inspired colour palette, si-ui gives every SI app a consistent, modern look out of the box.


Features

Component Description
apply_dark_theme(app) Apply the Fusion dark palette to any QApplication
SI_DARK_STYLE Comprehensive QSS stylesheet (buttons, inputs, tables, scrollbars, …)
COLORS Dict of named Catppuccin Mocha hex values
SplashScreen Animated GIF (or text-fallback) splash window
PlotCanvas Dark-themed matplotlib FigureCanvas with scatter-point tracking
SIBaseApp Three-panel QMainWindow base class with convenience helpers

Installation

From GitHub (recommended)

pip install git+https://github.com/<your-org>/si_ui.git

Local / editable install

git clone https://github.com/<your-org>/si_ui.git
cd si_ui
pip install -e .

Quick Start

import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel
from si_ui import apply_dark_theme, SI_DARK_STYLE, SIBaseApp

class MyTool(SIBaseApp):
    def create_left_panel(self) -> QWidget:
        panel, layout = self.make_panel()
        layout.addWidget(QLabel("Inputs go here"))
        layout.addStretch()
        return panel

    def create_center_panel(self) -> QWidget:
        panel, layout = self.make_panel()
        layout.addWidget(QLabel("Main content"))
        layout.addStretch()
        return panel

    def create_right_panel(self) -> QWidget:
        panel, layout = self.make_panel()
        layout.addWidget(QLabel("Results"))
        layout.addStretch()
        return panel

app = QApplication(sys.argv)
apply_dark_theme(app)
window = MyTool(title="My SI Tool", min_size=(1000, 550))
window.show()
sys.exit(app.exec_())

Splash Screen

from si_ui import SplashScreen

splash = SplashScreen(
    title="MY APP",
    subtitle="Loading…",
    gif_data=base64_gif_string,   # or None for text fallback
)
splash.finished.connect(show_main_window)
splash.show()

Plot Canvas

from si_ui import PlotCanvas

canvas = PlotCanvas(parent=self, width=6, height=4,
                    xlabel="Frequency (Hz)", ylabel="Impedance (Ω)")
canvas.axes.plot(x_data, y_data, color=canvas.line_color)
canvas.add_point(x, y)        # highlighted scatter point
canvas.draw()

Requirements

  • Python ≥ 3.10
  • PyQt5 ≥ 5.15
  • matplotlib ≥ 3.5

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

si_ui-1.0.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

si_ui-1.0.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file si_ui-1.0.0.tar.gz.

File metadata

  • Download URL: si_ui-1.0.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for si_ui-1.0.0.tar.gz
Algorithm Hash digest
SHA256 81d0f395f3b0d61f06726a250a4255a7b97c91f79684393f2499f732a54451b2
MD5 6145ecc672035e75d17165e4ba3cb012
BLAKE2b-256 6e310836040a05f81a47de957363740b6c8697abb1273ce850b024b1bf72651a

See more details on using hashes here.

File details

Details for the file si_ui-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: si_ui-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for si_ui-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 758ee2f7a9a78fda6ec5057646db6d00285888eccb8f20f2f705897aad4468da
MD5 b7e77ae2ad7bfe7671003da945933cd8
BLAKE2b-256 442c3c7bb1b64a2060a6143cdae6212bfea7e2726f2efb457b8531fc6c52a18f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page