Skip to main content

pyflowred-node-lowercase

A node package for PyFlowRED, kept deliberately small: it adds one node type, lower-case, which lowercases msg.payload and passes the message on.

It exists to be read. It is the smallest thing that is still a complete node package — a Python file, an edit dialog, and the entry point that makes a distribution a node package — so it can be copied as the starting point for a real one.

Installing it

From the editor: Menu → Manage palette → Install, and search for pyflowred-node-lowercase. Or over the admin API, which is the same path:

curl -X POST localhost:1880/nodes -H 'content-type: application/json' \
     -d '{"module": "pyflowred-node-lowercase"}'

The node appears in the palette under function straight away. PyFlowRED installs it into the environment it keeps beside the flows and writes it down in <userDir>/externalModules/requirements.txt, so a replacement instance installs the same palette rather than coming up without it.

What is in it

src/pyflowred_node_lowercase/
  __init__.py       nothing to declare: the directory is scanned
  lowercase.py      the node
  lowercase.html    the edit dialog, the help text and the palette label

The node itself:

def register(RED):
    class LowerCaseNode(RED.Node):
        def __init__(self, config: dict[str, Any]):
            super().__init__(config)
            self.on("input", self._on_input)

        def _on_input(self, msg, send, done) -> None:
            payload = msg.get("payload")
            if isinstance(payload, str):
                msg["payload"] = payload.lower()
            send(msg)
            done()

    RED.nodes.register_type("lower-case", LowerCaseNode)

A payload that is not a string is passed through untouched rather than coerced: a node that quietly turns a number into "42" is harder to debug than one that leaves it alone.

And what makes the distribution a node package at all:

[project.entry-points."pyflowred.nodes"]
pyflowred-node-lowercase = "pyflowred_node_lowercase"

The entry point name is the module name shown in the palette; the value is an importable package whose directory is scanned for .py/.html pairs.

Writing your own

Everything above is the whole of it: a register(RED) function that declares a class and registers a type, an .html beside it carrying the edit dialog, the help text and the palette label, and the entry point. Copy this package, rename it, and replace the body.

Beyond that - config nodes, HTTP endpoints, icons, translations, shipping example flows, and testing a node - the reference is docs/writing-nodes.md in the PyFlowRED source distribution. See pyflowred on PyPI.

Metadata

Release files for pyflowred-node-lowercase 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyflowred-node-lowercase 0.1.0
File Size Uploaded
pyflowred_node_lowercase-0.1.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyflowred-node-lowercase 0.1.0
File Interpreter ABI Platform
pyflowred_node_lowercase-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / pyflowred_node_lowercase-0.1.0.tar.gz

Download URL pyflowred_node_lowercase-0.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7d4ff933b82ca2bbd877fcb48a81092fdd794dd6a0ab7a8c0df42d19ffd41f21
BLAKE2b-256 checksum
How to use checksums
d4d84e32150d4d78e0528515d8d15da5af8768b19b8ff511885dd2af8b9f7f06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pyflowred_node_lowercase-0.1.0-py3-none-any.whl

Download URL pyflowred_node_lowercase-0.1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c035d8058359f19fa502dc74f794ff71fe3a3329d5f8c3a867589ec5dcd3d7e5
BLAKE2b-256 checksum
How to use checksums
b78d2f3b1bfc7625c96eb58b81bf774f57bc2e145d8609ad28e10fd70ed83cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page