Package: ubii-node-python
Ubi Interact Python NodeThis project implements theUbi-InteractProtocol
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 ofprocessing-modulesin Python.InstallationPython VersionTheUbi-Interact-Python-Nodeshould be compatible with all python
versions>= 3.7. If you experience bugs feel free to report them.Windows:TheUbi-Interact-Python-Nodeaims to be cross-platform, working with
most interesting computational packages is easier under Linux
nonetheless. Installation viapipis 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 wrapperpy.exe(detailed instructions
in thePython
Documentation) to
choose the python version of your environment.If you plan to use a virtual environment - which is recommended -
typically anUnrestrictedexecution policy is needed to run the
activation script for the python environment. The following
instructions assume you are usingPowershell, and have the rightExecutionPolicyset.Python version 3.7 or greaterVirtual Environment (recommended) with pip installed
(py-mvenv envfollowed by./env/Scripts/activate.ps1)Continue atPyPiLinux (and MacOS)If you are not using Windows, you probably have a working python
installation. Sometimes the different versions have aliases such aspython3, 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 greaterVirtual Environment (recommended) with pip installed
(e.g.``python3 -m venv env`` followed bysource ./env/bin/activate)Continue atPyPiPyPiAfter activating the environment, install the package from pypi. The
package supplies differentextras, to install additional
dependencies for optional features. You can make sure everything is
working correctly by calling theubii-clientscript which gets
installed as part of thecliextra.$ python -m pip install ubii-node-python[cli]
$ ubii-client --helpEditable / Local InstallInstead 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 --helpExtrasThis packages usesextras.[test]Requirements to runpytestsuite if you install the
package from source, and not from PyPiCurrently 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 aCLIscript which runs the node and
auto-discovers installed Processing Modules (seebelow)[docs]Install requirements to build documentationUsageTo use theubii-node-pythonpackage to implement your own python
nodes refer to thepackage
documentation. To start a python client
refer toCLI.CLIBasic 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:--debugDebug mode changes the exception handling, and increases
verbosity. In debug mode the Node does not try to handle exceptions,
and fails loudly--log-configoptional path to a.yamlfile 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-discoverflag to turn off auto discovery of processing
modules via entry points--processing-modulesspecify a list of import paths forUbi
Interact Procesing Modulesimplemented using theubi-interact-pythonframework, seeprocessing-modules. Use it together withauto discoveryduring development or as a
fallbackProcessing ModulesBelow 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 groupubii.processing_modulesto advertise them in your package, so that theubii-clientscript (or your own implementation) can discover them.
Read thesetup.cfgconfigs of the example modules below and thesetuptools
documentationfor more details.ubii-ocr-moduleExample 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.dev29 (2022-04-01)DocumentationUpdated documentation ofcodestare.async_utilsmodule0.2.0a1.dev22 (2022-03-25)Bug FixesFixed bug introduced by changed json backend URL that was not correctly propagated during client runtime0.1.0 (2022-03-25)New FeaturesAuto reconnect when master node shuts downBug FixesFixed package name refactoring breaking some importsFixed bug introduced by changed json backend URL that was not correctly propagated during client runtimeFixed additional errors caused by renaming0.1.0 (2022-03-25)New FeaturesAuto reconnect when master node shuts downBug FixesFixed package name refactoring breaking some importsFixed additional errors caused by renaming0.2.0.a1.dev13 (2022-02-16)New FeaturesAuto reconnect when master node shuts downBug FixesFixed package name refactoring breaking some importsFixed additional errors caused by renaming0.2.0.a1.dev3 (2022-02-02)DocumentationSetting up documentation and ChangelogBSD 3-Clause LicenseCopyright (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.