Installation
objerve can be installed by running pip install objerve
Example Usage
Let's say you have a class like that;
class M:
qux = "blue"
def __init__(self):
self.bar = 55
self.foo = 89
self.baz = 121
To watch the changes, you need the add the @watch() as a class decorator. Within the
arguments of the watch decorator you should pass in lists for the keyword arguments of
the attributes you wish to watch.
from objerve import watch
@watch(set={"foo", "qux"}, get={"bar", "foo"}, delete={"baz"})
class M:
qux = "blue"
def __init__(self):
self.bar = 55
self.foo = 89
self.baz = 121
m = M()
m.bar = 233
def abc():
m.foo += 10
m.qux = "red"
def get_foo(m):
m.bar
abc()
m.foo
del m.baz
get_foo(m)
Output:
Set | foo = 89
File "/home/blue/objerve/examples/example.py", line 9, in __init__
self.foo = 89
Set | qux = red
File "/home/blue/objerve/examples/example.py", line 21, in <module>
m.qux = "red"
Get | foo
File "/home/blue/objerve/examples/example.py", line 18, in abc
m.foo += 10
Set | foo = 99
File "/home/blue/objerve/examples/example.py", line 18, in abc
m.foo += 10
Get | foo
File "/home/blue/objerve/examples/example.py", line 29, in <module>
m.foo
Delete | baz
File "/home/blue/objerve/examples/example.py", line 30, in <module>
del m.baz
Get | bar
File "/home/blue/objerve/examples/example.py", line 25, in get_foo
m.bar
Metadata
Release files for objerve 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| objerve-0.2.0.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| objerve-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / objerve-0.2.0.tar.gz
| Download URL | objerve-0.2.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b888fba69b7fb553e82fbfb07e9cc0946d3cea122076dbc8248772f62e96fbae
|
|
BLAKE2b-256 checksum How to use checksums |
915bcdce32fff36c8b78c06f16bcb9c962246863a10abc9d15dc49518c79e1eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|
Release files / objerve-0.2.0-py3-none-any.whl
| Download URL | objerve-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18eae315200fa2b9e80b2c8ce9bfe37718e93d9eb59143ff696b378e32f1c589
|
|
BLAKE2b-256 checksum How to use checksums |
918d2dcb82571f66e0b3d64516375f96cf7e313d7cde60b3cefdaa1b6305d0f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|