Core Concepts
- Taxonomy — Defines the structure of data to extract (groups, fields, types)
- ExtractionEngine — Processes a document against taxonomies to produce data objects
- DataObject — A structured record extracted from the document (e.g., an invoice header)
- DataAttribute — A field within a data object (e.g., invoice number, date, total)
- DataException — A validation error on a data object or attribute
Taxonomy
ATaxonomy wraps a Go-side taxonomy handle for use with the extraction engine. Create one from a dict or a JSON file path:
If you don’t use a context manager, the Go handle is still cleaned up automatically via
weakref.finalize, but using with is recommended for deterministic cleanup.ExtractionEngine
TheExtractionEngine processes a document against one or more taxonomies to extract structured data.
Constructor
process_and_save
Runs extraction and persists the results (data objects, attributes, exceptions) into the document’s SQLite store:Content Exceptions
After extraction, retrieve any content-level exceptions:Document Taxon Validations
Check which taxons were found or missing in the document:DataObject
Represents a structured record extracted from the document. Created by the extraction engine, accessed viaDataObjectAccessor.
