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.2.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.2.0
File Size Uploaded
howdenpipeline-4.2.0.tar.gz 24.4 kB Details

Built distribution (wheel)

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

Total release size: 46.4 kB

Release files / howdenpipeline-4.2.0.tar.gz

Download URL howdenpipeline-4.2.0.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
037c77bd0b98dca30a187cfe720bd2d352630ca98e6e23ef5bb6b742d5a1e590
BLAKE2b-256 checksum
How to use checksums
22a3dc214c36b18ee871696262b67207d2268eb82a02c2f6fd4e9130e2e4d70f
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.2.0-py3-none-any.whl

Download URL howdenpipeline-4.2.0-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f00c57f52995be442ef4304a80ef62b11d889d07b7f34462d5619edb04e20e59
BLAKE2b-256 checksum
How to use checksums
5f03cdb8fedd60bc9603b55d18c889c7c218b7749dbb48b8fc088629653f3942
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

This release

4.2.0 This release

2 release files

4.1.0

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