dependencies helper
Project description
dependency helper
Dependency helper for properties of python class
$ pip install deps_helper
from deps_helper import Dependencies
class A(deps := Dependencies.new()):
# "_for" can be an array
@deps.register(_for="operation")
def requested_by(self, user):
print(f"operation requested by {user}")
return user
@deps.guard()
def operation(self):
...
>>> a = A()
>>> a.operation()
Traceback (most recent call last):
...
AttributeError: ("follow attributes are not assigned for operation => ", [requested_by])
>>> a.requested_by = "admin"
>>> a.operation() # OK
>>>
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
deps_helper-0.1.4.tar.gz
(1.6 kB
view hashes)
Built Distribution
Close
Hashes for deps_helper-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aac131f4ce9d2b49c89133dc24378d9ce41b3bc55fdd8f43ef87d10fd44d779b |
|
MD5 | 21f27927b3be3ea8c7df33b5c626a766 |
|
BLAKE2b-256 | 399548ab456456063aa637bb07e2f1ae5714a568ee66a5860dc993fca6a84c06 |