Dastavez provides intelligent document extraction optimized for Indian documents including Aadhaar, PAN, GST invoices, and more. This guide covers common extraction workflows.
For documents with multiple pages (like bank statements):
result = client.dastavez.extract( document_type="bank_statement", file_url="...", options={ "pages": "all" # or "1-5" or [1, 3, 5] })# Transactions are aggregated across all pagesprint(f"Total transactions: {len(result.fields['transactions'])}")
Dastavez supports extraction from documents in 12 Indian languages:
result = client.dastavez.extract( document_type="aadhaar", file_url="...", options={ "language_hint": "hi" # Hindi # Supported: hi, ta, te, bn, mr, gu, kn, ml, pa, or, as, en })# Names and addresses are returned in both original script and transliteratedprint(f"Name (original): {result.fields['name']}")print(f"Name (English): {result.fields['name_english']}")
from rotavision.exceptions import ( ValidationError, DocumentProcessingError)try: result = client.dastavez.extract( document_type="aadhaar", file_url="..." )except ValidationError as e: print(f"Invalid input: {e.message}")except DocumentProcessingError as e: if e.code == "unreadable_document": print("Document image is too blurry or damaged") elif e.code == "wrong_document_type": print("Document doesn't match specified type") else: print(f"Processing error: {e.message}")