python-hwpx 2.10.0__tar.gz → 2.10.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 (115) hide show
  1. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/NOTICE +8 -0
  2. {python_hwpx-2.10.0/src/python_hwpx.egg-info → python_hwpx-2.10.2}/PKG-INFO +49 -1
  3. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/README.md +48 -0
  4. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/pyproject.toml +1 -1
  5. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/authoring.py +785 -27
  6. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/builder/core.py +267 -59
  7. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/builder/report.py +32 -0
  8. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/document.py +14 -8
  9. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/opc/package.py +5 -1
  10. python_hwpx-2.10.2/src/hwpx/oxml/body.py +766 -0
  11. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/document.py +212 -39
  12. python_hwpx-2.10.2/src/hwpx/oxml/namespaces.py +181 -0
  13. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/parser.py +7 -0
  14. python_hwpx-2.10.2/src/hwpx/tools/generic_inventory.py +156 -0
  15. python_hwpx-2.10.2/src/hwpx/tools/id_integrity.py +275 -0
  16. python_hwpx-2.10.2/src/hwpx/tools/markdown_export.py +488 -0
  17. python_hwpx-2.10.2/src/hwpx/tools/report_parser.py +135 -0
  18. python_hwpx-2.10.2/src/hwpx/tools/report_utils.py +132 -0
  19. python_hwpx-2.10.2/src/hwpx/tools/roundtrip_diff.py +50 -0
  20. python_hwpx-2.10.2/src/hwpx/tools/table_cleanup.py +61 -0
  21. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/table_navigation.py +77 -1
  22. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/text_extractor.py +33 -25
  23. {python_hwpx-2.10.0 → python_hwpx-2.10.2/src/python_hwpx.egg-info}/PKG-INFO +49 -1
  24. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/python_hwpx.egg-info/SOURCES.txt +19 -0
  25. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_builder_core.py +2 -2
  26. python_hwpx-2.10.2/tests/test_builder_plan_v2.py +308 -0
  27. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_builder_vertical_slice.py +1 -1
  28. python_hwpx-2.10.2/tests/test_coverage_promotion.py +405 -0
  29. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_document_formatting.py +42 -0
  30. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_document_plan.py +28 -0
  31. python_hwpx-2.10.2/tests/test_document_plan_computed_fields.py +137 -0
  32. python_hwpx-2.10.2/tests/test_government_report_preset.py +121 -0
  33. python_hwpx-2.10.2/tests/test_government_table_profile.py +78 -0
  34. python_hwpx-2.10.2/tests/test_id_integrity.py +93 -0
  35. python_hwpx-2.10.2/tests/test_markdown_export.py +436 -0
  36. python_hwpx-2.10.2/tests/test_namespace_handling.py +134 -0
  37. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_opc_package.py +16 -0
  38. python_hwpx-2.10.2/tests/test_report_parser.py +79 -0
  39. python_hwpx-2.10.2/tests/test_report_utils.py +56 -0
  40. python_hwpx-2.10.2/tests/test_roundtrip_fidelity.py +92 -0
  41. python_hwpx-2.10.2/tests/test_table_cleanup.py +49 -0
  42. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_table_navigation.py +57 -31
  43. python_hwpx-2.10.0/src/hwpx/oxml/body.py +0 -457
  44. python_hwpx-2.10.0/src/hwpx/oxml/namespaces.py +0 -50
  45. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/LICENSE +0 -0
  46. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/setup.cfg +0 -0
  47. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/__init__.py +0 -0
  48. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/builder/__init__.py +0 -0
  49. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/data/Skeleton.hwpx +0 -0
  50. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/form_fill.py +0 -0
  51. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/opc/relationships.py +0 -0
  52. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/opc/xml_utils.py +0 -0
  53. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/__init__.py +0 -0
  54. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/common.py +0 -0
  55. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/header.py +0 -0
  56. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/header_part.py +0 -0
  57. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/memo.py +0 -0
  58. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/paragraph.py +0 -0
  59. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/schema.py +0 -0
  60. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/section.py +0 -0
  61. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/table.py +0 -0
  62. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/oxml/utils.py +0 -0
  63. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/package.py +0 -0
  64. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/presets/__init__.py +0 -0
  65. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/presets/proposal.py +0 -0
  66. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/py.typed +0 -0
  67. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/template_formfit.py +0 -0
  68. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/templates.py +0 -0
  69. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/__init__.py +0 -0
  70. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/_schemas/header.xsd +0 -0
  71. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/_schemas/section.xsd +0 -0
  72. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/archive_cli.py +0 -0
  73. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/exporter.py +0 -0
  74. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/object_finder.py +0 -0
  75. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/package_validator.py +0 -0
  76. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/page_guard.py +0 -0
  77. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/recover.py +0 -0
  78. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/repair.py +0 -0
  79. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/template_analyzer.py +0 -0
  80. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/text_extract_cli.py +0 -0
  81. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/hwpx/tools/validator.py +0 -0
  82. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/python_hwpx.egg-info/dependency_links.txt +0 -0
  83. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/python_hwpx.egg-info/entry_points.txt +0 -0
  84. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/python_hwpx.egg-info/requires.txt +0 -0
  85. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/src/python_hwpx.egg-info/top_level.txt +0 -0
  86. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_coverage_targets.py +0 -0
  87. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_deviations_registry.py +0 -0
  88. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_document_context_manager.py +0 -0
  89. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_document_save_api.py +0 -0
  90. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_form_fill_split_run.py +0 -0
  91. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_gap_closure_tools.py +0 -0
  92. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_hp_tab_support.py +0 -0
  93. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_hwpxlib_corpus_read.py +0 -0
  94. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_id_generator_range.py +0 -0
  95. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_inline_models.py +0 -0
  96. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_integration_hwpx_compatibility.py +0 -0
  97. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_integration_roundtrip.py +0 -0
  98. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_memo_and_style_editing.py +0 -0
  99. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_new_features.py +0 -0
  100. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_oxml_parsing.py +0 -0
  101. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_packaging_license_metadata.py +0 -0
  102. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_packaging_py_typed.py +0 -0
  103. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_paragraph_section_management.py +0 -0
  104. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_proposal_preset.py +0 -0
  105. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_recover_broken_zip.py +0 -0
  106. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_repair_repack.py +0 -0
  107. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_repr_snapshots.py +0 -0
  108. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_section_headers.py +0 -0
  109. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_skeleton_template_ids.py +0 -0
  110. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_split_merged_cell.py +0 -0
  111. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_tables_default_border.py +0 -0
  112. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_template_formfit.py +0 -0
  113. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_text_extractor_annotations.py +0 -0
  114. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_validation_severity.py +0 -0
  115. {python_hwpx-2.10.0 → python_hwpx-2.10.2}/tests/test_version_metadata.py +0 -0
@@ -20,6 +20,14 @@ reimplemented from public references, without copying source code:
20
20
  - sakada3/hwp-ops (Apache-2.0): split-run placeholder scan/fill behavior
21
21
  ideas, charPrIDRef heterogeneity warning, and touched-paragraph layout-cache
22
22
  invalidation.
23
+ - hancom-io/hwpx-owpml-model (Apache-2.0): C1 coverage promotion structure
24
+ observations for paragraph line segment elements (`linesegarray`, `lineseg`)
25
+ and rendering matrix elements (`transMatrix`, `scaMatrix`, `rotMatrix`) from
26
+ public model headers only.
27
+ - hancom-io/hwpx-owpml-model (Apache-2.0): C1b form-control promotion
28
+ structure observations for `edit`, `comboBox`, and button-family controls
29
+ from public model headers only. hwpxlib sample packages were used only as
30
+ structure and roundtrip fixtures.
23
31
 
24
32
  These form-fill references were used as behavior evidence only. The
25
33
  implementation is a clean-room Python implementation; no source code was
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-hwpx
3
- Version: 2.10.0
3
+ Version: 2.10.2
4
4
  Summary: 한글 없이 HWPX 문서를 열고, 편집하고, 생성하고, 검증하는 Python 자동화 라이브러리
5
5
  Author: python-hwpx Maintainers
6
6
  License-Expression: Apache-2.0
@@ -115,6 +115,47 @@ hwpx-validate-package 보고서.hwpx
115
115
  hwpx-analyze-template 보고서.hwpx
116
116
  ```
117
117
 
118
+ ### 4. 풍부한 Markdown 변환 (서식·표·각주·이미지 보존)
119
+
120
+ `export_markdown()`는 단순 평문 추출이고, `export_rich_markdown()`는 인라인 서식(`**굵게**`, `*기울임*`, `~~취소선~~`),
121
+ 표(중첩 포함, colspan/rowspan 안전), 도형 텍스트, 이미지, 각주/미주, 하이퍼링크, 제목(`#`/`##`) 자동 감지까지 보존한다.
122
+
123
+ ```python
124
+ from hwpx import HwpxDocument
125
+
126
+ doc = HwpxDocument.open("보고서.hwpx")
127
+
128
+ md = doc.export_rich_markdown(
129
+ image_dir="out/images", # BinData 이미지를 디스크에 추출
130
+ image_ref_prefix="images/", # 마크다운 내 ![](images/...) 경로 접두
131
+ detect_headings=True, # Ⅰ./1. 패턴 기반 #/## 자동
132
+ )
133
+ print(md)
134
+ ```
135
+
136
+ 문자열·경로·바이트도 그대로 받는다:
137
+
138
+ ```python
139
+ from hwpx.tools.markdown_export import export_markdown
140
+
141
+ md = export_markdown("보고서.hwpx") # 경로
142
+ md = export_markdown(open("a.hwpx", "rb").read()) # bytes
143
+ ```
144
+
145
+ ### 5. 각주 본문에 혼합 서식 / 하이퍼링크 추가
146
+
147
+ `HwpxOxmlNote`에 `body_paragraph`, `add_run`, `add_hyperlink` helper가 있어 각주 본문을
148
+ 직접 paragraph로 다루지 않고도 인라인 서식·링크를 손쉽게 채울 수 있다.
149
+
150
+ ```python
151
+ para = section.paragraphs[0]
152
+ note = para.add_footnote("") # 빈 각주 생성 후 본문 구성
153
+ note.add_run("자세한 내용은 ", )
154
+ note.add_run("정부 공식 사이트", bold=True)
155
+ note.add_run("를 참고하라: ")
156
+ note.add_hyperlink("https://www.kasa.go.kr", "우주항공청")
157
+ ```
158
+
118
159
  처음에는 `open/new -> edit/extract -> save_to_path` 흐름만 잡으면 된다. 패키지 구조, XML 파트, 템플릿 회귀 점검은 필요할 때만 확장하면 된다.
119
160
 
120
161
  ## 어디부터 읽으면 되나
@@ -244,6 +285,7 @@ doc.set_footer_text("1 / 10", page_type="BOTH")
244
285
  # 표 셀 병합·분할
245
286
  table.merge_cells(0, 0, 1, 1) # (0,0)~(1,1) 병합
246
287
  table.set_cell_text(0, 0, "병합된 셀", logical=True, split_merged=True)
288
+ table.set_cell_text(0, 0, "line 1\nline 2", split_paragraphs=True)
247
289
 
248
290
  # 양식형 표 자동 채우기
249
291
  form = doc.add_table(2, 2)
@@ -257,6 +299,12 @@ doc.fill_by_path({
257
299
  })
258
300
  ```
259
301
 
302
+ `doc.paragraphs`의 인덱스는 본문 직속 문단 0-based 기준입니다. 표 안 문단은
303
+ 본문 `paragraph_index`에 섞지 않고 `get_table_map()`의 cell `location`
304
+ (`table_index`, `row`, `col`, `cell_paragraph_index`)으로 다룹니다.
305
+ `get_table_map()`은 `caption_text`와 `preceding_paragraph_text`를 분리해
306
+ 반환하고, 셀 미리보기의 여러 문단은 `\n`으로 유지합니다.
307
+
260
308
  ### 🔍 텍스트 추출 & 검색
261
309
 
262
310
  ```python
@@ -79,6 +79,47 @@ hwpx-validate-package 보고서.hwpx
79
79
  hwpx-analyze-template 보고서.hwpx
80
80
  ```
81
81
 
82
+ ### 4. 풍부한 Markdown 변환 (서식·표·각주·이미지 보존)
83
+
84
+ `export_markdown()`는 단순 평문 추출이고, `export_rich_markdown()`는 인라인 서식(`**굵게**`, `*기울임*`, `~~취소선~~`),
85
+ 표(중첩 포함, colspan/rowspan 안전), 도형 텍스트, 이미지, 각주/미주, 하이퍼링크, 제목(`#`/`##`) 자동 감지까지 보존한다.
86
+
87
+ ```python
88
+ from hwpx import HwpxDocument
89
+
90
+ doc = HwpxDocument.open("보고서.hwpx")
91
+
92
+ md = doc.export_rich_markdown(
93
+ image_dir="out/images", # BinData 이미지를 디스크에 추출
94
+ image_ref_prefix="images/", # 마크다운 내 ![](images/...) 경로 접두
95
+ detect_headings=True, # Ⅰ./1. 패턴 기반 #/## 자동
96
+ )
97
+ print(md)
98
+ ```
99
+
100
+ 문자열·경로·바이트도 그대로 받는다:
101
+
102
+ ```python
103
+ from hwpx.tools.markdown_export import export_markdown
104
+
105
+ md = export_markdown("보고서.hwpx") # 경로
106
+ md = export_markdown(open("a.hwpx", "rb").read()) # bytes
107
+ ```
108
+
109
+ ### 5. 각주 본문에 혼합 서식 / 하이퍼링크 추가
110
+
111
+ `HwpxOxmlNote`에 `body_paragraph`, `add_run`, `add_hyperlink` helper가 있어 각주 본문을
112
+ 직접 paragraph로 다루지 않고도 인라인 서식·링크를 손쉽게 채울 수 있다.
113
+
114
+ ```python
115
+ para = section.paragraphs[0]
116
+ note = para.add_footnote("") # 빈 각주 생성 후 본문 구성
117
+ note.add_run("자세한 내용은 ", )
118
+ note.add_run("정부 공식 사이트", bold=True)
119
+ note.add_run("를 참고하라: ")
120
+ note.add_hyperlink("https://www.kasa.go.kr", "우주항공청")
121
+ ```
122
+
82
123
  처음에는 `open/new -> edit/extract -> save_to_path` 흐름만 잡으면 된다. 패키지 구조, XML 파트, 템플릿 회귀 점검은 필요할 때만 확장하면 된다.
83
124
 
84
125
  ## 어디부터 읽으면 되나
@@ -208,6 +249,7 @@ doc.set_footer_text("1 / 10", page_type="BOTH")
208
249
  # 표 셀 병합·분할
209
250
  table.merge_cells(0, 0, 1, 1) # (0,0)~(1,1) 병합
210
251
  table.set_cell_text(0, 0, "병합된 셀", logical=True, split_merged=True)
252
+ table.set_cell_text(0, 0, "line 1\nline 2", split_paragraphs=True)
211
253
 
212
254
  # 양식형 표 자동 채우기
213
255
  form = doc.add_table(2, 2)
@@ -221,6 +263,12 @@ doc.fill_by_path({
221
263
  })
222
264
  ```
223
265
 
266
+ `doc.paragraphs`의 인덱스는 본문 직속 문단 0-based 기준입니다. 표 안 문단은
267
+ 본문 `paragraph_index`에 섞지 않고 `get_table_map()`의 cell `location`
268
+ (`table_index`, `row`, `col`, `cell_paragraph_index`)으로 다룹니다.
269
+ `get_table_map()`은 `caption_text`와 `preceding_paragraph_text`를 분리해
270
+ 반환하고, 셀 미리보기의 여러 문단은 `\n`으로 유지합니다.
271
+
224
272
  ### 🔍 텍스트 추출 & 검색
225
273
 
226
274
  ```python
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-hwpx"
7
- version = "2.10.0"
7
+ version = "2.10.2"
8
8
  description = "한글 없이 HWPX 문서를 열고, 편집하고, 생성하고, 검증하는 Python 자동화 라이브러리"
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  license = "Apache-2.0"