nutrient-python-sdk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNutrient Python SDK
Nutrient Python SDK
In-process Python bindings for the Nutrient document-processing engine. Open, convert, edit, OCR, extract, and export PDFs and Office formats directly from a Python process — no external server, no network round-trips, no DWS dependency. Different product from the REST client (which is the hosted alternative).
nutrient-dwsNutrient文档处理引擎的进程内Python绑定。可直接从Python进程中打开、转换、编辑、OCR识别、提取及导出PDF和Office格式文件——无需外部服务器,无需网络往返,无DWS依赖。与 REST客户端(托管替代方案)是不同产品。
nutrient-dwsDocumentation
文档
Single-fetch LLM-curated dumps — prefer these over the human-shaped docs site for API/guide look-ups:
- Guides: https://www.nutrient.io/guides/python/llms.txt
- API reference: https://www.nutrient.io/api/python/ — no ; instead every API page has a Markdown variant. Take any page URL, drop the trailing slash, append
llms.txt(e.g..md).https://www.nutrient.io/api/python/document.md - Cross-product index (other Nutrient SDKs): https://www.nutrient.io/llms.txt
单次获取由LLM整理的文档转储——在查询API/指南时,优先使用这些资源而非人工维护的文档站点:
- 指南:https://www.nutrient.io/guides/python/llms.txt
- API参考:https://www.nutrient.io/api/python/ — 无文件;每个API页面均有Markdown版本。取任意页面URL,去掉末尾斜杠,追加
llms.txt即可(例如:.md)。https://www.nutrient.io/api/python/document.md - 跨产品索引(其他Nutrient SDK):https://www.nutrient.io/llms.txt
Install
安装
bash
pip install nutrient-sdk- Package name on PyPI:
nutrient-sdk - Import name in code: (underscored)
nutrient_sdk - Python: 3.8+ (per the PyPI metadata for the current 1.x line)
bash
pip install nutrient-sdk- PyPI上的包名称:
nutrient-sdk - 代码中的导入名称:(下划线分隔)
nutrient_sdk - Python版本要求:3.8+(依据当前1.x版本系列的PyPI元数据)
Hello world (PDF/Office conversion)
入门示例(PDF/Office格式转换)
python
from nutrient_sdk import Document, License, PdfExporter
License.register_key("your-license-key")
with Document.open("input.docx") as doc:
doc.export("output.pdf", PdfExporter())python
from nutrient_sdk import Document, License, PdfExporter
License.register_key("your-license-key")
with Document.open("input.docx") as doc:
doc.export("output.pdf", PdfExporter())Key concepts
核心概念
- vs : the
nutrient-dwsPyPI package is the DWS REST API client — it makes HTTPS calls to Nutrient's hosted Processor API.nutrient-dwsis in-process — it runs natively in your Python process with no network and no quota. Both are official; picknutrient-sdkfor self-contained workloads or when you can't depend on external network access.nutrient-sdk - vs the third-party PyPI package: there is an unofficial
pspdfkitpackage on PyPI from 2017 (third-party, unmaintained, unrelated to Nutrient). Don't use it.pspdfkitis the only official Nutrient in-process Python SDK.nutrient-sdk - vs in-process server SDKs in other languages: see ,
nutrient-nodejs-server-sdk,nutrient-java-server-sdkfor the same in-process capability in Node.js / Java / .NET.nutrient-dotnet-server-sdk
- 与的区别:
nutrient-dwsPyPI包是DWS REST API客户端——它会向Nutrient的托管处理器API发起HTTPS请求。nutrient-dws是进程内运行——直接在你的Python进程中原生运行,无需网络,无配额限制。两者均为官方产品;若需独立工作负载或无法依赖外部网络访问,请选择nutrient-sdk。nutrient-sdk - 与第三方PyPI包的区别:PyPI上有一个2017年的非官方
pspdfkit包(第三方开发,已停止维护,与Nutrient无关)。请勿使用该包。pspdfkit是唯一官方的Nutrient进程内Python SDK。nutrient-sdk - 与其他语言的进程内服务器SDK对比:如需在Node.js/Java/.NET中实现相同的进程内功能,请查看、
nutrient-nodejs-server-sdk、nutrient-java-server-sdk。nutrient-dotnet-server-sdk