Repository navigation
v0.4.0
What's New
Progress Tracking
on_progress callback for extract_batch() and extract_workbook() — monitor batch processing in real time.
from xlstruct import ProgressEvent
def on_progress(event: ProgressEvent):
print(f"[{event.completed}/{event.total}] {event.source}: {event.status}")
result = await extractor.extract_batch(files, schema=MyModel, on_progress=on_progress)Error Codes
Every exception now carries a machine-readable ErrorCode for programmatic handling.
from xlstruct import ErrorCode, StorageError
try:
result = await extractor.extract("missing.xlsx", schema=MyModel)
except StorageError as e:
if e.code == ErrorCode.STORAGE_NOT_FOUND:
print("File not found")12 error codes: STORAGE_NOT_FOUND, STORAGE_PERMISSION_DENIED, READER_UNSUPPORTED_FORMAT, EXTRACTION_LLM_FAILED, CODEGEN_MAX_RETRIES, and more.
Public Cache API
Extractor.cache property exposes ScriptCache for inspection and management.
extractor.cache.list_entries() # List cached scripts
extractor.cache.clear() # Clear all
extractor.cache.remove(sig) # Remove by signatureAlso included (since v0.3.0)
- Extraction report —
result.reportwith mode used and token usage - Row provenance —
track_provenance=Truetracks source Excel row numbers - DataFrame export —
result.to_dataframe()for pandas integration - Multi-sheet extraction —
extract_workbook()with per-sheet schemas
Full Changelog: v0.3.0...v0.4.0