{ "info": { "author": "Ghislain Picard", "author_email": "ghislain.picard@univ-grenoble-alpes.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=========\npynodered\n=========\n\n\n.. image:: https://img.shields.io/pypi/v/pynodered.svg\n :target: https://pypi.python.org/pypi/pynodered\n\n.. image:: https://img.shields.io/travis/ghislainp/pynodered.svg\n :target: https://travis-ci.org/ghislainp/pynodered\n\n.. image:: https://readthedocs.org/projects/pynodered/badge/?version=latest\n :target: https://pynodered.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\nAbout\n--------\n\nMake your python functions available in Node-RED using a simple decorator.\n\npynodered is a server communicating with Node-RED to make available your python functions as blocks in Node-RED. pynodered reads modules and python files containing functions decorated with 'node_red', register them as blocks in Node-RED. pynodred then handles communications between Node-RED (in javascript) to run your function whenever the block receives a message.\n\nQuick Start\n------------\n\nRequires python>=3.5\n\n.. code-block:: console\n\n $ pip install pynodered\n\nExamples\n------------\n\nA simple example to lowercase the payload of the messages:\n\n.. code-block:: python\n\n from pynodered import node_red\n\n\n @node_red(category=\"pyfuncs\")\n def lower_case(node, msg):\n\n msg['payload'] = str(msg['payload']).lower()\n return msg\n\nPut this snippet is in a file \"example.py\", run the pynodered server with:\n\n.. code-block:: console\n\n $ pynodered example.py\n\nand in another console:\n\n.. code-block:: console\n\n $ node-red\n\nIn Node-RED, you now have a new category \"pyfuncs\" with a function lower_case. It can be used in a flow as any other blocks:\n\n.. image:: images/lower-case-flow.png\n\n\nIt is possible to add block properties (constant arguments provided by the user in Node-RED) by defining a property in the decorator:\n\n.. code-block:: python\n\n from pynodered import node_red, NodeProperty\n\n @node_red(category=\"pyfuncs\",\n properties=dict(number=NodeProperty(\"Number\", value=\"1\")))\n\n def repeat(node, msg):\n\n msg['payload'] = msg['payload'] * int(node.number.value)\n return msg\n\nDon't forget to restart the pynodered server everytime your python files change. Node-RED also needs to be restarted but only when the function name or properties change or a new function is added. Refreshing the browser is then necessary.\n\nBy default pynodered exports the functions in the Node-RED package 'pynodered' and the category 'default'. The category name can be changed with the decorator optional argument. For the package name and information, the python module containing the functions can declare a 'package' dictonary like this:\n\n.. code-block:: python\n\n package = {\n \"name\" : \"FFT filters\",\n \"version\" : \"0.01\",\n \"description\" : \"Nodes written in Python for signal processing\",\n }\n\n\nLicense\n----------\n\nCopyright (C) 2019 Ghislain Picard\n\nFree software: GNU General Public License v3\n\n\nThis package is a rewrite and extension of the code intially written by Toma\u017e \u0160olc for sigfox-toolbox\nhttps://github.com/sensorlab/sigfox-toolbox/tree/master/node-red-python.\nCopyright (2017) SensorLab, Jo\u017eef Stefan Institute http://sensorlab.ijs.si and licensed under GPL version 3\n\n\n\n\n=======\nHistory\n=======\n\n0.1.0 (2019-01-08)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ghislainp/pynodered", "keywords": "pynodered", "license": "GNU General Public License v3", "maintainer": "", "maintainer_email": "", "name": "pynodered", "package_url": "https://pypi.org/project/pynodered/", "platform": "", "project_url": "https://pypi.org/project/pynodered/", "project_urls": { "Homepage": "https://github.com/ghislainp/pynodered" }, "release_url": "https://pypi.org/project/pynodered/0.1.0/", "requires_dist": [ "flask", "json-rpc" ], "requires_python": "", "summary": "make python function easily accessible from Node-RED", "version": "0.1.0" }, "last_serial": 4713853, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4dfc84622cd2d91ab8addc639033ab23", "sha256": "077d63edeea16d1f291e3218e4a9b6ef668ba8f7569e8feaa72b5e02d7371ee5" }, "downloads": -1, "filename": "pynodered-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4dfc84622cd2d91ab8addc639033ab23", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13641, "upload_time": "2019-01-18T22:00:12", "url": "https://files.pythonhosted.org/packages/1a/e6/3d6c765d3c6698b0b8bcaee59c0867112424350f3f608968eeaedb4cde48/pynodered-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74c27dda871c66327d71a5154d393fde", "sha256": "a5fd9cc46c4760578bd696335c08466f7596e4ebf0b238cc64e7869e5fef6802" }, "downloads": -1, "filename": "pynodered-0.1.0.tar.gz", "has_sig": false, "md5_digest": "74c27dda871c66327d71a5154d393fde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16196, "upload_time": "2019-01-18T22:00:14", "url": "https://files.pythonhosted.org/packages/85/f6/1af9af4fed7452920b91f12a9215e6d0f044e3d5d14e17d2d9f23283ee5a/pynodered-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4dfc84622cd2d91ab8addc639033ab23", "sha256": "077d63edeea16d1f291e3218e4a9b6ef668ba8f7569e8feaa72b5e02d7371ee5" }, "downloads": -1, "filename": "pynodered-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4dfc84622cd2d91ab8addc639033ab23", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13641, "upload_time": "2019-01-18T22:00:12", "url": "https://files.pythonhosted.org/packages/1a/e6/3d6c765d3c6698b0b8bcaee59c0867112424350f3f608968eeaedb4cde48/pynodered-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74c27dda871c66327d71a5154d393fde", "sha256": "a5fd9cc46c4760578bd696335c08466f7596e4ebf0b238cc64e7869e5fef6802" }, "downloads": -1, "filename": "pynodered-0.1.0.tar.gz", "has_sig": false, "md5_digest": "74c27dda871c66327d71a5154d393fde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16196, "upload_time": "2019-01-18T22:00:14", "url": "https://files.pythonhosted.org/packages/85/f6/1af9af4fed7452920b91f12a9215e6d0f044e3d5d14e17d2d9f23283ee5a/pynodered-0.1.0.tar.gz" } ] }