rulz is a decorator based IoC framework.
Project description
rulz
A decorator based IoC framework for python3.6+. There are no runtime dependencies outside of what's in the standard library.
A demo module is in rulz/plugins/demo.py
.
#!/usr/bin/env python
from rulz import plugin, run_graph
@plugin()
def one():
return 1
@plugin()
def two():
return 2
@plugin(one, two)
def add(a, b):
return a + b
if __name__ == "__main__":
print(run_graph())
Invoke it directly or create a driver script like this:
#!/usr/bin/env python
from rulz import load_components, run_graph
load_components("rulz.plugins")
print(run_graph())
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
rulz-0.0.2.linux-x86_64.tar.gz
(11.7 kB
view hashes)
Built Distribution
rulz-0.0.2-py3-none-any.whl
(10.9 kB
view hashes)