Perception

Job files

A result links the job's own files: full Markdown, figure crops, ground crops, transcripts, converted PDFs, cell maps and spreadsheet rows. See Files a job produced. File downloads don't count against your per-minute limit; the request echo and the event stream do. Results and their files expire on the document service's retention schedule; after that, a command on a file fails with 404 or 410 result_expired and exits 1, while nace job still reads the job, without its result.

Download a file

nace file <id> <document.content_url>              # a very large document's full Markdown, saved as <id>.md
nace file <id> parse-images/<ref> --save figure-1.png
nace file <id> request --save -                    # to stdout
nace file <id> ground-crops/<ref> --link           # a five-minute signed link

PATH is a link from the job's result, or the part after the job id, such as parse-images/<ref>. A query or fragment in it is ignored. A path such as .., or a full link from another job's result, exits 2. A parse result has document.content_url only when its Markdown is too large to return whole; see Very large results.

FlagWhat it does
--save PATHWhere to write the file; - for stdout. An existing file is replaced.
--linkPrint a stored file's signed link instead. It works for five minutes, without your API key. With --json, print {"url": ..., "expires_at": ...}.
--wait-timeout SECONDSHow long to wait for content the document service is still preparing (default 600). Past it, the command exits 1; the content is still being prepared, so run it again later.

Without --save, the file goes in the current directory: <id>.md for a document's full Markdown, else <id>-<kind>[-<digest>] plus the kind's extension, if it has one. <kind> is the path's first segment, and <digest> is the first 8 hex characters of the rest of the path's SHA-256, which keep files of one kind apart. A path with nothing after its kind gets no digest: request saves as <id>-request.json, and events as <id>-events. Stderr then says saved <path>.

KindExtension
document-content, spreadsheet-content.md
parse-images, ground-crops.png
converted-pdf.pdf
parse-transcript, ground-transcript, spreadsheet-cell-maps, spreadsheet-rows, request.json

Stored files (figure crops, ground crops, transcripts, converted PDFs and cell maps) come through their signed link, without your API key. Everything else streams from Drex: full Markdown, rows, the request and events. --link on one of those exits 2 and says to drop --link. Content whose preparation failed exits 1 with a 409. A file nace file can't write, at an unwritable --save path or in a current directory you can't write to, exits 2 with nothing on stdout.

Job request

nace job-request <id> prints the whole request the job ran under as JSON: request_type (the operation), source as the document service stored it, and the options, schema, classes or targets. A PDF password is never returned. It counts against your per-minute limit and expires with the job's result; after that, the command fails with 410 result_expired and exits 1. The output is JSON with or without --json.

Spreadsheet rows

nace rows <id> <rows_url> --all > sheet.tsv
nace rows <id> <rows_url> --start-row 100 --limit 50 --json

PATH is a sheet's rows_url from the parse result (only Parquet sources have one), or the part after the job id (spreadsheet-rows/<ref>). Stdout gets TSV: a line of column names, then one line per row. A cell's tabs, newlines, carriage returns and backslashes are written as \t, \n, \r and \\. Stderr says which rows you got, such as rows 0-49 of 1200; more: --start-row 50 (or --all).

FlagWhat it does
--start-row NThe first row, numbered from 0 (default 0).
--limit NRows per page, 1 to 100 (default 50).
--allEvery row from --start-row on, in pages of --limit (default 100).
--jsonPrint the page instead: path, start_row, limit, total_rows, columns (each with name and data_type) and rows (each keyed by column name). With --all, print {"columns": [...], "rows": [...], "total_rows": N}.

A negative --start-row or a --limit outside 1 to 100 exits 2.

On this page