Skip to main content

OPAQUE - Opinionated Python Application with Qt UI for Engineering. A flexible MDI application framework for PySide6.

Project description

OPAQUE Framework

OPAQUE - Opinionated Python Application with Qt UI for Engineering

A flexible, modern MDI (Multiple Document Interface) application framework built on PySide6, designed for creating professional desktop applications with enterprise-grade features.

OPAQUE Framework Screenshot

🚀 Key Features

  • MVP Architecture: Clean separation of concerns (Model-View-Presenter).
  • MDI Interface: Manage multiple feature windows within a single application.
  • Built-in Services:
    • Notification System: Non-intrusive toast notifications and a centralized notification center.
    • Console System: Real-time capture and display of stdout/stderr for debugging.
    • Logging: Structured logging with file and console output.
    • Settings & Persistence: Automatic saving/loading of application settings and window states.
    • Theme Support: Dark/Light mode support.
  • Professional Widgets: CloseableTabWidget, ColorPicker, and more.
  • Build System: Tools to package your app as a standalone executable (PyInstaller/Nuitka).

📦 Installation

pip install opaque-framework

For development:

pip install "opaque-framework[dev]"

🏁 Quick Start

1. Bootstrap Your Application

Create a main.py file:

import sys
from PySide6.QtWidgets import QApplication
from opaque.view.application import BaseApplication
from opaque.models.configuration import DefaultApplicationConfiguration
from opaque.models.annotations import StringField

# 1. Define Configuration
class MyAppConfig(DefaultApplicationConfiguration):
    app_name = StringField(default="MyApp")
    app_title = StringField(default="My OPAQUE App")

# 2. Define Application
class MyApplication(BaseApplication):
    def __init__(self):
        super().__init__(MyAppConfig())
        # Register features here (see documentation)

# 3. Run
if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MyApplication()
    if window.try_acquire_lock():
        window.show()
        sys.exit(app.exec())

2. Add a Feature (MVP)

Create a simple feature (e.g., MyFeature):

from opaque.models.model import BaseModel
from opaque.view.view import BaseView
from opaque.presenters.presenter import BasePresenter
from PySide6.QtWidgets import QLabel, QVBoxLayout

# Model
class MyModel(BaseModel):
    def feature_name(self): return "My Feature"
    def feature_icon(self): return None 

# View
class MyView(BaseView):
    def __init__(self, app, parent=None):
        super().__init__(app, parent)
        layout = QVBoxLayout()
        layout.addWidget(QLabel("Hello OPAQUE!"))
        self.setLayout(layout)

# Presenter
class MyPresenter(BasePresenter):
    pass # Add logic here

# In MyApplication.__init__:
self.register_feature(MyPresenter(MyModel(self), MyView(self), self))

📚 Documentation

📂 Examples

Check the examples/ directory in the repository for complete working examples:

  • basic_example: Full showcase of MVP, Logging, Console, and Tabs.
  • notification_example: Demonstrates the notification system.
  • closeable_tab_example: Using the advanced Tab widget.

🤝 Contributing

Contributions are welcome! Please see the Issues page.

📄 License

MIT License - see LICENSE for details.

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

opaque_framework-1.0.2.tar.gz (87.7 kB view details)

Uploaded Source

Built Distribution

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

opaque_framework-1.0.2-py3-none-any.whl (95.6 kB view details)

Uploaded Python 3

File details

Details for the file opaque_framework-1.0.2.tar.gz.

File metadata

  • Download URL: opaque_framework-1.0.2.tar.gz
  • Upload date:
  • Size: 87.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for opaque_framework-1.0.2.tar.gz
Algorithm Hash digest
SHA256 bd667658d8e81361331b85bcd85d832c851fe23f04c9b5b40f5889047e4075f4
MD5 525f723dbf16d92e3ce72579606b5800
BLAKE2b-256 3c9a505cd4a6e2fc6aef246ec37bfa1e926d2ad612f456cc7d7e9c35f11aa08c

See more details on using hashes here.

File details

Details for the file opaque_framework-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for opaque_framework-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 52e82afc7ccf8ad53f94dca401498fd928c49d54f14554ec437f8312dfde449b
MD5 fb306061f358e68dbba7cf400b490dd0
BLAKE2b-256 b0e50cb646e6d746c2c96a29421b7e35ea52d2f34d3244554d10c45f07bba21d

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