Skip to main content

HowdenPipeline

A DAG-based async pipeline for processing PDF documents through configurable steps (parsing, LLM extraction, etc.) with built-in MLflow observability.

Overview

HowdenPipeline orchestrates multi-step document processing pipelines as directed acyclic graphs (DAGs). Each PDF is processed concurrently, with steps executing in topological order per file. Results are cached on disk, so unchanged steps are skipped on re-runs.

PDF files
   │
   ├── [Parser] ──► result.md
   │       │
   │       ├── [LLM: payment_date] ──► result.json
   │       └── [LLM: payment_info] ──► result.json
   │
   └── ... (all files processed concurrently)

Requirements

  • Python >= 3.12, < 3.14
  • uv (recommended)

Installation

uv sync

Usage

import asyncio
from pathlib import Path
from HowdenPipeline.flow.graph_pipeline import GraphPipeline
from HowdenPipeline.manager.tracker import Tracker

async def main():
    pipeline = GraphPipeline(
        pdf=Path("data/pdfs"),   # directory of subfolders, each containing one PDF
        delete_folder=True,       # clean step output folders before each run
        tracker=tracker,          # optional MLflow tracker
        parameter=parameter       # HowdenConfig parameter object
    )

    pipeline.add_step(parser, output_filetype="md")
    pipeline.add_step(payment_date, dependencies=[parser], output_filetype="json", track=True)
    pipeline.add_step(payment_info, dependencies=[parser], output_filetype="json", track=True)

    matches = await pipeline.execute()

asyncio.run(main())

add_step parameters

Parameter Type Description
step Any Callable step (sync or async). Receives input path, returns string result.
dependencies list Steps that must complete before this one.
output_filetype str File extension for cached result ("md", "json", etc.).
track bool If True, logs the result artifact to MLflow.
name str Override the display name for this step.
input_result Any Pass a specific result from an earlier step as secondary input.

Input folder structure

Each subfolder under the pdf root should contain one PDF and optionally a GT.json for accuracy evaluation:

data/pdfs/
├── claim_001/
│   ├── document.pdf
│   └── GT.json          # optional ground truth
├── claim_002/
│   └── document.pdf

Step output caching

Step results are written to disk alongside the input PDF. If a result file already exists, the step is skipped. To force re-execution, set delete_folder=True or delete the output folders manually.

data/pdfs/claim_001/
├── document.pdf
├── Parser/
│   ├── result.md
│   └── parameter.json
└── Parser/payment_info/
    ├── result.json
    └── parameter.json

MLflow Observability

When a Tracker is provided, the pipeline logs:

  • All pipeline parameters
  • Per-step timing (avg, min, max, total)
  • Step result artifacts
  • LLM token usage and model metadata
  • Accuracy against ground truth JSON files
  • Prompt templates with accuracy annotations

Start the MLflow UI:

mlflow ui --backend-store-uri sqlite:///mlflow.db --port 5000

To disable tracking, pass tracker=None (default).

Running Tests

uv run pytest
uv run pytest -v        # verbose
uv run pytest tests/test_async_script.py::test_files_run_concurrently  # single test

Project Structure

HowdenPipeline/
├── flow/
│   ├── graph_pipeline.py        # Main orchestrator — GraphPipeline class
│   ├── file_pipeline_runner.py  # Single-file execution with step traversal
│   ├── pipeline_graph_manager.py # DAG management with NetworkX
│   ├── match.py                 # Result dataclass (path, ground truth, file path)
│   └── parameter_serializer.py  # Serialization for step parameter logging
└── manager/
    ├── tracker.py               # MLflow / LangSmith logging abstraction
    └── jsonMatcher.py           # Accuracy comparison against ground truth
tests/
├── test_async_script.py         # Async concurrency tests
└── file_pipeline_runner_tests.py

Architecture Notes

  • Concurrency: All PDFs are processed in parallel via asyncio.gather. Steps within a single file are sequential (topological order).
  • Steps: Any callable — sync or async — that accepts a Path input and returns a str. The runner detects asyncio.iscoroutinefunction and awaits accordingly.
  • Graph copy: Each file gets its own copy of the DAG so step state (result paths on edges) does not bleed between files.
  • Git guard: When MLflow tracking is enabled, the pipeline will warn if there are uncommitted changes — ensuring experiment runs are tied to a clean git state.

Release files for HowdenPipeline 4.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 HowdenPipeline 4.1.0
File Size Uploaded
howdenpipeline-4.1.0.tar.gz 23.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for HowdenPipeline 4.1.0
File Interpreter ABI Platform
howdenpipeline-4.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.1 kB

Release files / howdenpipeline-4.1.0.tar.gz

Download URL howdenpipeline-4.1.0.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
afdf1d2a8198437f8bf18805375c3885b91d30892fc0e72241d4b6daa34092d8
BLAKE2b-256 checksum
How to use checksums
54a258d5cded05dd791b6daa9d1eeff0ac47838227786999fdb9f94edea1ea42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / howdenpipeline-4.1.0-py3-none-any.whl

Download URL howdenpipeline-4.1.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d0a8292c150e70c3dae5f5c41cc1d110937ccbaedaf9440aa24f9d66bc718a3
BLAKE2b-256 checksum
How to use checksums
2fc95894dcd0b83dc9aabdfa6c04d19d30fde094b60bf740f1cb6621528f9491
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":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

4.2.0

2 release files

This release

4.1.0 This release

2 release files

4.0.4

2 release files

4.0.3

2 release files

4.0.2

2 release files

4.0.0

2 release files

3.8.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.7.6

2 release files

2.7.5

2 release files

2.7.4

2 release files

2.7.3

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.0

2 release files

0.0.3

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