Python SDK reference
See SDKs for the guide. The public API of extractit_sdk:
| Name | Kind | Summary |
|---|---|---|
DX |
class | ExtractIt client. api_key defaults to DX_API_KEY and base_url to |
APIError |
class | The API answered with an error status. |
AsyncDX |
class | Async client. api_key defaults to DX_API_KEY; never shown in repr or errors. |
BadRequest |
class | 400 and 422: the request is malformed or fails validation (errors has the details). |
Conflict |
class | 409. |
DXError |
class | Base class of everything the SDK raises. |
Evidence |
class | Where a value comes from: page, quote and the regions the viewer highlights. |
ExtractResult |
class | Typed result: data (an instance of T), the run and the per-field provenance. |
FieldMissingError |
class | A required field came back null (allow_partial=True returns the partial model). |
FieldResult |
class | One extracted field with its provenance. |
Forbidden |
class | 403. |
NotFound |
class | 404 (also resources of another project). |
PreconditionFailed |
class | 412 and 428: the If-Match ETag is stale or missing. |
RateLimited |
class | 429: honour :attr:retry_after. |
Rules |
class | Constructors of deterministic rules (dx.rules). Pure: no network. |
Run |
class | A run (GET /v1/runs/{id}). |
RunEvent |
class | An event of GET /v1/runs/{id}/events: sequence is the SSE id. |
RunFailed |
class | The run ended failed or cancelled. |
SDKTimeout |
class | A wait ran out (runs.wait, extract) before the run finished. run is the last state. |
ServerError |
class | 5xx. |
StreamError |
class | The event stream broke and could not be resumed. |
Tier |
class | Extraction tier (auto is for parse: the page router decides). |
Unauthorized |
class | 401: missing, invalid, expired or revoked credentials. |
UnsupportedSchemaError |
class | A Python type with no JSON Schema equivalent; path locates it in the model. |
WebhookVerificationError |
class | The signature, the secret, the body or the timestamp of a webhook is wrong. |
WorkflowBuilder |
class | dx.workflow(name).parse().classify(...).extract(Model, branch=...).validate(...). |
WorkflowBuilderError |
class | The builder refuses a graph before any request is made. |
__version__ |
attribute | |
dx_field |
function | pydantic.Field that also declares the field's x-dx extension. |
schema_from_model |
function | JSON Schema of model (validation mode). Raises :class:UnsupportedSchemaError with the |
verify_webhook |
function | Return the decoded event, or raise :class:WebhookVerificationError. |