WolfSDKWolfXLWolfPPTWolfDocxWolfRender

WolfDocx documentation - Commercial

Handle WolfDocx reports, refusals, and command-line requests

Check report.passed before using a WolfDocx operation as a successful result. Community exposes separate edit and save reports, and a refused operation carries a code explaining its boundary. The command-line examples here target Commercial; do not assume installing Community also installs every Commercial command or capability.

Inspect a Community refusal

The following Python targets the public wolfdocx Community 0.1.0 package on Python 3.11 or newer. Install it with pip install wolfdocx, provide an existing input.docx, and run the script. It prints the edit outcome and deliberately does not publish a file.

import json
from wolfdocx import Document

with Document("input.docx") as doc:
    report = doc.find_replace("UNLIKELY_MARKER_48291", "replacement")
    print(json.dumps(report.to_dict(), indent=2))
    if not report.passed:
        print("Not applied:", report.code)
    else:
        print("Applied in this session; no file saved.")
    print("Changed parts:", doc.changed_parts)

If the marker does not occur, the code is find_replace_no_match, passed is false, and this operation leaves the session unchanged. If your input happens to contain the marker, the operation can apply instead. The example checks the outcome rather than pretending a particular business document is guaranteed to have no match.

A refusal is not always an exception. Operation reports express supported and refused document transformations, while invalid arguments or a file that cannot be opened may also raise an exception. Handle the API's documented result and ordinary Python failures at their actual boundary; do not catch every exception and label it a successful no-op.

Keep editing and saving distinct

ValueWhat to check
passedThe operation-specific success predicate.
statusThe reported lifecycle state, not a universal success string.
codeThe refusal reason when the operation did not pass.
to_dict()The structured receipt for logging or application handling.

Community's find-and-replace report uses an applied state after an accepted edit. A successful Document.save receipt uses a published state. Check each report's passed property rather than writing one string comparison that assumes every API has the same lifecycle.

The save receipt includes the source digest, destination, changed parts, and other publication details. It is evidence about the package operation, not a screenshot comparison. In particular, a structural save does not establish Word-identical pagination or evaluate every cached field result.

When chaining operations, remember that an earlier accepted edit can remain in the session even if a later edit refuses. Decide intentionally whether to discard the session or save those earlier changes. The editing guide exits before save when either of its required changes fails.

Commercial command-line discovery

The CLI example below targets the authenticated Commercial installation of wolfdocx. Use its checkout-success credential with the product index, in an environment separate from Community. Both editions install under the same name from different indexes; an environment holds one or the other.

python -m pip install wolfdocx --index-url https://packages.wolfxl.com/wolfdocx/simple/

With Commercial installed and handbook.docx present, this bash or zsh command inventories fields without changing the package. The command emits structured JSON and reports failure through its process result as well as the payload. Inspect both in an automated pipeline.

wolfdocx author fields-targets handbook.docx

Discovery does not render pages or refresh a cache. To publish a refresh, use the separate wolfdocx author fields-refresh request.json command with the complete source-bound JSON request described in the fields guide. Do not feed discovery output back as an unmodified request: the operation schema also needs output and font choices.

What it does not do

  • A successful inventory does not guarantee a later edit will pass.
  • A refusal does not authorize deleting existing output or weakening target guards.
  • Community is not promised the Commercial CLI shown here.
  • A package receipt does not certify visual equivalence to Microsoft Word.

Related documentation

See edit and save handling, Commercial field requests, and the Commercial source-backed API reference.

Get WolfDocx

WolfDocx Community is MIT-licensed and free, including commercial use. It edits existing .docx files in place in pure Python and does not render pages or convert to PDF. WolfDocx Commercial does not change those rights.

pip install wolfdocx

WolfDocx Commercial is an organization-scoped subscription. WolfDocx Community installs from public PyPI with pip install wolfdocx. WolfDocx Commercial installs from the authenticated WolfDocx package index with a per-purchase credential, issued on the checkout success page after payment and reissued through https://wolfxl.com/recover.

Review the scoped before-and-after memo files in the reporting walkthrough, or ask about your document before purchasing if compatibility is uncertain.

Related tasks