module framework
Project description
modulepy
easily build modular applications
features
- module baseline
- ipc
- module dependency resolution
- one-line module loading
usage
from modulepy import ModuleBase, ModuleInformation, ModuleVersion, SharedData, ModuleManager
class ModuleA(ModuleBase):
information = ModuleInformation("A", ModuleVersion(1, 0, 0))
dependencies = [ModuleInformation("B", ModuleVersion(1, 0, 0))]
def work(self):
self.enqueue({"A": 0})
def process_input_data(self, data: SharedData):
print(data)
class ModuleB(ModuleBase):
information = ModuleInformation("B", ModuleVersion(1, 0, 0))
def work(self):
self.enqueue({"B": 1})
if __name__ == '__main__':
manager = ModuleManager()
manager.add_module(ModuleA())
manager.add_module(ModuleB())
manager.start()
manager.join()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
modulepy-0.1.tar.gz
(3.7 kB
view hashes)