Connectors
The Connectors package facilitates the writing of block-diagram-like processing networks. For this it provides decorators for the methods of processing classes, so they can be connected to each other. When a parameter in such a processing network is changed, the result values will also be updated automatically. This is similar to a pipes and filters architecture, the observer pattern or streams.
This short example demonstrates the core functionality of the Connectors package by implementing a processing network of two sequential blocks, which double their input value:
>>> import connectors
>>>
>>> class TimesTwo:
... def __init__(self, value=0):
... self.__value = value
...
... @connectors.Input("get_double")
... def set_value(self, value):
... self.__value = value
...
... @connectors.Output()
... def get_double(self):
... return 2 * self.__value
>>>
>>> d1 = TimesTwo() # create an instance that doubles its input value
>>> d2 = TimesTwo().set_value.connect(d1.get_double) # create a second instance and connect it to the first
>>> d2.get_double()
0
>>> d1.set_value(2)
>>> d2.get_double() # causes the new input value 2 to be processed by d1 and d2
8
Installation
The Connectors package requires Python version 3.6 or later. Python 3.5 might work, but this is not tested.
pip3 install connectors
Documentation
The documentation for the Connectors librariy can be found on Read the Docs.
License
The Connectors package is published under the terms and conditions of the GNU lesser general public license version 3 or later (LGPLv3+).
Metadata
Release files for connectors 4.1
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 |
|---|---|---|---|---|
| connectors-4.1.tar.gz | 33.5 kB | Without provenance | Details for connectors-4.1.tar.gz |
Release files / connectors-4.1.tar.gz
| Download URL | connectors-4.1.tar.gz |
|---|---|
| Size | 33.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80992fb286516f578c9957569dcddc05ac0baff87fd81007e937a71ff36cc048
|
|
BLAKE2b-256 checksum How to use checksums |
404a608bad823b8b2b9e3e3204b9097b4719b1be3f8ebfd1852d1c827302dc43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
|
Security for connectors 4.1
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.