Kwdagger
Read the Docs |
|
Gitlab (main) |
|
Github (mirror) |
|
Pypi |
Overview
KWDagger turns parameterized definitions of existing command-line programs into static, inspectable graphs of shell commands and hashed result directories. It builds on cmd_queue and kwconf to provide:
Reusable kwdagger.pipeline.Pipeline and kwdagger.pipeline.ProcessNode abstractions for constructing commands and wiring produced artifacts.
Parameter-matrix expansion with operational deduplication of equivalent requested work.
Per-process invoke.sh files and a navigable .pred / .succ symlink graph, so generated work can be inspected, rerun, or invalidated without remaining inside the kwdagger runtime.
A scheduling CLI (kwdagger.schedule) that hands the static command graph to serial, tmux, or Slurm cmd_queue backends. The tmux backend is the most commonly used interactive runner.
An optional aggregation CLI (kwdagger.aggregate) that loads completed results, requested and resolved parameters, and metrics into analytical tables and reports.
A self-contained demo pipeline in kwdagger.demo.demodata that is used in CI and serves as a reference implementation.
examples/yaml_introspection_example.py is a single-file modal CLI with three tiny pipeline stages, an introspect command that queries their declarative and compiled graphs, and a run command that executes the same YAML pipeline locally with the serial backend.
Kwdagger wraps ordinary scripts rather than replacing them. A node may use the default named-argument command convention or subclass ProcessNode to support an existing positional or otherwise specialized CLI.
Repository layout
kwdagger/pipeline/ – core pipeline and process node definitions, networkx graph construction, and configuration utilities. Import from kwdagger.pipeline; the submodules inside it are private.
kwdagger/schedule.py – ScheduleEvaluationConfig CLI for expanding parameter grids into runnable jobs and dispatching them through cmd_queue backends.
kwdagger/aggregate.py – AggregateEvaluationConfig CLI for loading job outputs, computing parameter hash IDs, and generating text/plot reports.
kwdagger/demo/demodata.py – end-to-end demo pipeline with prediction and evaluation stages plus CLI entry points for each node.
docs/ – Sphinx sources, including an example user module under docs/source/manual/tutorials/twostage_pipeline.
tests/ – unit and functional coverage for pipeline wiring, scheduler behavior, aggregation, and import sanity checks.
Quickstart
Run the demo pipeline locally to see the CLI workflow end-to-end:
TMP_DPATH=$(mktemp -d --suffix "-kwdagger-demo")
cd "$TMP_DPATH"
echo "demo" > input.txt
EVAL_DPATH=$PWD/pipeline_output
python -m kwdagger.schedule \
--params="
pipeline: 'kwdagger.demo.demodata.my_demo_pipeline()'
matrix:
stage1_predict.src_fpath:
- input.txt
stage1_predict.param1:
- 123
stage1_evaluate.workers: 2
" \
--root_dpath="${EVAL_DPATH}" \
--backend=serial --skip_existing=1 --run=1
python -m kwdagger.aggregate \
--pipeline='kwdagger.demo.demodata.my_demo_pipeline()' \
--target "
- $EVAL_DPATH
" \
--output_dpath="$EVAL_DPATH/full_aggregate" \
--eval_nodes="
- stage1_evaluate
" \
--stdout_report="
top_k: 10
concise: 1
"
The scheduler generates per-node job directories with invoke.sh and job_config.json metadata. Each invoke.sh is intended to be a usable recomputation command even when kwdagger is not involved in the rerun. The aggregator is then one optional way to consolidate results and print a report.
The hashed result tree contains a graph-based symlink structure for navigating produced-artifact dependencies. The .succ folder links to results that depend on the current result, and .pred links to results consumed by the current process. This makes downstream inspection and invalidation possible after the original scheduling command has finished.
For more in-depth information see tutorials:
Command line entry points
python -m kwdagger.schedule or kwdagger schedule – build and run a pipeline over a parameter matrix (see kwdagger.schedule.ScheduleEvaluationConfig).
python -m kwdagger.aggregate or kwdagger aggregate – load completed runs and generate tabular and plotted summaries (kwdagger.aggregate.AggregateEvaluationConfig).
python -m kwdagger – modal CLI that exposes the schedule and aggregate commands via kwdagger.__main__.KWDaggerModal.
Metadata
Release files for kwdagger 0.4.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 |
|---|---|---|---|---|
| kwdagger-0.4.1.tar.gz | 296.5 kB | Without provenance | Details for kwdagger-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kwdagger-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for kwdagger-0.4.1-py3-none-any.whl |
Total release size: 511.9 kB
Release files / kwdagger-0.4.1.tar.gz
| Download URL | kwdagger-0.4.1.tar.gz |
|---|---|
| Size | 296.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4611d338b091fc6f759edded4e564c036a9f03ab1e88d7f67e34e6693c61c3b9
|
|
BLAKE2b-256 checksum How to use checksums |
7d8d28c764753af350cdf9ca3f5f3e8561d418ea6940116ec54be50f7887e6ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / kwdagger-0.4.1-py3-none-any.whl
| Download URL | kwdagger-0.4.1-py3-none-any.whl |
|---|---|
| Size | 215.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
935441b619de80ec26e3c454dd3f4a710703350347ec5269d2bb2a106d8d3a52
|
|
BLAKE2b-256 checksum How to use checksums |
003f89dfcbdc239e32885012bac5e48bed8a7e27eea5ce9e7dda61f7d4296631
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Security for kwdagger 0.4.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.