snakemake-logger-plugin-dart
A Snakemake 9+ logger plugin that streams workflow events — scheduled jobs, progress, the rule DAG, logs and errors — in real time over WebSocket to a desktop application that hosts the server.
The app is the server and this plugin is the client, so there is nothing in
between: no polling, no intermediate service, and the endpoint stays on
loopback. The other half of the integration is the Dart package
snakemake_bridge, which provides
the embedded server, typed event models and a state reducer — but any server
implementing the protocol specification
works just as well. For the design, the security model and the failure modes,
see ARCHITECTURE.md.
Requirements
- Python
>= 3.11 - Snakemake
>= 9.0
Installation
pip install snakemake-logger-plugin-dart
Install it in the same Python environment as Snakemake (same venv/conda). Snakemake discovers plugins through the entry points of the active environment, so a plugin installed next door is simply invisible.
Verify that Snakemake found it:
snakemake --help | grep logger-dart
# --logger-dart-address VALUE
# --logger-dart-token VALUE
# --logger-dart-flush-timeout VALUE
If that prints nothing, run pip show snakemake snakemake-logger-plugin-dart
and check that both report the same Location.
Usage
Point the plugin at the address the app is listening on:
export SNAKEMAKE_LOGGER_DART_TOKEN=<token-generated-by-the-app>
snakemake --cores 4 \
--logger dart \
--logger-dart-address ws://127.0.0.1:8765
Passing the token through the environment rather than --logger-dart-token
keeps it out of ps output, where any local user could read it.
Settings
| Flag | Env var | Default | Description |
|---|---|---|---|
--logger-dart-address |
SNAKEMAKE_LOGGER_DART_ADDRESS |
(required) | ws:// URL of the server embedded in the app. |
--logger-dart-token |
SNAKEMAKE_LOGGER_DART_TOKEN |
— | Bearer token the app requires, sent as Authorization: Bearer. Prefer the env var. |
--logger-dart-flush-timeout |
— | 5.0 |
Seconds to wait on shutdown for pending events to be delivered. |
How it behaves
The guiding rule is that the workflow never pays for the telemetry. A closed app, a dropped connection or a stalled consumer degrade what the app sees, never the run itself.
emit()never blocks Snakemake. Events go onto an in-memory queue (10,000 entries) drained by a dedicated thread; if the queue fills, new events are dropped with a warning rather than applying backpressure to the run.- The worker reconnects on its own with exponential backoff (0.5 s up to 10 s), for as long as the run is active.
- A replay buffer keeps the last 100,000 events. On every (re)connection the
plugin sends
hello, the app answers withreplay, and the gap is refilled — so an app opened halfway through a run still catches up. Events dropped from the send queue remain in this buffer and are recoverable. - Delivery is at-least-once: after a replay some events arrive twice, and
the consumer deduplicates by the envelope's
seq. - On shutdown the queue is flushed (bounded by
flush-timeout) and abyeevent closes the run.
If nothing shows up in the app
In this order:
- the address passed to
--logger-dart-addresscarries the port the app actually printed; - the app and the plugin use exactly the same token — a mismatch is refused
at the handshake with
401, before any event is sent; snakemake --help | grep logger-dartfinds the plugin;- the plugin lives in the same Python environment as the
snakemakeexecutable in use; - the app's server was already listening before the run started (or, if not, that it reconnects — the replay buffer covers a late start).
Development
pip install -e '.[dev]'
pytest
With the package also installed in the environment,
pytestimports the installed copy and local edits are silently ignored. RunPYTHONPATH=src pytestto test the working tree.
Full guide — building the wheel, the Dart tests and end-to-end validation with a real workflow — in INSTALL.md.
Metadata
Release files for snakemake-logger-plugin-dart 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snakemake_logger_plugin_dart-0.1.1.tar.gz | 15.0 kB | Without provenance | Details for snakemake_logger_plugin_dart-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl |
Total release size: 27.3 kB
Release files / snakemake_logger_plugin_dart-0.1.1.tar.gz
| Download URL | snakemake_logger_plugin_dart-0.1.1.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
127bf55dc286d260b5bf8c2e85ffa15ba7fbccdf91695c68120242dc576d0b83
|
|
BLAKE2b-256 checksum How to use checksums |
8a7b7f19596e080a0f6390773610098ccc9b50ef5c313d535f6cefb487d8f340
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl
| Download URL | snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdc438524de7ec6ce4c5ad5746cf086d7809e713acc479b9cdc0a3d912594ac5
|
|
BLAKE2b-256 checksum How to use checksums |
19dc5711f4331a5ff901d43b84521c2df1c7c79a550c07fcff88a4d148365c56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Security for snakemake-logger-plugin-dart 0.1.1
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.