Skip to main content

Wirely

Wirely is a node-based language and runtime for low-level home automation. It connects signals from KNX group addresses, MQTT topics, and other device interfaces through nodes that process values and apply logic. For example, it can listen for boolean values on two KNX group addresses and publish first_value AND NOT second_value to a third. Wirely works directly with these signals; it does not model higher-level concepts such as rooms, as Home Assistant does.

See the language documentation for how to write Wirely programs and the changelog for release notes and migration steps.

Installation

Wirely requires Python 3.11 or newer. Install the core package with:

python3 -m pip install wirely

The core install includes the compiler and command-line interface. The installed wirely command and python3 -m wirely provide the same subcommands. For example:

wirely compile program.wrl
python3 -m wirely compile program.wrl

Use wirely compile --dump-program program.wrl to print the compiled runtime program, including its variables, configuration, and procedures. Use wirely compile -o program.wbc program.wrl to write a binary program file. Run it with wirely run program.wbc. Add --timings to print the duration of each compiler stage, including those compiling the standard library (std:). Set WIRELY_COMPILER_CACHE_LARK=1 to keep the parser tables in $XDG_CACHE_HOME/wirely/ (by default ~/.cache/wirely/), which saves about 0.7 s on each start.

Install optional integrations as needed:

python3 -m pip install 'wirely[knx]'           # KNX
python3 -m pip install 'wirely[mqtt]'          # MQTT
python3 -m pip install 'wirely[two-n]'         # 2N devices
python3 -m pip install 'wirely[gpio]'          # GPIO
python3 -m pip install 'wirely[all]'           # all optional integrations
python3 -m pip install 'wirely[editor]'        # graphical editor

wirely run logs the messages of the runtime and its nodes to standard error. Add --verbose to also log node creation, connection setup, and each value sent or received by the KNX, MQTT, 2N, CSV, and Process nodes, and --debug to log each step and procedure run.

wirely edit program.wrl opens a program in a graphical editor with tabs for its source files and diagrams. Edits in either view update the other. Right-click a tab to split the view, move it to another pane, or detach it into a window. You can also drag tabs between panes, onto pane edges to split, or outside the editor to detach. Closing a detached window returns its tabs to the main window. Layouts last for the current session. The node palette, diagram tooltips, and properties panel show the first paragraph of doc comments. A diagram is read-only while its source has syntax errors. In a diagram:

  • Drag a node to store its position in the source; right-click it and choose Reset to Automatic Position to remove it again. Use View → Snap to Grid to toggle snapping for all diagrams. A selected group snaps its movement while keeping its relative positions.
  • Drag from a port to another port to connect them. Drag a connection away from an input to move or remove it.
  • Press Delete to remove the selection and F2 to rename it.
  • Right-click the background to add nodes and declarations.
  • Double-click a node to open the diagram of its node type.
  • Press Ctrl+E to show the source of the selection, and Ctrl+Shift+E in the source to show the element at the cursor in its diagram.

wirely export-image program.wrl -o diagram.pdf draws the program diagram as the editor shows it, as a PDF or PNG file. Use --scope Name for the diagram of a node type and --scale for the PNG resolution. Diagrams use the DejaVu Sans font, or a fallback font if it is not installed. See diagram layout for how layouts are stored.

wirely interface program.wrl prints the public interface of the declarations in the files, with their doc comments: node types with their parameters, ports, and requirements, but without their bodies. Without files, it prints the bundled libraries. Use --scope Name for one declaration, --show-internal to include declarations marked #[Internal], and --no-doc to leave out doc comments.

wirely doc program.wrl -o reference.md writes a Markdown reference of the same declarations, with a section per namespace and a heading per declaration. It takes the same --scope and --show-internal options; --header FILE replaces the default title with the contents of a Markdown file.

The test extra adds dependencies used only by the test suite. Install wirely[all,test] to include both integrations and test dependencies.

Development checkout

Prepare the development environment and generated modules, then use the checkout launchers:

tools/setup-dev
tools/wirely compile tests/compiler/simple.wrl
tools/run-tests

The launchers use venv/bin/python when available. Otherwise, they warn and use the current Python interpreter. tools/wirely accepts the same arguments as wirely and runs the source in this checkout from any working directory. The test suite also requires knxd and mosquitto.

Run tools/generate after changing the grammar, native declarations, compiler code, the standard library, or their generators. tools/generate-parser, tools/generate-native-types, tools/generate-library-key, and tools/generate-standard-library rebuild just their respective outputs. tools/generate --check reports out-of-date outputs without writing them. Editable installations also generate these modules. Wheel builds generate them separately; source archives include the generation inputs.

The compiler uses its generated standalone parser by default. Set WIRELY_COMPILER_PARSER=lark before starting Wirely to build the parser from the grammar instead. This mode requires Lark, included in wirely[dev] and the checkout environment. WIRELY_COMPILER_CACHE_LARK=1 enables its disk cache. WIRELY_COMPILER_PARSER=standalone selects the default explicitly.

The compiler also loads a compiled standard library generated by tools/generate. Set WIRELY_COMPILER_STD=sources to compile the standard library from wirely/lib/ instead, for example while changing it without regenerating.

Wirely's handwritten sources are MIT-licensed. Distributions containing the generated parser also include Lark's MPL-2.0-covered runtime; see NOTICE.

Pass test names to run a selection, and add --timings to list durations slowest first:

tools/run-tests --timings unit/types wrl/equality

Add --processes 4 to run the tests in four worker processes; see the test guide for the options.

To check that compilation does not depend on declaration order, set WIRELY_COMPILER_SHUFFLE_SEED to an integer. The compiler then shuffles declarations, node parameters, procedure reads and writes, and open enum members with that seed; connections keep their relative order. Also set WIRELY_COMPILER_SHUFFLE_LAYOUT=1 to shuffle fields of structs and members of closed enums that are not native, which changes the runtime representation. Negative tests may report different diagnostics in this mode.

WIRELY_COMPILER_SHUFFLE_SEED=1 tools/run-tests

Test dependency and Python versions in temporary environments:

tools/run-tests-dependencies --versions min --python min
tools/run-tests-dependencies --versions max --python max
tools/run-tests-dependencies --versions all-min --python 3.11

--versions defaults to min: minimum direct dependencies, with latest compatible transitive dependencies. all-min also minimizes transitive dependencies; max selects the newest compatible dependency set.

--python accepts a uv version request or an executable name/path and defaults to the interpreter running the script. min selects the latest compatible patch of the oldest supported CPython minor; max selects the newest compatible stable CPython available through the installed uv. uv can download missing interpreters. tools/run-tests --python PATH runs tests using a specified Python executable.

Test names, --timings, and --keep-going work as for tools/run-tests:

tools/run-tests-dependencies --versions min --python min misc/type_check

Metadata

Release files for wirely 0.1.6

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

Source distribution (sdist)

Source distribution for wirely 0.1.6
File Size Uploaded Provenance Actions
wirely-0.1.6.tar.gz 1.0 MB Without provenance Details for wirely-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wirely 0.1.6
File Interpreter ABI Platform Actions
wirely-0.1.6-py3-none-any.whl Python 3 none any Details for wirely-0.1.6-py3-none-any.whl

Total release size: 2.0 MB

Release files / wirely-0.1.6.tar.gz

Download URL wirely-0.1.6.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
537e8dfdd2dcc4d7a28a9301bb056347a38889f7f5e5be63164d24f0cba22e01
BLAKE2b-256 checksum
How to use checksums
735e3a745d25fdb9ee72e75340f1dc27c634340b4b6f3aa216405e0d55143807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / wirely-0.1.6-py3-none-any.whl

Download URL wirely-0.1.6-py3-none-any.whl
Size 969.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d50bffbcd98cb20fd6021d4e94399ce6a797322d1d2a3b9b7f93e2b90fa5351a
BLAKE2b-256 checksum
How to use checksums
c2625d5f6707c11c1429ac72ca66aadae2892b454f2bae2c237f7eccd65f52b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for wirely 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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