Construction submittal extraction example

submittal.pdf is a fictional, one-page source document. All names, identifiers,
and review details are invented for this example.

Requires Python 3.10+ and requests. In an isolated Python environment, install:
    python3 -m pip install requests

Set a Data Extraction API key in the NUTRIENT_API_KEY environment variable.
Do not put the key in this folder or the example's source files.

From this folder, run:
    python3 extract_submittal.py extract submittal.pdf submittal-result

The script uploads the PDF to Nutrient Data Extraction API. Usage consumes
API credits. It saves request settings, a source hash, the complete response,
and a review checklist in the new submittal-result directory. It does not
retry automatically or overwrite an existing output directory.

Inspect every value against submittal.pdf. Citation flags prioritize inspection;
zero flags do not approve a value or a submittal. Reports always remain pending
human review. The example does not assess technical compliance, issue an
approval, or write to a construction project system.

To check a previously saved response without uploading again:
    python3 extract_submittal.py check submittal-result/response.json review-again.json

The sample has eight scalar text fields. It does not test scanned drawings,
tables, multipage packets, version reconciliation, or approval integrations.

Recorded test: October 26, 2026
sample-review.json is the checklist saved from a live API request using the
included instructions.json and submittal.pdf. All eight returned values matched
the fictional source, with no checklist flags. The source hash identifies the
tested PDF. The report remains pending human review; this one result is not an
accuracy benchmark for other documents. It can be inspected without an API key.

Documentation:
https://www.nutrient.io/guides/dws-data-extraction/extract/
https://www.nutrient.io/guides/dws-data-extraction/extract/citations-and-confidence/
