Eventize permits to listen to “before” and “after” methods events and “on_get”, “on_change”, “on_set”, “on_del” attributes events.
- Features:
Can be used as a simple subject/observer pattern
Conditional events
Use descriptors to lazily and unobstrusively listen to “on_get”, “on_change”,”on_set”, “on_del” events on attributes and “before” and “after” events on methods.
Precise callbacks inheritance (see Subject)
Statically and dynamically customizable (via inheritance, pattern visitor over a “modifier” protocol, decorators…)
Fine grained event dispatcher
- It can listen to events at 3 levels (by order of execution):
Descriptor Class: for all classes which use the given Attribute or Method descriptor class
Descriptor Instance: for all objects of a given class
Object instance: for the given object attribute value or method
Table of Contents
Installation
Install it from pypi:
pip install eventize
or from sources:
git clone git@github.com:apieum/eventize.git cd eventize python setup.py install
Usage
Development
Contributions are greatly appreciated.
Please use github (issue tracker, pull requests…) or contact me at apieum [at] gmail [dot] com
Testing
Tests are my specs so code (except refactorings) without tests won’t probably be accepted. If you want to contribute please add tests.
Test recommended requirements:
pip install -r dev-requirements.txt
Sometimes –spec-color doesn’t function. You should uninstall nosecolor and nosespec then reinstall nosecolor and nosespec separatly (nosecolor first).
You can fix it like this:
pip uninstall nosespec nosecolor pip install nosecolor && pip install nosespec
In order to have fast feedback with TDD loops, I develop with two virtualenvs (2.7 and 3.x python versions) launched in a splited shell (tmux) which runs tests each time a file changes. Use the code below with option –with-watch to launch tests this way.
Launching tests:
git clone git@github.com:apieum/eventize.git cd eventize nosetests --with-spec --spec-color ./eventize # or with watch # nosetests --with-spec --spec-color --with-watch ./eventize
Documentation
Documentation is generated by sphinx from restructured text localized in doc/source. It is build by make (see doc/Makefile).
Except to explain implementation choices (why), please avoid comments in code. It aims at keeping focus on coding and avoiding outdated comments. Keep long names (vars, functions, classes…) and explicit tests names (complete sentences) to have understandable code.
Building doc:
git clone git@github.com:apieum/eventize.git cd eventize/eventize/doc make all # or make *target* (see in Makefile for *target* or type make)
Continuous Integration
CI is made by travis for different python versions (trying to maintain compatibility with v2 python).
- It checks:
test suites (nosetest)
rst-lint this README
doc building
Metadata
Release files for eventize 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eventize-0.4.4.tar.gz | 29.6 kB | Without provenance | Details for eventize-0.4.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eventize-0.4.4-py3-none-any.whl | Python 3 | none | any | Details for eventize-0.4.4-py3-none-any.whl |
Total release size: 67.7 kB
Release files / eventize-0.4.4.tar.gz
| Download URL | eventize-0.4.4.tar.gz |
|---|---|
| Size | 29.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfd58a877f21f24f1eac6bad363bdb88495133cfef82aa5965cdcd06201879c7
|
|
BLAKE2b-256 checksum How to use checksums |
5a4facba42d16684407fac7f8e58a152322197bfc712feb613ff8c3952da8604
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / eventize-0.4.4-py3-none-any.whl
| Download URL | eventize-0.4.4-py3-none-any.whl |
|---|---|
| Size | 38.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70fee87b8c6f136dd39a72482cd81642cd07f449885de47408b4fe26a815812e
|
|
BLAKE2b-256 checksum How to use checksums |
3a98a4209aba1e7a0e9b70e7663c44ae8d0df32db8eb22a8d00de5ad10823724
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Security for eventize 0.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.