Ubi Interact Python Node
Project description
Ubi Interact Python Node
This project implements the Ubi-Interact Protocol in Pyhton. Ubi Interact is a framework developed at TUM (Technical University of Munich) for developing distributed and reactive applications, the main focus of the Python node is to allow the implementation of processing-modules in Python.
Installation
Python Version
The Ubi-Interact-Python-Node should be compatible with all python versions >= 3.7. If you experience bugs feel free to report them.
Windows:
The Ubi-Interact-Python-Node aims to be cross-platform, working with most interesting computational packages is easier under Linux nonetheless. Installation via pip is recommended, if you use something else (e.g.``Anaconda``) refer to the documentation of your python distribution / package management tool how to install packages from pypi.
You can use the Windows python wrapper py.exe (detailed instructions in the Python Documentation) to choose the python version of your environment.
If you plan to use a virtual environment - which is recommended - typically an Unrestricted execution policy is needed to run the activation script for the python environment. The following instructions assume you are using Powershell, and have the right ExecutionPolicy set.
Python version 3.7 or greater
Virtual Environment (recommended) with pip installed (py -m venv env followed by ./env/Scripts/activate.ps1)
Continue at PyPi
Linux (and MacOS)
If you are not using Windows, you probably have a working python installation. Sometimes the different versions have aliases such as python3, so make sure to create the virtual environment with the appropriate python executable (or specify the executable for the environment during creation).
Python version 3.7 of greater
Virtual Environment (recommended) with pip installed (e.g.``python3 -m venv env`` followed by source ./env/bin/activate)
Continue at PyPi
PyPi
After activating the environment, install the package from pypi. The package supplies different extras, to install additional dependencies for optional features. You can make sure everything is working correctly by calling the ubii-client script which gets installed as part of the cli extra.
$ python -m pip install ubii-node-python[cli] $ ubii-client --help
Editable / Local Install
Instead of installing from PyPi you can clone the repository and install the package “from source”. Editable installs are supported.
$ git clone git@github.com:SandroWeber/ubii-node-python.git $ cd ubii-node-python $ < create and activate virtual env > $ pip install -e .[cli] $ ubii-client --help
Extras
This packages uses extras.
[test] Requirements to run pytest suite if you install the package from source, and not from PyPi
Currently the [test] extra depends on some processing-module packages. Make sure you have all requirements installed (especially on Windows some processing dependencies are not in pypi)
[cli] Installs a CLI script which runs the node and auto-discovers installed Processing Modules (see below)
[docs] Install requirements to build documentation
Usage
To use the ubii-node-python package to implement your own python nodes refer to the package documentation. To start a python client refer to CLI.
CLI
Basic functionality is provided through a command line interface which allows to run a python node which is able to import and load processing modules.
$ ubii-client --help usage: ubii-client [-h] [--processing-modules PROCESSING_MODULES] [--verbose] [--debug] [--log-config LOG_CONFIG] options: -h, --help show this help message and exit --processing-modules PROCESSING_MODULES --no-discover --verbose, -v --debug --log-config LOG_CONFIG
(non obvious) arguments:
--debug Debug mode changes the exception handling, and increases verbosity. In debug mode the Node does not try to handle exceptions, and fails loudly
--log-config optional path to a .yaml file containing a dictionary of logging options consistent with the `logging.config.dictConfig <https://docs.python.org/3/library/logging.config.html#logging.config.dictConfig>`__ format (example config)
--no-discover flag to turn off auto discovery of processing modules via entry points
--processing-modules specify a list of import paths for Ubi Interact Procesing Modules implemented using the ubi-interact-python framework, see processing-modules. Use it together with auto discovery during development or as a fallback
Processing Modules
Below is a list of processing modules that are compatible with the python node. To try them, install them inside the same virtual environment (refer to the documentation of the specific module). If you develop new Processing Modules, use the entry point group ubii.processing_modules to advertise them in your package, so that the ubii-client script (or your own implementation) can discover them. Read the setup.cfg configs of the example modules below and the setuptools documentation for more details.
Example usage after install of module:
$ pip install ubii-processing-module-ocr $ ubii-client > Imported [<class 'ubii.processing_modules.ocr.tesseract_ocr.TesseractOCR_EAST'>, ... ] > ...
or with cli argument to only load specific processing modules (also turning off auto discovery in this example)
$ pip install ubii-processing-module-ocr $ ubii-client --no-discover --processing-modules ubii.processing_modules.ocr.tesseract_ocr.TesseractOCR_EAST > Imported <class 'ubii.processing_modules.ocr.tesseract_ocr.TesseractOCR_EAST'> > ...
0.2.0a1.dev22 (2022-03-25)
Bug Fixes
Fixed bug introduced by changed json backend URL that was not correctly propagated during client runtime
0.1.0 (2022-03-25)
New Features
Auto reconnect when master node shuts down
Bug Fixes
Fixed package name refactoring breaking some imports
Fixed bug introduced by changed json backend URL that was not correctly propagated during client runtime
Fixed additional errors caused by renaming
0.1.0 (2022-03-25)
New Features
Auto reconnect when master node shuts down
Bug Fixes
Fixed package name refactoring breaking some imports
Fixed additional errors caused by renaming
0.2.0.a1.dev13 (2022-02-16)
New Features
Auto reconnect when master node shuts down
Bug Fixes
Fixed package name refactoring breaking some imports
Fixed additional errors caused by renaming
0.2.0.a1.dev3 (2022-02-02)
Documentation
Setting up documentation and Changelog
BSD 3-Clause License
Copyright (c) 2022, Maximilian Schmidt (ga97lul@mytum.de) All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ubii-node-python-0.2.0a1.dev28.tar.gz
.
File metadata
- Download URL: ubii-node-python-0.2.0a1.dev28.tar.gz
- Upload date:
- Size: 235.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff0f0cc177b94fc56f2c7cced7b13920b00cb96da4ebe658daed1711725a9fb1 |
|
MD5 | 12cf2f3e54fcb235919f3d292194c2a0 |
|
BLAKE2b-256 | 1533d6f7510a94289d0a2a9e20e888da816eb68e422efc2962c1168da719212b |
File details
Details for the file ubii_node_python-0.2.0a1.dev28-py3-none-any.whl
.
File metadata
- Download URL: ubii_node_python-0.2.0a1.dev28-py3-none-any.whl
- Upload date:
- Size: 75.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f743fbcd122c5ae1332ac3f882faa097a486309cb3ce4a527f59a26fb0309d4 |
|
MD5 | fed406fb645f0f12b3a760d597664092 |
|
BLAKE2b-256 | 13daad443052e962fee7a9ee30bd269ef294fe98fb41cc208a5d2e2463002b06 |