PyMVVM
Simplified MVVM for Python
PyMVVM is a Python package that simplifies the implementation of the Model-View-ViewModel (MVVM) pattern. It provides a set of base classes and utilities to create robust, maintainable, and testable applications.
Features
- Easy-to-use base classes for Model, ViewModel, and View
- Automatic property binding and change notification
- Support for computed properties
- Command pattern implementation for actions
- Asynchronous command support
- State management in ViewModels
- Dependency injection for data services
- Factory function for quick MVVM setup .
Installation
You can install PyMVVM using pip:
Quick Start
Here's a simple example of how to use PyMVVM:
from PyMVVM import create_mvvm, ViewModel, View, computed_property
class UserViewModel(ViewModel):
@computed_property
def display_name(self):
return f"{self.model.name} ({self.model.age})"
class UserView(View):
def update(self):
print(f"User: {self.view_model.display_name}")
# Create MVVM structure
model, vm, view = create_mvvm(
{'name': 'John', 'age': 30},
view_model_class=UserViewModel,
view_class=UserView
)
# Use the MVVM structure
view.update() # Output: User: John (30)
model.name = "Jane"
view.update() # Output: User: Jane (30)
Metadata
Release files for pymvvm-design 0.7.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 | |
|---|---|---|---|
| pymvvm_design-0.7.0.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymvvm_design-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / pymvvm_design-0.7.0.tar.gz
| Download URL | pymvvm_design-0.7.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d385a0f160561d6a1bce65fb21c1b9021f3b93b56a5ad3a7bf2f7b4488d3aac3
|
|
BLAKE2b-256 checksum How to use checksums |
f8b1acd1f7f3de131163f83e858a53c7d8a682468c2ec11e2d11f7cf59321dae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / pymvvm_design-0.7.0-py3-none-any.whl
| Download URL | pymvvm_design-0.7.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15705c857647d43e8b8774b4b2685215b3fedd3f3474bcb37289fd9eebe531dd
|
|
BLAKE2b-256 checksum How to use checksums |
d89cc87241cd3489f2071071e33bad883585ea045825a3d528b82105bab1e724
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|