Skip to content

Latest commit

 

History

History
101 lines (80 loc) · 2.4 KB

File metadata and controls

101 lines (80 loc) · 2.4 KB

SmartOrderReader Demo

This document demonstrates how SmartOrderReader processes invoice images.

Sample Invoice Text (Simulated OCR Output)

Invoice 1

ACME Corporation
Invoice #: INV-2024-001
Invoice Date: January 15, 2024

Bill To: John Doe
Amount: $250.00

Invoice 2

XYZ Company
Order Number: ORD_2024.567/A
Order Date: 2024-03-20

Customer: Jane Smith
Total: $1,500.00

Invoice 3

ABC Services
Order: 12345ABC
Date: 12/25/2023

Service: Premium Support
Cost: $99.99

Expected Output

When processing these invoices, SmartOrderReader would extract:

Table Format

+-------------------+-------------------+------------------+
| Image File Name   | Order Number      | Order Date       |
+===================+===================+==================+
| invoice1.jpg      | INV-2024-001      | January 15, 2024 |
+-------------------+-------------------+------------------+
| invoice2.png      | ORD_2024.567/A    | 2024-03-20       |
+-------------------+-------------------+------------------+
| invoice3.jpg      | 12345ABC          | 12/25/2023       |
+-------------------+-------------------+------------------+

CSV Format

Image File Name,Order Number,Order Date
invoice1.jpg,INV-2024-001,January 15, 2024
invoice2.png,ORD_2024.567/A,2024-03-20
invoice3.jpg,12345ABC,12/25/2023

Usage Examples

Basic Usage

python order_reader.py invoice1.jpg invoice2.png invoice3.jpg

Save to Custom CSV File

python order_reader.py *.jpg --output my_invoices.csv

Process Images with Urdu Text

python order_reader.py urdu_invoice.png --lang eng+urd

Key Features Demonstrated

  1. Multiple Order Number Formats: INV-2024-001, ORD_2024.567/A, 12345ABC
  2. Multiple Date Formats: January 15, 2024 (full month), 2024-03-20 (ISO), 12/25/2023 (slash)
  3. Case Preservation: Order numbers maintain their original case
  4. Special Characters: Support for underscores, dots, slashes in order numbers
  5. Clean Output: Both table and CSV formats for easy viewing and import
  6. Batch Processing: Process multiple images in one command

Testing

Run the test suite to verify all functionality:

python test_order_reader.py

All 30 tests should pass, covering:

  • Order number extraction patterns
  • Date extraction patterns
  • Output formatting
  • Edge cases and error handling
  • Special character support
  • Case preservation