Jobs
Each extraction is a job that runs in the background. Most finish in a minute or less; long, hard documents take several minutes.
Status
| Status | What it means |
|---|---|
PENDING | Waiting to start. |
RUNNING | Reading the document. |
COMPLETED | Done: the result is there, and the pages are charged. |
FAILED | It could not be finished; the reason is given. Nothing is charged. |
CANCELLED | You stopped it. Nothing is charged. |
Start now, get the result later
The Python SDK waits for the result by default. To start an extraction and come back for it, keep its id and wait, or get it, later. Over HTTP, get the job until its status is COMPLETED, FAILED or CANCELLED; every few seconds is plenty.
job = client.extract("report.pdf", schema, wait=False) # returns at once, PENDING
print(job.id)
# later, or in another process
job = client.jobs.wait(job.id) # COMPLETED; raises if it failed
print(job.result)In the console, each job shows its progress while it runs, and its schema and result once done, to read or download.
List, cancel and delete
for job in client.jobs.list(): # every extraction, newest first, without results
print(job.id, job.status)
client.jobs.get("ext_7b56d419dd0a4d7eafa68e4c") # one, with its result once COMPLETED
client.jobs.cancel("ext_7b56d419dd0a4d7eafa68e4c") # stop it; nothing is charged
client.jobs.delete("ext_7b56d419dd0a4d7eafa68e4c") # delete it and its resultDeleting a job that is still running stops it first. See the API reference for every field of a job.