PDF Report Pipeline
Turn a raw PDF export into a validated, formatted summary report.
Inputs
- A source PDF file path.
- An optional
strictflag that, when set, rejects rows with missing fields instead of dropping them.
Outputs
report.md: the rendered summary report.report.json: the same data as structured JSON for downstream tooling.
Workflow
- Run
scripts/extract.pyon the source PDF to pull out raw table rows. - If
scripts/extract.pyfails or returns zero rows, retry up to 3 times before giving up. - Validate the extracted rows against
references/schema.json. If a row is missing a required field, drop it, unless thestrictflag is set, in which case abort with an error. - Depending on the row count from step 1, choose a report template: use
references/short-template.mdwhen there are fewer than 10 rows, otherwise usereferences/long-template.md. - Render the report with
scripts/render.py, using the template chosen in step 4 and the validated rows from step 3. - Loop back to step 3 if
scripts/render.pyreports a formatting error, until the report renders cleanly or 3 attempts are exhausted. - Write
report.mdandreport.jsonto the output directory.
Failure Handling
If extraction repeatedly fails after all retries, stop the pipeline and report which step failed and why, instead of producing a partial report.