How aws-samples/amazon-textract-textractor works
Textractor is a Python interface to Amazon Textract: users submit documents for text, table, form, ID, receipt/expense, query, and layout extraction, then work with structured document entities or export/visualize them. Its core runtime wraps Textract calls, parses responses into entities, and exposes a CLI. The repository also includes companion caller, pretty-printing, overlay, geometry-finder, page-dimension, helper, and manifest packages. Relationships are limited to README statements and SOURCE INDEX references; some companion-package internals were not sampled.
Main entry points: response_parser.py Response parser · document.py Document · textractor.py Textractor API · cli.py Command-line interface
Components 26
Extraction runtime
- Textractor API
textractor/textractor.py - Textract caller
caller/textractcaller/t_call.py - Response parser
textractor/parsers/response_parser.py - Command-line interface
textractor/cli/cli.py
Document model
- Document
textractor/entities/document.py - Page entities
textractor/entities/page.py - Tables
textractor/entities/table.py - Form entities
textractor/entities/key_value.py - Expense entities
textractor/entities/expense_document.py - Identity entities
textractor/entities/identity_document.py - Layout entities
textractor/entities/layout.py - Query entities
textractor/entities/query.py - Spatial geometry
textractor/entities/bbox.py - Text linearization
textractor/data/text_linearization_config.py
Output tools
- Entity visualization
textractor/visualizers/entitylist.py - Pretty printing
prettyprinter/textractprettyprinter/t_pretty_print.py - Expense printing
prettyprinter/textractprettyprinter/t_pretty_print_expense.py - Image overlays
overlayer/textractoverlayer/t_overlay.py
Companion packages
- Geometry finder
tpipelinegeofinder/textractgeofinder/tgeofinder.py - Finder word model
tpipelinegeofinder/textractgeofinder/tword.py - OCR database
tpipelinegeofinder/textractgeofinder/ocrdb.py - Page dimensions
tpipelinepagedimensions/textractpagedimensions/t_pagedimensions.py - Textract manifest
idp_cdk_manifest/textractmanifest/manifest.py - Textract helper
helper/textracthelper
Other components
- Document user
- Amazon Textract
Connections 29
- Document user → Textractor API: submits documents
README.md - Textractor API → Textract caller: calls APIs
textractor/textractor.py - Textract caller → Amazon Textract: requests extraction
README.md - Textractor API → Response parser: parses responses
textractor/textractor.py - Response parser → Document: builds document
textractor/parsers/response_parser.py - Response parser → Page entities: builds pages
textractor/parsers/response_parser.py - Response parser → Tables: builds tables
textractor/parsers/response_parser.py - Response parser → Form entities: builds key values
textractor/parsers/response_parser.py - Response parser → Expense entities: builds expense data
textractor/parsers/response_parser.py - Response parser → Identity entities: builds identity data
textractor/parsers/response_parser.py - Response parser → Query entities: builds query results
textractor/parsers/response_parser.py - Response parser → Layout entities: builds layout data
textractor/parsers/response_parser.py - Page entities → Spatial geometry: uses bounding boxes
textractor/entities/page.py - Document → Page entities: contains pages
textractor/entities/document.py - Document → Entity visualization: exposes visualization
textractor/entities/document.py - Entity visualization → Spatial geometry: positions entities
textractor/visualizers/entitylist.py - Document → Text linearization: linearizes text
textractor/entities/document.py - Document user → Command-line interface: runs commands
README.md - Command-line interface → Textractor API: invokes extraction
textractor/cli/cli.py - Command-line interface → Entity visualization: supports overlays
textractor/cli/cli.py - Document user → Pretty printing: exports output
README.md - Document user → Expense printing: prints expenses
README.md - Document user → Image overlays: draws entities
README.md - Document user → Geometry finder: finds information
README.md - Geometry finder → Finder word model: uses word model
tpipelinegeofinder/textractgeofinder/tgeofinder.py - Geometry finder → OCR database: uses OCR database
tpipelinegeofinder/textractgeofinder/tgeofinder.py - Document user → Page dimensions: uses page sizing
- Document user → Textract manifest: uses manifest tools
- Document user → Textract helper: uses helper package