wolfdocx 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/CHANGELOG.md +27 -1
  2. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/PKG-INFO +29 -13
  3. wolfdocx-0.1.2/PROVENANCE.md +78 -0
  4. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/README.md +27 -11
  5. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/pyproject.toml +7 -6
  6. wolfdocx-0.1.2/src/wolfdocx/__init__.py +955 -0
  7. wolfdocx-0.1.2/src/wolfdocx/_comment_extensions.py +185 -0
  8. wolfdocx-0.1.2/src/wolfdocx/_defaults.py +57 -0
  9. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/_inspection_cache.py +5 -3
  10. wolfdocx-0.1.2/src/wolfdocx/_optional.py +53 -0
  11. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/_version.py +1 -1
  12. wolfdocx-0.1.2/src/wolfdocx/assembly.py +8245 -0
  13. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/authoring.py +4 -8
  14. wolfdocx-0.1.2/src/wolfdocx/builder.py +3363 -0
  15. wolfdocx-0.1.2/src/wolfdocx/comments.py +2359 -0
  16. wolfdocx-0.1.2/src/wolfdocx/contracts.py +561 -0
  17. wolfdocx-0.1.2/src/wolfdocx/document.py +461 -0
  18. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/errors.py +5 -2
  19. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/find_replace.py +199 -59
  20. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/formatting.py +112 -16
  21. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/inspect.py +202 -17
  22. wolfdocx-0.1.2/src/wolfdocx/load_options.py +2013 -0
  23. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/model.py +156 -11
  24. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/numbering_authoring.py +42 -121
  25. wolfdocx-0.1.2/src/wolfdocx/ooxml_order.py +61 -0
  26. wolfdocx-0.1.2/src/wolfdocx/output.py +1468 -0
  27. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/page_setup.py +179 -119
  28. wolfdocx-0.1.2/src/wolfdocx/paragraph_format_effective.py +431 -0
  29. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/properties.py +3 -3
  30. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/protection.py +193 -27
  31. wolfdocx-0.1.2/src/wolfdocx/render_warnings.py +252 -0
  32. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/reporting.py +2 -4
  33. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/review.py +53 -34
  34. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/section_break.py +29 -0
  35. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/__init__.py +2 -0
  36. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/_bridge.py +32 -0
  37. wolfdocx-0.1.2/src/wolfdocx/session_ops/pictures.py +87 -0
  38. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/rich_objects.py +1883 -47
  39. wolfdocx-0.1.2/src/wolfdocx/style_resolution.py +1244 -0
  40. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/styles_authoring.py +26 -24
  41. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/table_cell_properties.py +138 -13
  42. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/table_column.py +65 -34
  43. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/table_delete.py +1 -2
  44. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/table_merge.py +255 -93
  45. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/table_properties.py +120 -14
  46. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/table_row_properties.py +102 -16
  47. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/table_structure.py +3 -6
  48. wolfdocx-0.1.2/src/wolfdocx/web_extensions.py +850 -0
  49. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/docx_fixtures.py +2 -4
  50. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_section_break.py +1 -1
  51. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_inspect.py +23 -12
  52. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_table_column.py +3 -2
  53. wolfdocx-0.1.1/PROVENANCE.md +0 -8
  54. wolfdocx-0.1.1/src/wolfdocx/__init__.py +0 -25
  55. wolfdocx-0.1.1/src/wolfdocx/assembly.py +0 -463
  56. wolfdocx-0.1.1/src/wolfdocx/document.py +0 -215
  57. wolfdocx-0.1.1/src/wolfdocx/output.py +0 -13
  58. wolfdocx-0.1.1/src/wolfdocx/render_warnings.py +0 -106
  59. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/.gitignore +0 -0
  60. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/LICENSE +0 -0
  61. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/SECURITY.md +0 -0
  62. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/_cache_root.py +0 -0
  63. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/_comment_threads.py +0 -0
  64. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/admission.py +0 -0
  65. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/canonical.py +0 -0
  66. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/content.py +0 -0
  67. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/package.py +0 -0
  68. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/package_profile.py +0 -0
  69. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/paragraph_authoring.py +0 -0
  70. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/regions.py +0 -0
  71. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/run_text.py +0 -0
  72. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/lists.py +0 -0
  73. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/paragraphs.py +0 -0
  74. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/run_edits.py +0 -0
  75. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/runs.py +0 -0
  76. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/sections.py +0 -0
  77. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/styling.py +0 -0
  78. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/session_ops/tables.py +0 -0
  79. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/table_insert.py +0 -0
  80. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/src/wolfdocx/text_effects.py +0 -0
  81. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/__init__.py +0 -0
  82. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/conftest.py +0 -0
  83. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_cells.py +0 -0
  84. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_page_setup.py +0 -0
  85. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_regions.py +0 -0
  86. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_spans.py +0 -0
  87. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_table_cell_properties.py +0 -0
  88. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_table_insert.py +0 -0
  89. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_table_merge.py +0 -0
  90. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_table_properties.py +0 -0
  91. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_table_row_properties.py +0 -0
  92. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_authoring_table_structure.py +0 -0
  93. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_document_session.py +0 -0
  94. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_document_session_paragraphs.py +0 -0
  95. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_find_replace.py +0 -0
  96. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_find_replace_no_match.py +0 -0
  97. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_find_replace_portfolio_edits.py +0 -0
  98. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_node_visitor.py +0 -0
  99. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_package_graph.py +0 -0
  100. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_package_open_tolerance.py +0 -0
  101. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_package_profile.py +0 -0
  102. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_paragraph_authoring.py +0 -0
  103. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_run_text_edit.py +0 -0
  104. {wolfdocx-0.1.1 → wolfdocx-0.1.2}/tests/test_table_delete.py +0 -0
@@ -4,6 +4,31 @@ All notable changes to this project are documented in this file. The format is
4
4
  based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
5
  follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.1.2] - 2026-11-18
8
+
9
+ ### Changed
10
+
11
+ - The package is regenerated from one source commit. Every module is an unmodified
12
+ copy of that commit's file, and `PROVENANCE.md` names the commit and lists the
13
+ SHA-256 of each module.
14
+ - The distribution version is read from `wolfdocx/_version.py`, so the installed
15
+ version and `wolfdocx.__version__` always agree.
16
+ - Requesting a capability this package does not ship, such as PDF output through
17
+ `SaveOptions.create("pdf")`, raises `ModuleNotFoundError` with the message
18
+ `commercial_feature_unavailable`.
19
+
20
+ ### Added
21
+
22
+ - The modules the regenerated core imports: load options, contract records,
23
+ effective paragraph formatting, style resolution, OOXML child ordering, web
24
+ extension part preservation, picture session edits, and the optional-feature
25
+ loader.
26
+ - `wolfdocx.builder.DocumentBuilder` for new documents with paragraphs, runs, tables
27
+ and sections, and `wolfdocx.comments` for comment threads, so the `wolfdocx-docx`
28
+ import alias runs on this package alone. Builder pictures, shapes, hyperlinks,
29
+ document settings and fields raise
30
+ `ModuleNotFoundError("commercial_feature_unavailable")`.
31
+
7
32
  ## [0.1.1] - 2026-11-09
8
33
 
9
34
  Documentation and package metadata only. The library code is unchanged from 0.1.0.
@@ -30,5 +55,6 @@ Documentation and package metadata only. The library code is unchanged from 0.1.
30
55
  - Verified, no-clobber saves that copy every untouched package part byte-for-byte
31
56
  and report changed and raw-copied parts.
32
57
 
33
- [0.1.0]: https://github.com/wolfiesch/wolfdocx-oss/releases/tag/v0.1.0
58
+ [0.1.2]: https://github.com/wolfiesch/wolfdocx-oss/releases/tag/v0.1.2
34
59
  [0.1.1]: https://github.com/wolfiesch/wolfdocx-oss/releases/tag/v0.1.1
60
+ [0.1.0]: https://github.com/wolfiesch/wolfdocx-oss/releases/tag/v0.1.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: wolfdocx
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Read and edit existing Word .docx files in Python. A python-docx alternative that edits documents in place and keeps every untouched part byte-for-byte identical. Pure Python, MIT licensed.
5
5
  Project-URL: Homepage, https://wolfdocx.com
6
6
  Project-URL: Repository, https://github.com/wolfiesch/wolfdocx-oss
@@ -28,7 +28,7 @@ Requires-Python: >=3.11
28
28
  Provides-Extra: dev
29
29
  Requires-Dist: build>=1.2; extra == 'dev'
30
30
  Requires-Dist: pytest>=8.3; extra == 'dev'
31
- Requires-Dist: ruff>=0.12; extra == 'dev'
31
+ Requires-Dist: ruff==0.17.3; extra == 'dev'
32
32
  Requires-Dist: twine>=6.1; extra == 'dev'
33
33
  Description-Content-Type: text/markdown
34
34
 
@@ -39,8 +39,9 @@ Description-Content-Type: text/markdown
39
39
  WolfDocx opens a `.docx`, reads its paragraphs, runs, and tables, applies edits in
40
40
  memory, and saves a new file. Each edit rewrites only the parts it changes; every
41
41
  other part of the package is copied from the source unchanged. An edit that cannot be
42
- applied safely is refused with a code and leaves the document as it was. WolfDocx
43
- does not create documents from scratch, render pages, or convert to PDF.
42
+ applied safely is refused with a code and leaves the document as it was.
43
+ `wolfdocx.builder.DocumentBuilder` writes a new document with paragraphs, runs,
44
+ tables, and sections. WolfDocx does not render pages or convert to PDF.
44
45
 
45
46
  [![PyPI](https://img.shields.io/pypi/v/wolfdocx)](https://pypi.org/project/wolfdocx/)
46
47
  [![Python versions](https://img.shields.io/pypi/pyversions/wolfdocx)](https://pypi.org/project/wolfdocx/)
@@ -122,6 +123,8 @@ All edits are methods on `Document` and are held in memory until `save`.
122
123
  | Sections | `set_page_setup` (page size, orientation, margins, columns), `insert_section_break`, `delete_section_break`, `edit_header_footer` |
123
124
  | Definitions | `styles`, `lists`, `background` as editable copies you assign back |
124
125
  | Approved-value edits | `wolfdocx.reporting`: discover editable cells and paragraphs, then apply edits bound to the source file's SHA-256 |
126
+ | New documents | `wolfdocx.builder.DocumentBuilder`: `write_paragraph`, `append_run`, `insert_table`, `add_table`, `add_section`, `save` |
127
+ | Comments | `wolfdocx.comments`: `discover_comment_targets`, then `author_comment` to insert, update, or delete a comment bound to the source text |
125
128
 
126
129
  ## Quickstart
127
130
 
@@ -462,7 +465,7 @@ editing session and explicit targets. Common python-docx calls map like this:
462
465
  | python-docx | WolfDocx |
463
466
  | --- | --- |
464
467
  | `Document("in.docx")` | `Document("in.docx")`, preferably as a context manager |
465
- | `Document()` (new document from the default template) | Not available. Start from an existing `.docx`. |
468
+ | `Document()` (new document from the default template) | `DocumentBuilder()` from `wolfdocx.builder`, for paragraphs, runs, tables, and sections |
466
469
  | `doc.paragraphs`, `paragraph.text` | `doc.get_story(StoryType.BODY).paragraphs`, `paragraph.to_string("txt")` |
467
470
  | `doc.tables`, `table.rows`, `row.cells`, `cell.text` | `body.tables`, `table.get_child_nodes(NodeType.ROW)`, `row.get_child_nodes(NodeType.CELL)`, `cell.to_string("txt")` |
468
471
  | `run.text = "..."` | `run.text = "..."` on a run node, or `doc.set_run_text(paragraph, run, "...")` |
@@ -483,7 +486,10 @@ Differences to plan for:
483
486
  `set_run_text` (see [How targets are addressed](https://github.com/wolfiesch/wolfdocx-oss#how-targets-are-addressed)).
484
487
  - python-docx has no built-in find and replace; `find_replace` handles phrases split
485
488
  across runs.
486
- - Keep python-docx for building new documents from code. A
489
+ - For python-docx call names, `pip install wolfdocx-docx` adds
490
+ `import wolfdocx_docx as docx`, a subset of the python-docx API that runs on this
491
+ package. Keep python-docx for new documents that need pictures, shapes,
492
+ hyperlinks, or fields. A
487
493
  [comparison](https://wolfdocx.com/python-docx-alternative) and a
488
494
  [migration checklist](https://wolfdocx.com/python-docx-migration) for the
489
495
  Commercial API are on wolfdocx.com.
@@ -493,13 +499,19 @@ Differences to plan for:
493
499
  This repository is WolfDocx Community, the MIT-licensed read and edit core published
494
500
  on PyPI. It does not:
495
501
 
496
- - create a new document without a source `.docx`;
502
+ - add pictures, shapes, hyperlinks, fields, or document settings to a document
503
+ built with `DocumentBuilder`;
497
504
  - lay out pages, render, or convert to PDF or images;
498
505
  - refresh fields or rebuild a table of contents;
499
506
  - run mail merge over `MERGEFIELD` templates or repeat template table rows per record;
500
507
  - merge several documents into one;
501
508
  - open legacy binary `.doc` files (refused with `document_format_unsupported`).
502
509
 
510
+ Requesting one of these from this package, for example `SaveOptions.create("pdf")`
511
+ or `DocumentBuilder.append_image`, raises `ModuleNotFoundError` with the message
512
+ `commercial_feature_unavailable`. Reading, editing, and saving `.docx` never need
513
+ them.
514
+
503
515
  WolfDocx Commercial, an organization-scoped subscription installed from an
504
516
  authenticated package index, and Wolf Runtime, licensed under a written Order, cover
505
517
  the tasks in this table. Guides and access are on [wolfdocx.com](https://wolfdocx.com/):
@@ -548,15 +560,17 @@ repository.
548
560
 
549
561
  ## Status and versioning
550
562
 
551
- WolfDocx 0.1.0, released 2026-10-29, was the first public release. 0.1.1 updates the
552
- documentation and package metadata and leaves the library code unchanged. The PyPI
563
+ WolfDocx 0.1.0, released 2026-10-29, was the first public release. 0.1.1 updated the
564
+ documentation and package metadata. 0.1.2 adds `wolfdocx.builder` and
565
+ `wolfdocx.comments` and is the first release regenerated from one source commit. The PyPI
553
566
  classifier is `Development Status :: 4 - Beta`. The project follows
554
567
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html), under which a 0.x minor
555
568
  release may change the public API; pin a version in production. Changes are recorded
556
569
  in the [changelog](https://github.com/wolfiesch/wolfdocx-oss/blob/main/CHANGELOG.md).
557
- The code was extracted from the author's private source repository and reduced to
558
- this pure-Python subset; see
559
- [PROVENANCE.md](https://github.com/wolfiesch/wolfdocx-oss/blob/main/PROVENANCE.md).
570
+ The `src/wolfdocx` package is regenerated from the author's source repository at a
571
+ single commit, and every module is copied from that commit unchanged;
572
+ [PROVENANCE.md](https://github.com/wolfiesch/wolfdocx-oss/blob/main/PROVENANCE.md)
573
+ names the commit and lists the SHA-256 of each module.
560
574
 
561
575
  ## Security
562
576
 
@@ -580,7 +594,7 @@ include facts derived from document parts, including part text. Set
580
594
 
581
595
  The same MIT-licensed family covers the other Office formats:
582
596
 
583
- - [WolfXL](https://github.com/SynthGL/wolfxl-oss): read, write, and edit Excel
597
+ - [WolfXL](https://pypi.org/project/wolfxl/): read, write, and edit Excel
584
598
  `.xlsx` and `.xlsm` workbooks, an openpyxl alternative (`pip install wolfxl`).
585
599
  - [WolfPPT](https://github.com/wolfiesch/wolfppt-oss): edit PowerPoint `.pptx`
586
600
  decks, a python-pptx alternative (`pip install wolfppt`).
@@ -595,6 +609,8 @@ python -m pytest
595
609
 
596
610
  Open an [issue](https://github.com/wolfiesch/wolfdocx-oss/issues) before a large
597
611
  change. CI runs the same lint and test commands on every push and pull request.
612
+ Changes to `src/wolfdocx` are ported to the source repository and arrive in the
613
+ next regenerated release.
598
614
 
599
615
  ## License
600
616
 
@@ -0,0 +1,78 @@
1
+ # Provenance
2
+
3
+ This tree was regenerated from the author's private source repository at commit
4
+ `a2482de8dc3a1ff50a6585beae13bddab6cf1fc8`.
5
+
6
+ Every file under `src/wolfdocx` is a byte-identical copy of the file at the same
7
+ path in that commit. The other files, including the tests, are the MIT overlay
8
+ kept in the same commit. No file was patched or rewritten while staging.
9
+
10
+ All code in this repository is released under the MIT license. See
11
+ [LICENSE](LICENSE).
12
+
13
+ ## Modules
14
+
15
+ | Path | SHA-256 |
16
+ | --- | --- |
17
+ | `src/wolfdocx/__init__.py` | `66d08e7f44a34ff9b83c5ad2effb3a0ea155f7ee37f62008f4c69659b33d58ea` |
18
+ | `src/wolfdocx/_cache_root.py` | `ce89969bcb75dc1a689e2850ba9d9799b36b8e4144e33374211584d941104f1b` |
19
+ | `src/wolfdocx/_comment_extensions.py` | `9cdac500f2891bfbe5b319a205c11e97af463749bcc985bdabdad322c2a0f281` |
20
+ | `src/wolfdocx/_comment_threads.py` | `121b4abff2b67975613f2098df9401526fd5b3b419eea8520a473a9270731fdd` |
21
+ | `src/wolfdocx/_defaults.py` | `2cd9b89d4973d27c67af3119cd19cda77795d7de26222a1846cd70dad9850099` |
22
+ | `src/wolfdocx/_inspection_cache.py` | `b3701b27acc62eb2d75dd79a26d68796a03708a199fbfee49cbdd77cd2d38793` |
23
+ | `src/wolfdocx/_optional.py` | `82f7fb6805bb2a4dff1ca592142b6fb0ea410059d636a188ef5e8df8b1c1ebbe` |
24
+ | `src/wolfdocx/_version.py` | `61135c0c1800c522beae099409d4a8bfc28659ad88b60ba4aec182011e99dfd5` |
25
+ | `src/wolfdocx/admission.py` | `6ad0378e0fb12c7d51b384e505280e6f3b633b49de7c3d2ccc92b74ff373a3bd` |
26
+ | `src/wolfdocx/assembly.py` | `3ae2596fb8fbd4e81c1fbe61a0402a7e4642079c1548082a027f0d2350298036` |
27
+ | `src/wolfdocx/authoring.py` | `a14cd260fd34e14d3203673e905cdd44e49227ff84e12f57e4f96b4e5c1b0597` |
28
+ | `src/wolfdocx/builder.py` | `4670a16e1ff79388dbab3a4603e7a1b523bcfbfb26a87adf566e9ca8935a3c91` |
29
+ | `src/wolfdocx/canonical.py` | `a92cd0a7d7507332985eaa392f3d992c4b52cdd56abbd2103bfce92dda94a356` |
30
+ | `src/wolfdocx/comments.py` | `91be968448f849d7bc61500470b2b36662b52ca5b0e8d60b9f6c9cfe502dd563` |
31
+ | `src/wolfdocx/content.py` | `1bcfb8c2dea81723dcaf7c1f03eda85487ff123268cc32b2e2a996fefbb294b6` |
32
+ | `src/wolfdocx/contracts.py` | `0f61ab83129ee978a6e2e7fc942f4244fba8c16a2c59efb4c5ba91f48b5a9a96` |
33
+ | `src/wolfdocx/document.py` | `8130d50ffab719dbde38aa4ca99c74fbb43ac15fdf470d1626f21f31c386e004` |
34
+ | `src/wolfdocx/errors.py` | `681d35ffd3723f791568aa0381e1811079bc931886413638ea732d725aae8042` |
35
+ | `src/wolfdocx/find_replace.py` | `d1b4d00f1f6a5533f1e55b7e5b27ef5b30bfa36bbb924346edcc77651d7e2ce4` |
36
+ | `src/wolfdocx/formatting.py` | `205b6b11b67a9c3b2f27ea3677ae78dad0da48ccd9cd297e0686669fc293a216` |
37
+ | `src/wolfdocx/inspect.py` | `2de3f13ff85bfd8817bb4070f3f690636045b68ea60deb2cf432f35adb0c409a` |
38
+ | `src/wolfdocx/load_options.py` | `d4cf2ce9c823ab96043e6e9a75781a1f4c2c6f729ed1576e27ff5e719ef68ea8` |
39
+ | `src/wolfdocx/model.py` | `0781d31e653bb480a59649179d5ecd626a7a5ef9be55b672fe03c83b3a337f1e` |
40
+ | `src/wolfdocx/numbering_authoring.py` | `e6b21a64bf68d53ea4754c35b6bb72dcb022efa06e649819814989a946a6c6d1` |
41
+ | `src/wolfdocx/ooxml_order.py` | `10860557c92c66dbdc472589a91c28415e90db5189fd664734d7589ecb5c3d23` |
42
+ | `src/wolfdocx/output.py` | `d3bff54b05f70e1e99774ae358662f206bd115f7ff180c79661b547f9d92c0d8` |
43
+ | `src/wolfdocx/package.py` | `c27a7fce8b2cb34ae80519e352585033bd3a22ade007c00c6edb025189ad6a6c` |
44
+ | `src/wolfdocx/package_profile.py` | `d5dca54e9ffaa3a4e2e76e2ff88174488cd5671a6c296adace4a2e39c3e65a08` |
45
+ | `src/wolfdocx/page_setup.py` | `70aad0f5997c7d70840a60f34f5e1a5b12b609b9a107db72789b3dd3df5ec96f` |
46
+ | `src/wolfdocx/paragraph_authoring.py` | `63b5f1f471ff90a4f50f79f0c05c1247f8cb3a4990dbf7fd7a272fec5dcd6bb0` |
47
+ | `src/wolfdocx/paragraph_format_effective.py` | `a8e84d1c36184a31a5e573157f4318c68076c008fbb39b53740769e0b234c991` |
48
+ | `src/wolfdocx/properties.py` | `6271ef12e8d7671e699058197665eb4d80efd4ced155f88ab8df444cb6ae5d98` |
49
+ | `src/wolfdocx/protection.py` | `628a2c5d9bf32e5480b0895f62bb77258111d34b729a5f2ef108c69a43808db0` |
50
+ | `src/wolfdocx/regions.py` | `8af0ec03a2d7992492a0df75fcc048ff08dc65a91324b6f3973afc835d55d0f1` |
51
+ | `src/wolfdocx/render_warnings.py` | `8027b84177fb7bb8721f5c3b11ef7e6bd220248db53b3b1d32d035f63ea110ab` |
52
+ | `src/wolfdocx/reporting.py` | `7641eb6e5040ba78d5bcef35af041344cb33528836b767ef6641bcb4730ff75c` |
53
+ | `src/wolfdocx/review.py` | `73229c9aef688c958a15cecc1b11b1177902f148839bacc40ea1d33dcf1747d4` |
54
+ | `src/wolfdocx/run_text.py` | `af2becdc8f58188ac540b99c1fc8705738e146b35a84d7d411abbf13f5f6798d` |
55
+ | `src/wolfdocx/section_break.py` | `bc66447d8c43df2cdab34f8f21eaaaf78eec4b1d22007c17521d097f16d38700` |
56
+ | `src/wolfdocx/session_ops/__init__.py` | `d50ab4f6ff97b26343d0797ef8c82728f5815ee78d8571f5e755cf09ae649f38` |
57
+ | `src/wolfdocx/session_ops/_bridge.py` | `8578a0d527ceb270a76f5c1f3125c58775820fe4ae1e1777f48dccbbaf30e957` |
58
+ | `src/wolfdocx/session_ops/lists.py` | `dd9ae99846ae74a005ea5f0f46a907b8569f2f4dc3d51adcfcb34430d1372a13` |
59
+ | `src/wolfdocx/session_ops/paragraphs.py` | `0b9cb3c562f6939f0d7ec1abb01db7dcd40851f47e75cb99263c28d72b76e6a9` |
60
+ | `src/wolfdocx/session_ops/pictures.py` | `b01b938157903a548438d10dbfff565a39ae693d44b7b5f253f421b3e18ed5d3` |
61
+ | `src/wolfdocx/session_ops/rich_objects.py` | `f7225622bce4dbda1aaecfb687c5440d8ef1ab306203b4be36bd906963e2deb3` |
62
+ | `src/wolfdocx/session_ops/run_edits.py` | `51d8c1d9afeb52432d15b194841c7e0d4518f443bf2f7039875be9477877256d` |
63
+ | `src/wolfdocx/session_ops/runs.py` | `2250f1b9a78868cb4a6b70459bbf732a41cb747758c0c5e9124f2785ab00ad03` |
64
+ | `src/wolfdocx/session_ops/sections.py` | `3727eaf90215b7a729338a8761312e53076502c9700ea99a9d72d2221605de59` |
65
+ | `src/wolfdocx/session_ops/styling.py` | `2ccde7c54263c35c5447d6409ceefdbf1d8cc59498b86cce3bda682273e2d29b` |
66
+ | `src/wolfdocx/session_ops/tables.py` | `541902ebb7cd9233a19d878f885bdfcaf085bcf94a4a0912b0e731e91c2156df` |
67
+ | `src/wolfdocx/style_resolution.py` | `b770207ab6d760e4fd1a1e80c70887846ed8cc3e801bc3b601bd11370cbecc7d` |
68
+ | `src/wolfdocx/styles_authoring.py` | `fc0c7faf16192976d821ed76f237f49c601abbb8f4c0c46a38137a3232db5f8d` |
69
+ | `src/wolfdocx/table_cell_properties.py` | `70ebd55805684a1e59baf5b4e978c3c022b70566b9364bceb8e1fb864392d08c` |
70
+ | `src/wolfdocx/table_column.py` | `adbc9835517eb5702b415621a95cbe3c8b1254f69f509a79e4566b24fdea5e51` |
71
+ | `src/wolfdocx/table_delete.py` | `cd285f32d7385ccb4f4c2124bd6440ad3b47c4e047415e281248a5008c074514` |
72
+ | `src/wolfdocx/table_insert.py` | `11df242d34389191f9855b53df412c59607962ef9a821475b4da206b207a8158` |
73
+ | `src/wolfdocx/table_merge.py` | `5bfa5ffeb6a3f8923a28c3f14a6d9adbb4f85da29a08573118559ca5fc327162` |
74
+ | `src/wolfdocx/table_properties.py` | `91da288b755e483f42350a19f18ac905c83c3b68b9fdcc72ba7043f38eba366c` |
75
+ | `src/wolfdocx/table_row_properties.py` | `d83ae3384159445b0545071cf9b57bf57034650fec4e816e9e35a0954ad23ea1` |
76
+ | `src/wolfdocx/table_structure.py` | `bc545a8c37e8d748ae27a2fe4134aac7789ea2d12416642ee11aa014539a7f44` |
77
+ | `src/wolfdocx/text_effects.py` | `65bc0572d480b06e035541065c4af4578744726493b8cd055b8d7210adba36e3` |
78
+ | `src/wolfdocx/web_extensions.py` | `18794efd3afd37d3d8b67201d357bbb72023011a9893a22588aca68642875999` |
@@ -5,8 +5,9 @@
5
5
  WolfDocx opens a `.docx`, reads its paragraphs, runs, and tables, applies edits in
6
6
  memory, and saves a new file. Each edit rewrites only the parts it changes; every
7
7
  other part of the package is copied from the source unchanged. An edit that cannot be
8
- applied safely is refused with a code and leaves the document as it was. WolfDocx
9
- does not create documents from scratch, render pages, or convert to PDF.
8
+ applied safely is refused with a code and leaves the document as it was.
9
+ `wolfdocx.builder.DocumentBuilder` writes a new document with paragraphs, runs,
10
+ tables, and sections. WolfDocx does not render pages or convert to PDF.
10
11
 
11
12
  [![PyPI](https://img.shields.io/pypi/v/wolfdocx)](https://pypi.org/project/wolfdocx/)
12
13
  [![Python versions](https://img.shields.io/pypi/pyversions/wolfdocx)](https://pypi.org/project/wolfdocx/)
@@ -88,6 +89,8 @@ All edits are methods on `Document` and are held in memory until `save`.
88
89
  | Sections | `set_page_setup` (page size, orientation, margins, columns), `insert_section_break`, `delete_section_break`, `edit_header_footer` |
89
90
  | Definitions | `styles`, `lists`, `background` as editable copies you assign back |
90
91
  | Approved-value edits | `wolfdocx.reporting`: discover editable cells and paragraphs, then apply edits bound to the source file's SHA-256 |
92
+ | New documents | `wolfdocx.builder.DocumentBuilder`: `write_paragraph`, `append_run`, `insert_table`, `add_table`, `add_section`, `save` |
93
+ | Comments | `wolfdocx.comments`: `discover_comment_targets`, then `author_comment` to insert, update, or delete a comment bound to the source text |
91
94
 
92
95
  ## Quickstart
93
96
 
@@ -428,7 +431,7 @@ editing session and explicit targets. Common python-docx calls map like this:
428
431
  | python-docx | WolfDocx |
429
432
  | --- | --- |
430
433
  | `Document("in.docx")` | `Document("in.docx")`, preferably as a context manager |
431
- | `Document()` (new document from the default template) | Not available. Start from an existing `.docx`. |
434
+ | `Document()` (new document from the default template) | `DocumentBuilder()` from `wolfdocx.builder`, for paragraphs, runs, tables, and sections |
432
435
  | `doc.paragraphs`, `paragraph.text` | `doc.get_story(StoryType.BODY).paragraphs`, `paragraph.to_string("txt")` |
433
436
  | `doc.tables`, `table.rows`, `row.cells`, `cell.text` | `body.tables`, `table.get_child_nodes(NodeType.ROW)`, `row.get_child_nodes(NodeType.CELL)`, `cell.to_string("txt")` |
434
437
  | `run.text = "..."` | `run.text = "..."` on a run node, or `doc.set_run_text(paragraph, run, "...")` |
@@ -449,7 +452,10 @@ Differences to plan for:
449
452
  `set_run_text` (see [How targets are addressed](https://github.com/wolfiesch/wolfdocx-oss#how-targets-are-addressed)).
450
453
  - python-docx has no built-in find and replace; `find_replace` handles phrases split
451
454
  across runs.
452
- - Keep python-docx for building new documents from code. A
455
+ - For python-docx call names, `pip install wolfdocx-docx` adds
456
+ `import wolfdocx_docx as docx`, a subset of the python-docx API that runs on this
457
+ package. Keep python-docx for new documents that need pictures, shapes,
458
+ hyperlinks, or fields. A
453
459
  [comparison](https://wolfdocx.com/python-docx-alternative) and a
454
460
  [migration checklist](https://wolfdocx.com/python-docx-migration) for the
455
461
  Commercial API are on wolfdocx.com.
@@ -459,13 +465,19 @@ Differences to plan for:
459
465
  This repository is WolfDocx Community, the MIT-licensed read and edit core published
460
466
  on PyPI. It does not:
461
467
 
462
- - create a new document without a source `.docx`;
468
+ - add pictures, shapes, hyperlinks, fields, or document settings to a document
469
+ built with `DocumentBuilder`;
463
470
  - lay out pages, render, or convert to PDF or images;
464
471
  - refresh fields or rebuild a table of contents;
465
472
  - run mail merge over `MERGEFIELD` templates or repeat template table rows per record;
466
473
  - merge several documents into one;
467
474
  - open legacy binary `.doc` files (refused with `document_format_unsupported`).
468
475
 
476
+ Requesting one of these from this package, for example `SaveOptions.create("pdf")`
477
+ or `DocumentBuilder.append_image`, raises `ModuleNotFoundError` with the message
478
+ `commercial_feature_unavailable`. Reading, editing, and saving `.docx` never need
479
+ them.
480
+
469
481
  WolfDocx Commercial, an organization-scoped subscription installed from an
470
482
  authenticated package index, and Wolf Runtime, licensed under a written Order, cover
471
483
  the tasks in this table. Guides and access are on [wolfdocx.com](https://wolfdocx.com/):
@@ -514,15 +526,17 @@ repository.
514
526
 
515
527
  ## Status and versioning
516
528
 
517
- WolfDocx 0.1.0, released 2026-10-29, was the first public release. 0.1.1 updates the
518
- documentation and package metadata and leaves the library code unchanged. The PyPI
529
+ WolfDocx 0.1.0, released 2026-10-29, was the first public release. 0.1.1 updated the
530
+ documentation and package metadata. 0.1.2 adds `wolfdocx.builder` and
531
+ `wolfdocx.comments` and is the first release regenerated from one source commit. The PyPI
519
532
  classifier is `Development Status :: 4 - Beta`. The project follows
520
533
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html), under which a 0.x minor
521
534
  release may change the public API; pin a version in production. Changes are recorded
522
535
  in the [changelog](https://github.com/wolfiesch/wolfdocx-oss/blob/main/CHANGELOG.md).
523
- The code was extracted from the author's private source repository and reduced to
524
- this pure-Python subset; see
525
- [PROVENANCE.md](https://github.com/wolfiesch/wolfdocx-oss/blob/main/PROVENANCE.md).
536
+ The `src/wolfdocx` package is regenerated from the author's source repository at a
537
+ single commit, and every module is copied from that commit unchanged;
538
+ [PROVENANCE.md](https://github.com/wolfiesch/wolfdocx-oss/blob/main/PROVENANCE.md)
539
+ names the commit and lists the SHA-256 of each module.
526
540
 
527
541
  ## Security
528
542
 
@@ -546,7 +560,7 @@ include facts derived from document parts, including part text. Set
546
560
 
547
561
  The same MIT-licensed family covers the other Office formats:
548
562
 
549
- - [WolfXL](https://github.com/SynthGL/wolfxl-oss): read, write, and edit Excel
563
+ - [WolfXL](https://pypi.org/project/wolfxl/): read, write, and edit Excel
550
564
  `.xlsx` and `.xlsm` workbooks, an openpyxl alternative (`pip install wolfxl`).
551
565
  - [WolfPPT](https://github.com/wolfiesch/wolfppt-oss): edit PowerPoint `.pptx`
552
566
  decks, a python-pptx alternative (`pip install wolfppt`).
@@ -561,6 +575,8 @@ python -m pytest
561
575
 
562
576
  Open an [issue](https://github.com/wolfiesch/wolfdocx-oss/issues) before a large
563
577
  change. CI runs the same lint and test commands on every push and pull request.
578
+ Changes to `src/wolfdocx` are ported to the source repository and arrive in the
579
+ next regenerated release.
564
580
 
565
581
  ## License
566
582
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "wolfdocx"
7
- version = "0.1.1"
7
+ dynamic = ["version"]
8
8
  description = "Read and edit existing Word .docx files in Python. A python-docx alternative that edits documents in place and keeps every untouched part byte-for-byte identical. Pure Python, MIT licensed."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -45,7 +45,7 @@ classifiers = [
45
45
  dev = [
46
46
  "build>=1.2",
47
47
  "pytest>=8.3",
48
- "ruff>=0.12",
48
+ "ruff==0.17.3",
49
49
  "twine>=6.1",
50
50
  ]
51
51
 
@@ -55,6 +55,9 @@ Repository = "https://github.com/wolfiesch/wolfdocx-oss"
55
55
  Issues = "https://github.com/wolfiesch/wolfdocx-oss/issues"
56
56
  Changelog = "https://github.com/wolfiesch/wolfdocx-oss/blob/main/CHANGELOG.md"
57
57
 
58
+ [tool.hatch.version]
59
+ path = "src/wolfdocx/_version.py"
60
+
58
61
  [tool.hatch.build.targets.wheel]
59
62
  packages = ["src/wolfdocx"]
60
63
 
@@ -76,7 +79,5 @@ testpaths = ["tests"]
76
79
  line-length = 100
77
80
  target-version = "py311"
78
81
 
79
- [tool.ruff.lint]
80
- # Pyflakes plus the pycodestyle error groups that flag real defects. Line length is
81
- # left to formatting, matching the configuration this code was written against.
82
- select = ["E4", "E7", "E9", "F"]
82
+ [tool.ruff.lint.isort]
83
+ known-first-party = ["wolfdocx", "tests"]