Skip to main content

SuperDoc SDK (CLI-backed)

Project description

superdoc-sdk

Programmatic SDK for deterministic DOCX operations through SuperDoc's Document API.

Install

pip install superdoc-sdk

The package installs a platform-specific CLI companion package automatically via PEP 508 environment markers. Supported platforms:

Platform Architecture
macOS Apple Silicon (arm64), Intel (x64)
Linux x64, ARM64
Windows x64

Quick start

import asyncio

from superdoc import AsyncSuperDocClient


async def main():
    client = AsyncSuperDocClient()

    await client.doc.open({"doc": "./contract.docx"})

    info = await client.doc.info({})
    print(info["counts"])

    results = await client.doc.find({"type": "text", "pattern": "termination"})
    target = results["context"][0]["textRanges"][0]

    await client.doc.replace({"target": target, "text": "expiration"})
    await client.doc.save({"inPlace": True})
    await client.doc.close({})


asyncio.run(main())

API

Client

from superdoc import SuperDocClient

client = SuperDocClient()

All document operations are on client.doc:

await client.doc.open(params)
await client.doc.find(params)
await client.doc.insert(params)
# ... etc

Operations

Category Operations
Query find, get_node, get_node_by_id, info
Mutation insert, replace, delete
Format format.bold, format.italic, format.underline, format.strikethrough
Create create.paragraph
Lists lists.list, lists.get, lists.insert, lists.set_type, lists.indent, lists.outdent, lists.restart, lists.exit
Comments comments.add, comments.edit, comments.reply, comments.move, comments.resolve, comments.remove, comments.set_internal, comments.set_active, comments.go_to, comments.get, comments.list
Track Changes track_changes.list, track_changes.get, track_changes.accept, track_changes.reject, track_changes.accept_all, track_changes.reject_all
Lifecycle open, save, close
Session session.list, session.save, session.close, session.set_default
Introspection status, describe, describe_command

Troubleshooting

Custom CLI binary

If you need to use a custom-built CLI binary (e.g. a newer version or a patched build), set the SUPERDOC_CLI_BIN environment variable:

export SUPERDOC_CLI_BIN=/path/to/superdoc

Air-gapped / private index environments

Mirror both superdoc-sdk and the superdoc-sdk-cli-* package for your platform to your private index. For example, on macOS ARM64:

pip download superdoc-sdk superdoc-sdk-cli-darwin-arm64
# Upload both wheels to your private index

Part of SuperDoc

This SDK is part of SuperDoc — an open source document editor bringing Microsoft Word to the web.

License

AGPL-3.0 · Enterprise license available

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superdoc_sdk-1.0.0a18.tar.gz (91.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superdoc_sdk-1.0.0a18-py3-none-any.whl (98.9 kB view details)

Uploaded Python 3

File details

Details for the file superdoc_sdk-1.0.0a18.tar.gz.

File metadata

  • Download URL: superdoc_sdk-1.0.0a18.tar.gz
  • Upload date:
  • Size: 91.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for superdoc_sdk-1.0.0a18.tar.gz
Algorithm Hash digest
SHA256 d19a7dd38480e1a8f0e9dd99bb5fa208f37757dfa46c321b561992609dd77e29
MD5 30f6e74f90bd58b3ce0df36874fa4271
BLAKE2b-256 a43f2f772f2cef4ccdf2878d9d575fe654b52ef0e339c5b612480b393c04c1f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for superdoc_sdk-1.0.0a18.tar.gz:

Publisher: release-sdk.yml on superdoc-dev/superdoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file superdoc_sdk-1.0.0a18-py3-none-any.whl.

File metadata

File hashes

Hashes for superdoc_sdk-1.0.0a18-py3-none-any.whl
Algorithm Hash digest
SHA256 31befd59976a335457f91f2d0d558cd50db4f905297a151b831f949de612fbb1
MD5 c65b24bc396b964853c630c233935890
BLAKE2b-256 7af926c0de872f40e929e09dbaf4bede49401daa162a5cc389dc16151117d5a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for superdoc_sdk-1.0.0a18-py3-none-any.whl:

Publisher: release-sdk.yml on superdoc-dev/superdoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page