Skip to content

v0.4.0

Choose a tag to compare

@DanMeon DanMeon released this 20 Mar 07:01
· 41 commits to main since this release

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 signature

Also included (since v0.3.0)

  • Extraction report — result.report with mode used and token usage
  • Row provenance — track_provenance=True tracks 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