Skip to main content

combycode-dpe (Python)

DPE framework for building streaming pipeline tools in Python.

A DPE tool is an independent program: it reads NDJSON envelopes from stdin, processes each one, and writes NDJSON envelopes to stdout. The runner (dpe) spawns it, pipes data through it, and routes its output to the next stage. The framework handles the loop, the parsing, the queues, and the error/trace plumbing — your code only writes the transform.

Requires Python 3.11+.

Install

pip install combycode-dpe
# or in a per-tool venv:
uv venv --seed .venv && .venv/bin/pip install combycode-dpe

Hello tool

# src/my_tool/main.py
import dpe

def process_input(v, settings, ctx):
    ctx.output(v)  # pass-through

if __name__ == "__main__":
    dpe.run()

Run as a tool: python src/my_tool/main.py '{"...settings JSON..."}'. The runner passes settings as argv[1] and pipes NDJSON through stdin/stdout.

dpe.run() introspects the calling module to find process_input and any process_<queue> handlers — no manual registration needed.

Processor signature

def process_input(v, settings, ctx):
    ...
  • v — envelope payload (a dict / list / scalar — whatever JSON parsed to).
  • settings — argv[1] parsed once at startup.
  • ctx — emits output, errors, logs, metadata; reads/writes shared accumulators in ctx.memory.

Internal queues

import dpe

def process_input(v, settings, ctx):
    ctx.emit("validate", v)

def process_validate(v, settings, ctx):
    if v.get("ok"):
        ctx.output(v)
    else:
        ctx.error(v, "validation failed")

if __name__ == "__main__":
    dpe.run()

ctx.emit(queue, v) enqueues for the named handler. ctx.drain() blocks until every queue is empty.

Context API (essentials)

Call What it does
ctx.output(v, id=None, src=None) Emit {t:"d",...} to stdout. id/src default to inherit.
ctx.emit(queue, v) Push to internal queue, processed by process_<queue>.
ctx.drain() Block until all queues are empty.
ctx.error(v, msg) Write {type:"error",input:v,error:msg,...} to stderr.
ctx.log(level, msg) Structured stderr log.
ctx.meta(v) Emit {t:"m", v} envelope to stdout.
ctx.memory Typed accumulators: Number, Average, MinMax, Set, Map, Buffer, Boolean, BitMask, Trigger.

See docs/frameworks.md in the monorepo for the full reference.

Scaffolding

dpe-dev scaffold --name my-tool --runtime python --out ./my-tool --description "what it does"
cd my-tool
dpe-dev build .   # creates .venv, installs the tool with [dev] extras
dpe-dev test  .   # pytest inside the venv

End-to-end stage testing happens via dpe test <pipeline>:<stage> once the tool is wired into a pipeline — see docs/testing.md.

Optional speed-up

For bulk-hashing payloads, install xxhash and pass algorithm="xxhash" to dpe.hash_file(). The framework falls back to hashlib.blake2b when xxhash is missing.

Repo & licence

Metadata

Release files for combycode-dpe 2.0.4

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

Source distribution (sdist)

Source distribution for combycode-dpe 2.0.4
File Size Uploaded
combycode_dpe-2.0.4.tar.gz 21.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for combycode-dpe 2.0.4
File Interpreter ABI Platform
combycode_dpe-2.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 35.4 kB

Release files / combycode_dpe-2.0.4.tar.gz

Download URL combycode_dpe-2.0.4.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
495bc7d913c4dcf89d857fe08ca8f301b4ad0bbf7bd0c696477d62e1358ada6f
BLAKE2b-256 checksum
How to use checksums
aa6b9d0397c643489c5472d62e476a1f23d84bceac603a0e12a97a8f79e8ff6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2026.

Transparency log

Release files / combycode_dpe-2.0.4-py3-none-any.whl

Download URL combycode_dpe-2.0.4-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af958df762875c56061a83d5572f816b822e1f1e4d2f884de54e9fb46d7cc1b0
BLAKE2b-256 checksum
How to use checksums
6817f3d8e951a49c8458ab97d0403ea6573d29fa7309c57afb2edde1c8ede615
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.4 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

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