nutrient-python-sdk

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Nutrient 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
nutrient-dws
REST client (which is the hosted alternative).
Nutrient文档处理引擎的进程内Python绑定。可直接从Python进程中打开、转换、编辑、OCR识别、提取及导出PDF和Office格式文件——无需外部服务器,无需网络往返,无DWS依赖。与
nutrient-dws
REST客户端(托管替代方案)是不同产品。

Documentation

文档

Single-fetch LLM-curated dumps — prefer these over the human-shaped docs site for API/guide look-ups:
单次获取由LLM整理的文档转储——在查询API/指南时,优先使用这些资源而非人工维护的文档站点:

Install

安装

bash
pip install nutrient-sdk
  • Package name on PyPI:
    nutrient-sdk
  • Import name in code:
    nutrient_sdk
    (underscored)
  • 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
    nutrient-dws
    : the
    nutrient-dws
    PyPI package is the DWS REST API client — it makes HTTPS calls to Nutrient's hosted Processor API.
    nutrient-sdk
    is in-process — it runs natively in your Python process with no network and no quota. Both are official; pick
    nutrient-sdk
    for self-contained workloads or when you can't depend on external network access.
  • vs the third-party
    pspdfkit
    PyPI package
    : there is an unofficial
    pspdfkit
    package on PyPI from 2017 (third-party, unmaintained, unrelated to Nutrient). Don't use it.
    nutrient-sdk
    is the only official Nutrient in-process Python SDK.
  • vs in-process server SDKs in other languages: see
    nutrient-nodejs-server-sdk
    ,
    nutrient-java-server-sdk
    ,
    nutrient-dotnet-server-sdk
    for the same in-process capability in Node.js / Java / .NET.
  • 与
    nutrient-dws
    的区别
    :
    nutrient-dws
    PyPI包是DWS REST API客户端——它会向Nutrient的托管处理器API发起HTTPS请求。
    nutrient-sdk
    是进程内运行——直接在你的Python进程中原生运行,无需网络,无配额限制。两者均为官方产品;若需独立工作负载或无法依赖外部网络访问,请选择
    nutrient-sdk
    。
  • 与第三方
    pspdfkit
    PyPI包的区别
    :PyPI上有一个2017年的非官方
    pspdfkit
    包(第三方开发,已停止维护,与Nutrient无关)。请勿使用该包。
    nutrient-sdk
    是唯一官方的Nutrient进程内Python SDK。
  • 与其他语言的进程内服务器SDK对比:如需在Node.js/Java/.NET中实现相同的进程内功能,请查看
    nutrient-nodejs-server-sdk
    、
    nutrient-java-server-sdk
    、
    nutrient-dotnet-server-sdk
    。