Skip to main content

pyqtrapid

Build Status PyPI Version License: MIT Python Versions

pyqtrapid is a CLI scaffolding framework and architecture generator for Python desktop applications built with PyQt and PySide.

It streamlines the creation of maintainable, testable, and production-ready GUI applications by establishing architectural separation of concerns, multi-binding abstraction, threading utilities, theme management, component generation, and standard packaging out of the box.


Key Features

  • Multi-Binding Compatibility: Native support for PyQt6, PySide6 (Official Qt for Python 6), and PyQt5.
  • Architecture Scaffolds:
    • MVP (Model-View-Presenter): Decoupled presentation logic, ideal for enterprise desktop applications.
    • MVVM (Model-View-ViewModel): Reactive view-model binding pattern for data-driven UIs.
    • Minimal: Lightweight structure for rapid prototyping.
  • Component Generators: CLI commands to scaffold individual Views, Models (with unit tests), Dialogs, and Presenters on demand.
  • Executable Packaging Scaffolds: Instant setup for PyInstaller (.spec) and Nuitka C++ standalone executable builds.
  • Asynchronous Thread Pool: Built-in non-blocking background task runner utilizing QThreadPool and QRunnable.
  • Theme System: Integrated QSS styling engine supporting light/dark theme switching and QSettings persistence.
  • Testing & Diagnostics: Pre-configured pytest suite and structured logging infrastructure.

Installation

Install pyqtrapid using pip:

pip install pyqtrapid

To install from source for development:

git clone https://github.com/edeniyanda/pyqtrapid.git
cd pyqtrapid
pip install -e .

CLI Command Reference

1. Project Scaffolding (startproject)

Scaffold a complete application directory:

pyqtrapid startproject <project_name> [options]
Option Short Default Description
--binding -b pyqt6 Qt Python binding (pyqt6, pyside6, pyqt5)
--template -t mvp Architectural template (mvp, mvvm, minimal)
--force -f false Overwrite target directory if it already exists

2. Component Scaffolding (generate)

Generate modular components inside an existing project:

pyqtrapid generate <type> <name> [options]
Component Type Description Output Files
view Qt Widget View src/views/<name>_view.py
model Domain Model & Unit Test src/models/<name>_model.py
tests/test_<name>_model.py
dialog Modal Dialog (QDialog) src/views/<name>_dialog.py
presenter Presenter Controller src/presenters/<name>_presenter.py

3. Packaging Configuration (build-config)

Scaffold production build files for single-file executable bundling:

# Generate PyInstaller build specification
pyqtrapid build-config --tool pyinstaller --name my_app

# Generate Nuitka C++ standalone build script
pyqtrapid build-config --tool nuitka --name my_app

Quick Start Examples

Scaffold an MVP Project with PyQt6 (Default)

pyqtrapid startproject desktop_app

Scaffold an MVVM Project with PySide6

pyqtrapid startproject analytics_dashboard --binding pyside6 --template mvvm

Generate Components Inside Existing Project

cd desktop_app

# Generate a User Profile Model with tests
pyqtrapid generate model user_profile

# Generate a Settings View
pyqtrapid generate view settings

# Generate a Custom Login Dialog
pyqtrapid generate dialog login

Directory Structure Overview

Generated projects adhere to clean separation of concerns:

desktop_app/
├── main.py                   # Application entry point & Qt event loop
├── pyproject.toml            # Package metadata & test configuration
├── src/
│   ├── app.py                # Dependency injection & view factory
│   ├── core/                 # App config, logging, and async worker pool
│   │   ├── config.py
│   │   ├── logger.py
│   │   └── worker.py
│   ├── models/               # Domain state & business logic (pure Python)
│   ├── views/                # Qt Widgets & UI layout definitions
│   ├── presenters/           # Presentation logic connecting Views & Models
│   └── resources/            # Stylesheets (QSS) and static assets
│       └── styles/
│           ├── dark.qss
│           └── light.qss
├── ui/                       # Qt Designer (.ui) XML files
└── tests/                    # Unit tests and view suite (pytest)

Running and Testing Scaffolded Applications

Navigate to your generated project directory and run the application:

cd desktop_app
pip install -e .
python main.py

Run the automated test suite:

pytest

Contributing

Contributions, issue reports, and feature suggestions are welcome. Please refer to CONTRIBUTING.md to get started.


License

pyqtrapid is released under the MIT License.

Download files

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

Source Distribution

pyqtrapid-1.0.0.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

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

pyqtrapid-1.0.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqtrapid-1.0.0.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.8

File hashes

Hashes for pyqtrapid-1.0.0.tar.gz
Algorithm Hash digest
SHA256 be9b522b27b5c07e1a3572e218408e31ca7804dee4822f19a34bb73b3ef04e49
MD5 dfa186a1f33d0f4c9f4df3a4dcf5d67f
BLAKE2b-256 14e58b868841190facc83b2d3aeb1e48f7746fdc6232eb750690a2977c15560a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqtrapid-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.8

File hashes

Hashes for pyqtrapid-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d7a8bc99db5b0af67b7a1f65586b85f03f09a72ade5bbcb9466287dd6b27599
MD5 571633d7de41c681e9e6c3dbcf04205e
BLAKE2b-256 da54aa7135a4f2146d2425e4a2c5f45f087bf3a2e56ecdb6d659afacf8a59ff6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.1.0

2 files

0.0.1

2 files

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