A framework for supporting MVC and observer patterns in Python
Project description
Orrery
A framework for supporting MVC and observer patterns in Python
Install
pip install orrery
Update
pip install --update orrery
Documentation
Quick start
See the Tutorial page for more information
Create a model containing an initial value
from orrery.models import ValueModel
my_model = ValueModel(value=5)
Read or set the model value
my_model.value = 6
print(my_model.value)
Constant model:
from orrery.models import ConstantModel
my_model = ConstantModel(value=5)
Model containing a class (i.e. store without copying)
from orrery.models import ClassModel
my_object = MyClass()
my_model = ClassModel(my_object)
Check if a model has been given a value:
print(my_model.has_value())
Observe changes to a model:
class CallbackClass:
def value_changed(self, model):
print(f"New value: {model.value}")
callback_class = CallbackClass()
my_model.add_value_changed_listener(callback_class.value_changed)
Create a model which depends on other models:
from orrery.models import DependentModel, ValueModel
model_a = ValueModel(value=2)
model_b = ValueModel(value=3)
sum_model = DependentModel(
dependencies=dict(model_a=model_a, model_b=model_b),
get_result=lambda dependencies: dependencies["model_a"].value + dependencies["model_b"].value
)
print(sum_model.value)
Source code
License
See license file
Copyright
© 2025 Code Choreography Limited
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file orrery-0.1.0.tar.gz.
File metadata
- Download URL: orrery-0.1.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d24ba5073baa28edbb37694762fdfb26d91aa2800a214355d78d420008792f29
|
|
| MD5 |
aeadc97fbd3cc039df93edaaafee686c
|
|
| BLAKE2b-256 |
727bc9dff8dbc1bc515842796706556faffc4500ca2f1f2eafc8cd49a8fd001d
|
Provenance
The following attestation bundles were made for orrery-0.1.0.tar.gz:
Publisher:
publish.yml on CodeChoreography/orrery
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orrery-0.1.0.tar.gz -
Subject digest:
d24ba5073baa28edbb37694762fdfb26d91aa2800a214355d78d420008792f29 - Sigstore transparency entry: 612275724
- Sigstore integration time:
-
Permalink:
CodeChoreography/orrery@ae03ac797f3feee3f8d48a4958d5734f54ab3316 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CodeChoreography
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ae03ac797f3feee3f8d48a4958d5734f54ab3316 -
Trigger Event:
push
-
Statement type:
File details
Details for the file orrery-0.1.0-py3-none-any.whl.
File metadata
- Download URL: orrery-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47462aa87a9fb47ebb15177837bfdbd27a231ffad66ce98e4a8542d636955741
|
|
| MD5 |
38b53b51eb91578efe77aa7ce4e46265
|
|
| BLAKE2b-256 |
2e236f6dd62a258c5e7f6f9d1dccf679a9a83fa8f4db7632eac56b2c9e36f93a
|
Provenance
The following attestation bundles were made for orrery-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on CodeChoreography/orrery
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
orrery-0.1.0-py3-none-any.whl -
Subject digest:
47462aa87a9fb47ebb15177837bfdbd27a231ffad66ce98e4a8542d636955741 - Sigstore transparency entry: 612275738
- Sigstore integration time:
-
Permalink:
CodeChoreography/orrery@ae03ac797f3feee3f8d48a4958d5734f54ab3316 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CodeChoreography
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ae03ac797f3feee3f8d48a4958d5734f54ab3316 -
Trigger Event:
push
-
Statement type: