- Home
- Skills
- APIs & Backend
- Quinto Trade Document Validation
Quinto Trade Document Validation
Automate OCR extraction and cross-document validation for international trade documents in FastAPI.
Free
Quinto Trade Document Validation
Example session with this skill installed
Add support for a 'Packing List' document type. It needs to extract the TotalWeight and TotalPackages fields and validate them against the Master Registry.
- Read your context and instructions
- Compiled the quinto trade document
I have updated the Quinto pipeline to support the 'Packing List' document type. This involved adding the new enum to the extractor, defining OCR-tolerant labels for weight and package counts, and updating the Master Registry to enable cross-document validation with the Bill of Lading.
Implementation Details
# extractor.py additions
class DocumentType(str, Enum):
# ... existing types
PACKING_LIST = "packing_list"
PACKING_LIST_KEYWORDS = ["packing list", "lista de empaque", "p/l"]
# main_input.py mapping
DOC_TYPE_LABELS = {
DocumentType.PACKING_LIST: "Packing List",
# ...
}
# field_checker.py Registry Update
MASTER_REGISTRY = {
"Packing List": {
"TotalWeight": {"type": "numeric", "required": True},
"TotalPackages": {"type": "numeric", "required": True}
}
}
FIELD_ALIASES = {
"TotalWeight": ["gross weight", "total mass", "gw"],
"TotalPackages": ["total pkgs", "number of parcels", "qty"]
}
Next steps
- Add a sample PDF to
samples/packing_list.pdfto test OCR extraction accuracy. - Run
pytest tests/test_extractor.pyto verify the new keyword classification. - Update
output.htmlif you need to display the new fields in a specific sub-section of the report.
Connects securely to your tools. The creator never sees your data.
About this skill
Inconsistent data across shipping manifests, bills of lading, and invoices creates massive bottlenecks in trade finance. This skill extends or repairs the Quinto FastAPI pipeline to automate OCR extraction and cross-document validation for international trade paperwork.
What it does
- Document classification defines and extracts specific
DocumentTypevalues from raw PDF scans. - Cross-document validation checks extracted fields against a Master Registry to find discrepancies between related documents.
- OCR-tolerant extraction utilizes Tesseract and Poppler with specific keyword normalization for noisy scans.
- Semantic review implements Gemini for text-heavy comparisons like addresses, ports, and entity names.
- Deterministic checking maintains local logic for quantities, weights, and HS codes to ensure reliability.
- Report generation flattens extraction results and validation issues into UI-ready API responses.
How it works
- Define extraction logic in
extractor.pyto handle new document types or OCR-tolerant labels. - Map labels in
main_input.pyto ensure the extractor output aligns with validation requirements. - Configure the Registry in
field_checker.pyto set the rules for cross-document field comparisons. - Update the UI contract to reflect new report keys or validation categories in the web frontend.
Frameworks & tools
Built for FastAPI backends using Poppler, pdf2image, and Tesseract for the OCR layer. It uses Google Gemini for LLM-based semantic validation and pytest for integration coverage.
Why this beats prompting it yourself
Generic prompts fail to maintain the strict document-to-registry mapping required for trade compliance. This skill ensures changes are applied across all layers, from extraction enums to validation aliases, preventing breaking changes in the reporting schema.
Use cases
- Add a new trade document type like a Certificate of Origin to the pipeline.
- Implement specialized validation rules for HS code consistency across an invoice and packing list.
- Repair OCR extraction failures for specific shipping line document formats.
- Integrate Gemini for smarter address matching between different document issuers.
Known limitations
OCR integration tests require Tesseract and Poppler to be installed on the host system. Gemini validation requires environment-configured credentials and falls back to local logic if unavailable.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 6 days ago
- Free with an Agensi account
Permissions
What's inside
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.