arnauorriols / node-red-contrib-python-function

Write Python functions in Node-RED!
MIT License
41 stars 23 forks source link

Python Function NodeRED Node

Node-RED is a wonderful tool, but Javascript can be a rather painful language to write. Being able to write functions with the language of your choice, and not just Javascript, might just be the last piece of functionality missing to make Node-RED perfect. Or not. In any case, this quick hacked node will let you write functions using Python instead of Javascript! How cool is that? Too cool to be used in production, that is for sure.

I repeat, don't use this in production. And when you do (cause you will), please tell your manager I already told you so.

Install

Requires Python (both 2.x and 3.x are supported) installed in the system.

npm install -g node-red-contrib-python-function

Usage

Just like the plain-old function node, but writting Python instead of Javascript. The msg is a dictionary, (almost) all the Node-RED helper functions are avaiable, and its behaviour is expected to be exactly the same (at some point in the future at least).

Caveats