Socket
Book a DemoInstallSign in
Socket

orrery

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orrery

A framework for supporting MVC and observer patterns in Python

Source
pipPyPI
Version
0.1.1
Maintainers
1

Orrery

PyPI - Version License Test lint Publish Docs

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

© 2025 Code Choreography Limited

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts