The Golden API is the executable adoption contract for python-hwpx. It is not
another public facade. It records the ordinary tasks that must remain possible
with a direct python-hwpx install and without MCP, a skill, a genre profile,
or agent orchestration.
The machine-readable scenario list is
tests/data/golden_api_contract.json; tests/test_golden_api.py executes every
scenario.
Every Python block in the current manuals is classified in the execution ledger. Blocks without a Standalone example label require external input or prior walkthrough state.
Standalone example — this runs with only the installed core wheel.
from hwpx import HwpxDocument with HwpxDocument.new() as document: document.add_paragraph("Hello HWPX") table = document.add_table(2, 2) table.cell(0, 0).text = "Name" table.cell(0, 1).text = "Value" document.save("example.hwpx")
| Area | Scenarios |
|---|---|
| Lifecycle | new document, open bytes, context manager |
| Text | add paragraph, iterate runs, replace text, create run style |
| Formatting | paragraph format, list format |
| Tables | add table, merge cells, map tables |
| Sections/layout | add/remove section, page setup, header/footer, page number |
| Navigation | bookmark, hyperlink |
| Reading | export text |
| Safety/persistence | validate, save/reopen path, save/reopen stream, preserve all unmodified package parts |
The contract has 23 scenarios. A scenario may change only with a
reviewed public API decision. 7.0 took out "find a cell by label" and "export
Markdown": label-guided form filling and Markdown conversion moved to
python-hwpx-automation. Application workflows such as evaluation-plan
fill, genre authoring, PII policy, or agent blueprint replay belong to
python-hwpx-automation tests instead.