How ieasybooks/tahweel works
Main Components Identification
a. Input Layer:
• CLI Interface (tahweel/cli.py)
• Argument Parser (tahweel/tahweel_argument_parser.py)
b. Core Processing Layer:
• File Managers (tahweel/managers/)
• OCR Processors (tahweel/processors/)
• Writers (tahweel/writers/)
c. External Services:
• Google Drive OCR Service
• Google Cloud Platform (Service Account Authentication)
[Input Sources] → [Core Processing] → [Output Generation]
• ↓ ↕ ↓
[File System] [Google Services] [Generated Files]
Component Details
a. Input Processing:
• PDF File/Directory Input
• Command Line Arguments
• Service Account Credentials
b. File Management:
• PDF File Manager
• Image File Manager
• File Manager Factory
c. Processing Pipeline:
• PDF to Image Conversion
• OCR Processing
• Text Extraction
d. Output Generation:
• TXT Writer
• DOCX Writer
Key Relationships to Highlight
• Parallel processing capability with thread pools
• Transformation pipeline: PDF → Images → OCR → Text → Output
• Demonstrate the interaction with Google Drive OCR services
• Factory pattern used in file management
Technical Details
Annotations for:
• Thread pool configurations
• Supported output formats
• File system interactions
• Google API integration points
[PDF Input] → [Argument Parser] → [File Manager Factory]
• ↓
[Service Account] → [Google Drive OCR] ← [Image Conversion]
• ↓
• [OCR Processing]
• ↓
• [Output Generation] → [TXT/DOCX Files]
The integration with external services
Remember to maintain a balance between detail and clarity, focusing on the key architectural decisions that make Tahweel efficient and scalable.