How giriharan007/spotcheck--xylem works
Purpose and Entry Point
This is a file-oriented Python quality-inspection pipeline for comparing an English source PDF against localized PDF versions. The likely orchestration entry point is main.py; specialized standalone stages are exposed through FirstPage.py, Toc.py, LastPage.py, Barcode_QR_Check.py, crop_pdf_images.py, and Compare_cropped_images.py.
Input Contract
The system consumes paired PDF manuals from a source-language baseline and translation set:
• Input/English/894387_5.0_en-US_2026-04_IOM.Start350.pdf
• Input/Translated/882539_5.0_da-DK_2026-04_IOM.Start350.pdf
• Input/Translated/882543_5.0_de-DE_2026-04_IOM.Start350.pdf
A second, self-contained comparison fixture exists under Input/set1/, with English and Swedish PDFs plus result artifacts. File names encode document identity, version, locale, and date; this naming appears to be the principal pairing boundary.
Document-Structure Inspection Stages
Separate scripts imply checks for high-value manual regions:
• First-page inspection: FirstPage.py
• Table-of-contents inspection: Toc.py
• Last-page inspection: LastPage.py
• Barcode/QR validation: Barcode_QR_Check.py
These checks likely evaluate localized documents independently or relative to the English source. Their separation makes them natural pipeline nodes with PDF input and report-row/output evidence as boundaries.
Visual Comparison Pipeline
crop_pdf_images.py converts or extracts page-level regions from source PDFs, producing English crops under Output/Cropped_Images/894387_5.0_en-US_2026-04_IOM.Start350/ and per-language comparison evidence under Output/Cropped_Comparison/.
Compare_cropped_images.py consumes aligned source/translation crops and writes page-specific visual comparison outputs. Existing directories for Danish, German, Greek, Spanish, Finnish, French, Italian, Dutch, Norwegian, Portuguese, and Swedish show that the pipeline fans out once per translated PDF, then aggregates findings.
Table Extraction and Comparison
Tables are a distinct processing path:
• Extraction: Tables/Table_extraction.py
• Comparison: Tables/Compare_Tables.py
• Structured outputs: Input/set1/output/Result/table_comparison.json, Input/set1/output/Result/table_comparison.xlsx
The boundary is extracted table representation rather than rendered pages. Debug/result material is also organized by language pair in Output/Table images/Table comparison debug. English and DK/ and Output/Table images/Table comparison debug. English and GE/, supporting both machine-readable comparison results and reviewer-facing visual evidence.
Reporting and Persistence
The pipeline is local and filesystem-backed: PDFs are inputs, generated crops/debug assets are intermediate evidence, and spreadsheets/JSON/CSV are final or reviewable outputs. The consolidated deliverable is Output/PDF_Quality_Inspection_Report.xlsx; table comparisons additionally emit CSV/JSON/XLSX.
No deployed service, database, queue, web runtime, or external API integration is represented in the repository tree. Execution therefore depends on a Python runtime plus locally available PDF/image/table-processing dependencies, with Input/ and Output/ serving as the operational interface.
Main entry points: 882539_5.0_da-DK_2026-04_IOM.Start350.pdf Localized PDFs · main.py Pipeline orchestrator · PDF_Quality_Inspection_Report.xlsx Quality inspection report · Table_extraction.py Table extraction
Components 18
Input PDFs
- English baseline PDFs · Source manuals provide the comparison baseline.
Input/English/894387_5.0_en-US_2026-04_IOM.Start350.pdf - Localized PDFs · Filename locale and version define pairing with the baseline.
Input/Translated/882539_5.0_da-DK_2026-04_IOM.Start350.pdf - English–Swedish fixture
Structure checks
- First-page check
FirstPage.py - TOC check
Toc.py - Last-page check
LastPage.py - Barcode / QR check
Barcode_QR_Check.py
Visual comparison
- PDF crop extraction · Creates page-level regions for aligned comparison.
crop_pdf_images.py - English image crops
- Crop image comparison · Fans out for each localized manual.
Compare_cropped_images.py - Localized crop evidence
Table comparison
- Table extraction · Builds structured table representations from PDFs.
Tables/Table_extraction.py - Table comparison
Tables/Compare_Tables.py
Review outputs
- Table comparison JSON
Input/set1/output/Result/table_comparison.json - Table comparison workbook
Input/set1/output/Result/table_comparison.xlsx - Table visual debug
- Quality inspection report · Final filesystem-backed inspection deliverable.
Output/PDF_Quality_Inspection_Report.xlsx
Other components
- Pipeline orchestrator · Coordinates local PDF inspection stages.
main.py
Connections 31
- Pipeline orchestrator → First-page check: runs
- Pipeline orchestrator → TOC check: runs
- Pipeline orchestrator → Last-page check: runs
- Pipeline orchestrator → Barcode / QR check: runs
- Pipeline orchestrator → PDF crop extraction: runs
- Pipeline orchestrator → Table extraction: runs
- English baseline PDFs → First-page check: baseline
- Localized PDFs → First-page check: localized manual
- English baseline PDFs → TOC check: baseline
- Localized PDFs → TOC check: localized manual
- Localized PDFs → Last-page check: inspects
- Localized PDFs → Barcode / QR check: validates
- English baseline PDFs → PDF crop extraction: extracts regions
- Localized PDFs → PDF crop extraction: extracts regions
- PDF crop extraction → English image crops: writes baseline crops
- English image crops → Crop image comparison: baseline regions
- Localized PDFs → Crop image comparison: localized regions
- Crop image comparison → Localized crop evidence: writes differences
- English baseline PDFs → Table extraction: extracts tables
- Localized PDFs → Table extraction: extracts tables
- English–Swedish fixture → Table extraction: fixture PDFs
- Table extraction → Table comparison: structured tables
- Table comparison → Table comparison JSON: writes JSON
- Table comparison → Table comparison workbook: writes XLSX
- Table comparison → Table visual debug: writes debug images
- First-page check → Quality inspection report: findings
- TOC check → Quality inspection report: findings
- Last-page check → Quality inspection report: findings
- Barcode / QR check → Quality inspection report: findings
- Localized crop evidence → Quality inspection report: visual findings
- Table comparison workbook → Quality inspection report: table findings