document-processor-api
Installation
SKILL.md
Nutrient Document Processor API
Quick Start
All paths below are relative to this skill's directory (the directory containing scripts/, assets/, and references/).
- Export the API key before running scripts:
export NUTRIENT_DWS_API_KEY="nutr_sk_..."
- Run task scripts with
uv runfrom the plugin root. Thenutrient-dwspackage is fetched automatically on first use.
Task Scripts
Use one script per operation.
- Convert formats:
scripts/convert.py - Merge files:
scripts/merge.py - Split by ranges:
scripts/split.py - OCR documents:
scripts/ocr.py - Extract text:
scripts/extract-text.py - Extract tables:
scripts/extract-table.py - Extract key-value pairs:
scripts/extract-key-value-pairs.py - Add text watermark:
scripts/watermark-text.py - AI redaction:
scripts/redact-ai.py - Rotate pages:
scripts/rotate.py - Sign PDF:
scripts/sign.py - Optimize PDF:
scripts/optimize.py - Password protect PDF:
scripts/password-protect.py - Add blank pages:
scripts/add-pages.py - Delete pages:
scripts/delete-pages.py - Duplicate/reorder pages:
scripts/duplicate-pages.py
Check exact arguments with uv run <script> --help.
Custom Pipelines
When the user asks for a workflow not covered by the scripts above, create a new script rather than forcing ad hoc one-off commands.
- Start from
assets/templates/custom-workflow-template.py. - Save the new script in
scripts/with a task-specific name (for examplescripts/redact-and-watermark.py). - Keep API usage on
nutrient-dws. - Prefer direct methods (
client.convert,client.merge, etc.) for single-step tasks. - Use
client.workflow()andBuildActionsfor multi-step tasks. - Keep every custom script CLI-driven (
--input,--out, explicit options), deterministic, and runnable end-to-end. - Run the script with sample input to verify behavior before finalizing.
Implementation Rules
- Fail fast when required arguments are missing.
- Require local input for operations that do not support URL input (
sign). - Write outputs to explicit paths and print created files.
- Do not log secrets.
- If the package import fails, install latest with
uv add nutrient-dws.
References
- Script matrix and method mapping:
references/script-catalog.md - Custom pipeline patterns:
references/custom-pipeline-guidelines.md
Related skills