pyqtrapid
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
QThreadPoolandQRunnable. - Theme System: Integrated QSS styling engine supporting light/dark theme switching and QSettings persistence.
- Testing & Diagnostics: Pre-configured
pytestsuite 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.pytests/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.
Metadata
Release files for pyqtrapid 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyqtrapid-1.0.0.tar.gz | 24.8 kB | Without provenance | Details for pyqtrapid-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyqtrapid-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pyqtrapid-1.0.0-py3-none-any.whl |
Total release size: 59.3 kB
Release files / pyqtrapid-1.0.0.tar.gz
| Download URL | pyqtrapid-1.0.0.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be9b522b27b5c07e1a3572e218408e31ca7804dee4822f19a34bb73b3ef04e49
|
|
BLAKE2b-256 checksum How to use checksums |
14e58b868841190facc83b2d3aeb1e48f7746fdc6232eb750690a2977c15560a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.8
|
Release files / pyqtrapid-1.0.0-py3-none-any.whl
| Download URL | pyqtrapid-1.0.0-py3-none-any.whl |
|---|---|
| Size | 34.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d7a8bc99db5b0af67b7a1f65586b85f03f09a72ade5bbcb9466287dd6b27599
|
|
BLAKE2b-256 checksum How to use checksums |
da54aa7135a4f2146d2425e4a2c5f45f087bf3a2e56ecdb6d659afacf8a59ff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.8
|
Security for pyqtrapid 1.0.0
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.