React-quality reactive form generation framework for PyQt6
- Dataclass-Driven Forms: Automatically generate UI forms from Python dataclasses
- ObjectState Integration: First-class support for lazy configuration and hierarchical inheritance
- ABC-Based Protocols: Type-safe widget contracts with clean interfaces
- Reactive Updates: React-style lifecycle hooks with cross-window synchronization
- Theming System: ColorScheme-based styling with dynamic theme switching
- Flash Animations: Game-engine inspired visual feedback for value changes
- Window Management: Scoped window registry with navigation support
from dataclasses import dataclass
from PyQt6.QtWidgets import QApplication
from pyqt_reactor.forms import ParameterFormManager
@dataclass
class ProcessingConfig:
input_path: str = ""
output_path: str = ""
num_workers: int = 4
enable_gpu: bool = False
app = QApplication([])
form = ParameterFormManager(ProcessingConfig)
form.show()
app.exec()pip install pyqt-reactorFor development:
git clone https://github.com/trissim/pyqt-reactor.git
cd pyqt-reactor
pip install -e ".[dev]"The package is organized in layers:
pyqt_reactor/
├── core/ # Tier 1: Pure PyQt6 utilities
├── protocols/ # Tier 2: Widget ABCs and adapters
├── services/ # Tier 3: Reusable service layer
├── forms/ # Tier 4: ParameterFormManager
├── theming/ # Color schemes and styling
├── widgets/ # Extended widget implementations
└── animation/ # Flash effects and visual feedback
Auto-generates forms from dataclasses with full type support:
from pyqt_reactor.forms import ParameterFormManager
form = ParameterFormManager(MyConfig)
config = form.collect_values() # Get typed config backSingleton window registry with scope-based navigation:
from pyqt_reactor.services import WindowManager
window = WindowManager.show_or_focus("config:plate1", lambda: ConfigWindow(...))
WindowManager.navigate_to("config:plate1", field="exposure_time")Dynamic theme switching with consistent styling:
from pyqt_reactor.theming import ColorScheme, apply_theme
apply_theme(widget, ColorScheme.DARK)Full documentation available at pyqt-reactor.readthedocs.io
MIT License - see LICENSE file for details
Contributions welcome! Please see CONTRIBUTING.md for guidelines.
Developed by Tristan Simas. Extracted from OpenHCS for general-purpose use.