python-hwpx 2.8.3__tar.gz → 2.9.1__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 (76) hide show
  1. python_hwpx-2.9.1/LICENSE +178 -0
  2. python_hwpx-2.9.1/NOTICE +14 -0
  3. {python_hwpx-2.8.3/src/python_hwpx.egg-info → python_hwpx-2.9.1}/PKG-INFO +138 -80
  4. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/README.md +132 -75
  5. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/pyproject.toml +6 -6
  6. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/__init__.py +6 -1
  7. python_hwpx-2.9.1/src/hwpx/data/Skeleton.hwpx +0 -0
  8. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/document.py +33 -1
  9. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/opc/package.py +1 -0
  10. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/opc/relationships.py +1 -0
  11. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/opc/xml_utils.py +1 -0
  12. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/__init__.py +1 -0
  13. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/body.py +23 -1
  14. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/common.py +1 -0
  15. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/document.py +150 -29
  16. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/header.py +1 -0
  17. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/header_part.py +1 -0
  18. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/memo.py +1 -0
  19. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/namespaces.py +1 -0
  20. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/paragraph.py +1 -0
  21. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/parser.py +1 -0
  22. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/schema.py +1 -0
  23. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/section.py +1 -0
  24. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/table.py +1 -0
  25. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/oxml/utils.py +1 -0
  26. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/package.py +1 -0
  27. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/templates.py +1 -0
  28. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/__init__.py +25 -0
  29. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/archive_cli.py +1 -0
  30. python_hwpx-2.9.1/src/hwpx/tools/exporter.py +169 -0
  31. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/object_finder.py +1 -0
  32. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/package_validator.py +1 -0
  33. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/page_guard.py +1 -0
  34. python_hwpx-2.9.1/src/hwpx/tools/table_navigation.py +458 -0
  35. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/template_analyzer.py +1 -0
  36. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/text_extract_cli.py +1 -0
  37. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/text_extractor.py +5 -1
  38. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/validator.py +1 -0
  39. {python_hwpx-2.8.3 → python_hwpx-2.9.1/src/python_hwpx.egg-info}/PKG-INFO +138 -80
  40. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/python_hwpx.egg-info/SOURCES.txt +6 -0
  41. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_document_formatting.py +57 -2
  42. python_hwpx-2.9.1/tests/test_hp_tab_support.py +64 -0
  43. python_hwpx-2.9.1/tests/test_id_generator_range.py +32 -0
  44. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_packaging_license_metadata.py +1 -1
  45. python_hwpx-2.9.1/tests/test_skeleton_template_ids.py +25 -0
  46. python_hwpx-2.9.1/tests/test_table_navigation.py +183 -0
  47. python_hwpx-2.8.3/LICENSE +0 -32
  48. python_hwpx-2.8.3/src/hwpx/data/Skeleton.hwpx +0 -0
  49. python_hwpx-2.8.3/src/hwpx/tools/exporter.py +0 -272
  50. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/setup.cfg +0 -0
  51. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/py.typed +0 -0
  52. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/_schemas/header.xsd +0 -0
  53. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/hwpx/tools/_schemas/section.xsd +0 -0
  54. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/python_hwpx.egg-info/dependency_links.txt +0 -0
  55. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/python_hwpx.egg-info/entry_points.txt +0 -0
  56. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/python_hwpx.egg-info/requires.txt +0 -0
  57. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/src/python_hwpx.egg-info/top_level.txt +0 -0
  58. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_coverage_targets.py +0 -0
  59. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_document_context_manager.py +0 -0
  60. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_document_save_api.py +0 -0
  61. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_gap_closure_tools.py +0 -0
  62. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_inline_models.py +0 -0
  63. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_integration_hwpx_compatibility.py +0 -0
  64. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_integration_roundtrip.py +0 -0
  65. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_memo_and_style_editing.py +0 -0
  66. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_new_features.py +0 -0
  67. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_opc_package.py +0 -0
  68. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_oxml_parsing.py +0 -0
  69. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_packaging_py_typed.py +0 -0
  70. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_paragraph_section_management.py +0 -0
  71. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_repr_snapshots.py +0 -0
  72. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_section_headers.py +0 -0
  73. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_split_merged_cell.py +0 -0
  74. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_tables_default_border.py +0 -0
  75. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_text_extractor_annotations.py +0 -0
  76. {python_hwpx-2.8.3 → python_hwpx-2.9.1}/tests/test_version_metadata.py +0 -0
@@ -0,0 +1,178 @@
1
+ Copyright 2025-2026 airmang (Dr. Wily)
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf of
173
+ any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,14 @@
1
+ python-hwpx
2
+ Copyright 2025-2026 airmang
3
+
4
+ This product includes software developed by airmang.
5
+ Licensed under the Apache License, Version 2.0.
6
+
7
+ ────────────────────────────────────────
8
+ DISCLAIMER — HWPX Format
9
+
10
+ "HWPX" is the document format specified and trademarked by
11
+ Hancom Inc. (한글과컴퓨터). This project is an independent,
12
+ unofficial implementation and is not affiliated with, endorsed by,
13
+ or sponsored by Hancom Inc.
14
+ ────────────────────────────────────────
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-hwpx
3
- Version: 2.8.3
4
- Summary: Hancom HWPX 패키지를 로드하고 편집하기 위한 Python 유틸리티 모음
3
+ Version: 2.9.1
4
+ Summary: 한글 없이 HWPX 문서를 열고, 편집하고, 생성하고, 검증하는 Python 자동화 라이브러리
5
5
  Author: python-hwpx Maintainers
6
- License-Expression: LicenseRef-python-hwpx-NonCommercial
6
+ License-Expression: Apache-2.0
7
7
  Project-URL: Homepage, https://github.com/airmang/python-hwpx
8
- Project-URL: Documentation, https://github.com/airmang/python-hwpx/tree/main/docs
8
+ Project-URL: Documentation, https://airmang.github.io/python-hwpx/
9
9
  Project-URL: Issues, https://github.com/airmang/python-hwpx/issues
10
- Keywords: hwp,hwpx,hancom,opc,xml
10
+ Keywords: hwp,hwpx,hancom,opc,xml,document-automation,validation,template
11
11
  Classifier: Development Status :: 3 - Alpha
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Programming Language :: Python :: 3
@@ -19,6 +19,7 @@ Classifier: Topic :: Text Processing :: Markup :: XML
19
19
  Requires-Python: >=3.10
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
+ License-File: NOTICE
22
23
  Requires-Dist: lxml<6,>=4.9
23
24
  Provides-Extra: dev
24
25
  Requires-Dist: build>=1.0; extra == "dev"
@@ -36,74 +37,127 @@ Dynamic: license-file
36
37
  <p align="center">
37
38
  <h1 align="center">python-hwpx</h1>
38
39
  <p align="center">
39
- <strong>HWPX 문서를 Python으로 읽고, 편집하고, 생성합니다.</strong>
40
+ <strong>한글 없이 HWPX 문서를 Python으로 읽고, 편집하고, 생성하고, 검증합니다.</strong>
40
41
  </p>
41
42
  <p align="center">
42
43
  <a href="https://pypi.org/project/python-hwpx/"><img src="https://img.shields.io/pypi/v/python-hwpx?color=blue&label=PyPI" alt="PyPI"></a>
43
44
  <a href="https://pypi.org/project/python-hwpx/"><img src="https://img.shields.io/pypi/pyversions/python-hwpx" alt="Python"></a>
44
- <a href="https://github.com/airmang/python-hwpx/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Custom%20Noncommercial-orange" alt="License: Custom Non-Commercial"></a>
45
+ <a href="https://github.com/airmang/python-hwpx/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License"></a>
45
46
  <a href="https://airmang.github.io/python-hwpx/"><img src="https://img.shields.io/badge/docs-Sphinx-8CA1AF" alt="Docs"></a>
46
47
  </p>
47
48
  </p>
48
49
 
49
50
  ---
50
51
 
51
- `python-hwpx`는 한컴오피스의 [HWPX 포맷](https://www.hancom.com/)을 순수 Python으로 다루는 라이브러리이자 CLI 도구 모음입니다.
52
- 한/글 설치 없이, OS에 관계없이 HWPX 문서의 구조를 파싱하고 콘텐츠를 조작할 수 있습니다.
53
- 문서 편집 API뿐 아니라 스키마/패키지 검증, unpack/pack, 템플릿 분석 같은 XML-first 워크플로도 함께 제공합니다.
52
+ ## 🧩 HWPX Stack (3종)
54
53
 
55
- > **pyhwpx / pyhwp와 다른 점?**
56
- > | | python-hwpx | pyhwpx | pyhwp |
57
- > |---|---|---|---|
58
- > | **대상 포맷** | `.hwpx` (OWPML/OPC) | `.hwpx` | `.hwp` (v5 바이너리) |
59
- > | **한/글 설치** | 불필요 | 필요 (Windows COM) | 불필요 |
60
- > | **크로스 플랫폼** | ✅ Linux / macOS / Windows / CI | ❌ Windows 전용 | ✅ |
61
- > | **방식** | 직접 XML 파싱 | COM 자동화 | OLE 파싱 |
54
+ | 계층 | 레포 | 역할 |
55
+ |---|---|---|
56
+ | 📦 라이브러리 | **[`python-hwpx`](https://github.com/airmang/python-hwpx)** | 순수 파이썬 HWPX 파싱·편집·생성 코어 |
57
+ | 🔌 MCP 서버 | [`hwpx-mcp-server`](https://github.com/airmang/hwpx-mcp-server) | MCP 클라이언트(Claude Desktop, VS Code 등)에서 HWPX 조작 |
58
+ | 🎯 에이전트 스킬 | [`hwpx-skill`](https://github.com/airmang/hwpx-skill) | 에이전트가 HWPX를 바로 쓰게 해주는 공식 온보딩 스킬 |
62
59
 
63
- ## 🌍 크로스 플랫폼 지원
60
+ ---
61
+ ## 왜 python-hwpx인가
64
62
 
65
- HWPX 파일은 **ZIP + XML** 구조이므로, 한/글 프로그램 없이 Python만으로 읽고 편집하는 워크플로를 구성할 수 있습니다.
63
+ - 한컴오피스 설치 불필요 순수 파이썬으로 어디서나 동작
64
+ - XML-first 워크플로 — 스키마 검증·unpack/pack까지 포함
65
+ - 에이전트·자동화 친화 — MCP 서버·Skill이 같은 스택 위에서 직결
66
66
 
67
- | 플랫폼 | 읽기 | 쓰기 | 비고 |
68
- |--------|------|------|------|
69
- | ✅ Windows | ✅ | ✅ | 한컴오피스 |
70
- | ✅ macOS | ✅ | ✅ | 한컴오피스 Mac |
71
- | ✅ Linux | ✅ | ✅ | 한컴오피스 Linux |
72
- | ✅ CI/CD | ✅ | ✅ | Docker, GitHub Actions 등 |
67
+ ## 대항 라이브러리 비교
73
68
 
74
- ## 설치
69
+ | 항목 | python-hwpx | pyhwp(x) 류 | ole+bin 수작업 |
70
+ |---|---|---|---|
71
+ | HWPX Open XML 지원 | ✅ | ⚠️ 부분 | ❌ |
72
+ | 한컴오피스 설치 불필요 | ✅ | ✅ | ✅ |
73
+ | 편집/생성 API | ✅ | ❌ 대부분 읽기 | ❌ |
74
+ | 스키마 검증 | ✅ | ❌ | ❌ |
75
+ | AI 에이전트 연동 (MCP) | ✅ (hwpx-mcp-server) | ❌ | ❌ |
75
76
 
76
- ```bash
77
- pip install python-hwpx
77
+ ## ⚡ 30초 안에 가치 확인
78
+
79
+ ### 1. 기존 문서를 열고 수정
80
+
81
+ ```python
82
+ from hwpx import HwpxDocument
83
+
84
+ document = HwpxDocument.open("보고서.hwpx")
85
+ document.add_paragraph("자동화로 추가한 문단입니다.")
86
+ document.save_to_path("보고서-수정.hwpx")
78
87
  ```
79
88
 
80
- > 유일한 의존성은 `lxml`입니다.
89
+ ### 2. 양식형 표를 코드로 채우기
81
90
 
82
- ## Quick Start
91
+ ```python
92
+ from hwpx import HwpxDocument
93
+
94
+ doc = HwpxDocument.open("신청서.hwpx")
95
+ result = doc.fill_by_path({
96
+ "성명 > right": "홍길동",
97
+ "소속 > right": "플랫폼팀",
98
+ })
99
+ doc.save_to_path("신청서-작성완료.hwpx")
100
+
101
+ print(result["applied_count"], result["failed_count"])
102
+ ```
103
+
104
+ ### 3. 텍스트 추출과 구조 검증
83
105
 
84
106
  ```python
85
107
  from hwpx import HwpxDocument
86
108
 
87
- # 문서 새로 만들기
88
- doc = HwpxDocument.new()
109
+ text = HwpxDocument.open("보고서.hwpx").export_markdown()
110
+ print(text[:500])
111
+ ```
112
+
113
+ ```bash
114
+ hwpx-validate-package 보고서.hwpx
115
+ hwpx-analyze-template 보고서.hwpx
116
+ ```
117
+
118
+ 처음에는 `open/new -> edit/extract -> save_to_path` 흐름만 잡으면 된다. 패키지 구조, XML 파트, 템플릿 회귀 점검은 필요할 때만 확장하면 된다.
119
+
120
+ ## 어디부터 읽으면 되나
89
121
 
90
- # 기존 문서를 수정하려면:
91
- # doc = HwpxDocument.open("보고서.hwpx")
122
+ 필요한 작업부터 바로 들어가면 된다.
92
123
 
93
- # 문단 추가
94
- paragraph = doc.add_paragraph("python-hwpx로 생성한 문단입니다.")
124
+ - **첫 파일을 열고 저장하는 최소 경로** → [`docs/quickstart.md`](docs/quickstart.md)
125
+ - **문단, 표, 메모, 섹션 편집 패턴** → [`docs/usage.md`](docs/usage.md)
126
+ - **텍스트 추출, 구조 조회, 검증/패키지 작업** → [`docs/usage.md`](docs/usage.md)
127
+ - **실행 가능한 예제 모음** → [`docs/examples.md`](docs/examples.md)
128
+ - **패키지 구조와 스키마 심화** → [`docs/schema-overview.md`](docs/schema-overview.md)
129
+ - **설치 검증과 개발 환경 확인** → [`docs/installation.md`](docs/installation.md)
95
130
 
96
- # 추가 (2×3)
97
- table = doc.add_table(rows=2, cols=3)
98
- table.set_cell_text(0, 0, "이름")
99
- table.set_cell_text(0, 1, "부서")
100
- table.set_cell_text(0, 2, "연락처")
131
+ ## examples 하이라이트
101
132
 
102
- # 메모 추가 (기본 템플릿의 memo shape 사용)
103
- doc.add_memo_with_anchor("검토 필요", paragraph=paragraph, memo_shape_id_ref="0")
133
+ <table>
134
+ <tr>
135
+ <td valign="top">
136
+ <strong><a href="examples/build_release_checklist.py">build_release_checklist.py</a></strong><br>
137
+ 메모와 스타일 편집이 포함된 릴리스 체크리스트용 HWPX를 생성한다.
138
+ </td>
139
+ <td valign="top">
140
+ <strong><a href="examples/extract_text.py">extract_text.py</a></strong><br>
141
+ 본문과 중첩 객체 텍스트를 CLI로 빠르게 추출한다.
142
+ </td>
143
+ <td valign="top">
144
+ <strong><a href="examples/find_objects.py">find_objects.py</a></strong><br>
145
+ 태그·속성 기준으로 OWPML XML 노드를 추적한다.
146
+ </td>
147
+ </tr>
148
+ </table>
104
149
 
105
- # 저장
106
- doc.save_to_path("결과물.hwpx")
150
+
151
+ ## Quick Start
152
+
153
+ 새 문서를 바로 만들고 싶다면 이렇게 시작하면 된다.
154
+
155
+ ```python
156
+ from hwpx import HwpxDocument
157
+
158
+ document = HwpxDocument.new()
159
+ document.add_paragraph("python-hwpx로 만든 새 문서")
160
+ document.save_to_path("새문서.hwpx")
107
161
  ```
108
162
 
109
163
  > 💡 컨텍스트 매니저도 지원합니다:
@@ -113,6 +167,27 @@ doc.save_to_path("결과물.hwpx")
113
167
  > doc.save_to_path("결과물.hwpx")
114
168
  > ```
115
169
 
170
+ 표, 메모, 텍스트 추출, 검증, 패키지/XML 심화는 [`docs/quickstart.md`](docs/quickstart.md)와 [`docs/usage.md`](docs/usage.md)에서 바로 이어진다.
171
+
172
+ > **pyhwpx / pyhwp와 다른 점?**
173
+ > | | python-hwpx | pyhwpx | pyhwp |
174
+ > |---|---|---|---|
175
+ > | **대상 포맷** | `.hwpx` (OWPML/OPC) | `.hwpx` | `.hwp` (v5 바이너리) |
176
+ > | **한/글 설치** | 불필요 | 필요 (Windows COM) | 불필요 |
177
+ > | **크로스 플랫폼** | ✅ Linux / macOS / Windows / CI | ❌ Windows 전용 | ✅ |
178
+ > | **방식** | 직접 XML 파싱 | COM 자동화 | OLE 파싱 |
179
+
180
+ ## 🌍 크로스 플랫폼 지원
181
+
182
+ HWPX 파일은 **ZIP + XML** 구조이므로, 한/글 프로그램 없이 Python만으로 읽고 편집하는 워크플로를 구성할 수 있습니다.
183
+
184
+ | 플랫폼 | 읽기 | 쓰기 | 비고 |
185
+ |--------|------|------|------|
186
+ | ✅ Windows | ✅ | ✅ | 한컴오피스 |
187
+ | ✅ macOS | ✅ | ✅ | 한컴오피스 Mac |
188
+ | ✅ Linux | ✅ | ✅ | 한컴오피스 Linux |
189
+ | ✅ CI/CD | ✅ | ✅ | Docker, GitHub Actions 등 |
190
+
116
191
  ## 주요 기능 한눈에 보기
117
192
 
118
193
  | 카테고리 | 기능 | 설명 |
@@ -121,6 +196,7 @@ doc.save_to_path("결과물.hwpx")
121
196
  | 📝 **단락** | 추가/삭제/편집/서식 | 텍스트 설정, 단락 삭제(`remove_paragraph`), 스타일 참조 |
122
197
  | ✏️ **Run** | 텍스트 조각 | 추가, 교체, 볼드/이탤릭/밑줄/색상 서식 |
123
198
  | 📊 **표(Table)** | 생성/편집/병합 | N×M 표 생성, 셀 텍스트, 셀 병합/분할, 중첩 테이블 |
199
+ | 🧭 **표 자동화** | 탐색/채우기 | 테이블 맵, 라벨 기반 셀 탐색, 경로 기반 배치 채우기 |
124
200
  | 📑 **섹션** | 추가/삭제 | `add_section(after=)`, `remove_section()`, manifest 자동 관리 |
125
201
  | 🖼️ **이미지** | 임베드/삭제 | 바이너리 데이터 관리, manifest 자동 등록 |
126
202
  | ✏️ **도형** | 선/사각형/타원 | OWPML 명세 준수 도형 삽입 |
@@ -161,6 +237,17 @@ doc.set_footer_text("1 / 10", page_type="BOTH")
161
237
  # 표 셀 병합·분할
162
238
  table.merge_cells(0, 0, 1, 1) # (0,0)~(1,1) 병합
163
239
  table.set_cell_text(0, 0, "병합된 셀", logical=True, split_merged=True)
240
+
241
+ # 양식형 표 자동 채우기
242
+ form = doc.add_table(2, 2)
243
+ form.cell(0, 0).text = "성명:"
244
+ form.cell(1, 0).text = "소속"
245
+
246
+ doc.find_cell_by_label("성명") # {"matches": [...], "count": 1}
247
+ doc.fill_by_path({
248
+ "성명 > right": "홍길동",
249
+ "소속 > right": "플랫폼팀",
250
+ })
164
251
  ```
165
252
 
166
253
  ### 🔍 텍스트 추출 & 검색
@@ -179,6 +266,8 @@ for obj in ObjectFinder("문서.hwpx").find_all(tag="tbl"):
179
266
  print(obj.tag, obj.path)
180
267
  ```
181
268
 
269
+ `hp:tab`과 `ctrl id="tab"`은 탭 문자(`\t`)로 보존됩니다. 따라서 `Paragraph.text`, `TextExtractor`, `export_text()`/`export_html()`/`export_markdown()` 경로에서 같은 탭 의미를 유지한 채 roundtrip 할 수 있습니다. 필요하면 `preserve_breaks=False`로 줄바꿈/탭을 공백 기반으로 평탄화할 수 있습니다.
270
+
182
271
  ### 🎨 스타일 기반 텍스트 치환
183
272
 
184
273
  서식(색상, 밑줄, charPrIDRef)으로 런을 필터링해 선택적으로 교체합니다.
@@ -244,37 +333,6 @@ python-hwpx
244
333
  └── hwpx.templates # 내장 빈 문서 템플릿
245
334
  ```
246
335
 
247
- ## CLI
248
-
249
- ```bash
250
- # HWPX 문서 스키마 유효성 검사
251
- hwpx-validate 문서.hwpx
252
-
253
- # ZIP/OPC/HWPX 패키지 구조 검사
254
- hwpx-validate-package 문서.hwpx
255
-
256
- # HWPX 풀기 / 다시 묶기 (기본값: XML/HWPF 바이트 보존)
257
- hwpx-unpack 문서.hwpx ./unpacked
258
- hwpx-unpack 문서.hwpx ./pretty-unpacked --pretty-xml
259
- hwpx-pack ./unpacked ./repacked.hwpx
260
-
261
- # 레퍼런스 문서 분석과 작업 디렉터리 추출
262
- hwpx-analyze-template 문서.hwpx --extract-dir ./template-parts --json
263
- hwpx-pack ./template-parts ./template-roundtrip.hwpx
264
- hwpx-validate-package ./template-roundtrip.hwpx
265
-
266
- # plain / markdown 텍스트 추출
267
- hwpx-text-extract 문서.hwpx --format markdown --output 문서.md
268
-
269
- # 문서 구조 변화 징후 비교
270
- hwpx-page-guard --reference 원본.hwpx --output 결과.hwpx
271
- ```
272
-
273
- `hwpx-page-guard`는 렌더된 실제 쪽수를 계산하지 않습니다. 대신 단락 수, 표 수, shape/control 수, 명시적 page/column break, 텍스트 길이 같은 구조 지표를 비교해 편집 전후 변화 징후를 빠르게 점검합니다.
274
-
275
- `hwpx-validate-package`는 `Contents/content.hpf` 같은 고정 경로를 전제로 두지 않고, `META-INF/container.xml`과 실제 rootfile/manifest 선언을 따라가며 패키지 구조를 확인합니다. 엔진이 열 수 있는 비표준 패키지는 가능한 경우 경고로 분리해 보여줍니다.
276
-
277
- `hwpx-analyze-template --extract-dir`는 다시 묶고 점검하기 쉬운 작업 디렉터리를 만듭니다. 재구성과 구조 검증에 필요한 파일을 함께 꺼내는 용도이며, 편집기에서의 최종 렌더링 결과까지 보장한다는 뜻은 아닙니다.
278
336
 
279
337
  ## 문서
280
338
 
@@ -285,6 +343,7 @@ hwpx-page-guard --reference 원본.hwpx --output 결과.hwpx
285
343
  | **[📚 사용 가이드](https://airmang.github.io/python-hwpx/usage.html)** | 50+ 실전 사용 패턴 |
286
344
  | **[🔧 API 레퍼런스](https://airmang.github.io/python-hwpx/api_reference.html)** | 클래스·메서드 상세 명세 |
287
345
  | **[📐 스키마 개요](https://airmang.github.io/python-hwpx/schema-overview.html)** | OWPML 스키마 구조 설명 |
346
+ | **[🧪 스택 통합 자료](shared/hwpx/README.md)** | fixture, smoke, validation, compatibility 운영 자료 |
288
347
 
289
348
  ## 지원 포맷
290
349
 
@@ -319,11 +378,10 @@ pip install -e ".[dev]"
319
378
  pytest
320
379
  ```
321
380
 
322
- ## License
323
-
324
- [Custom Non-Commercial License](LICENSE) © python-hwpx Maintainers
381
+ 머지된 기여자 목록은 [CONTRIBUTORS.md](CONTRIBUTORS.md)에서 확인할 수 있습니다.
325
382
 
326
- Commercial use requires separate permission from the copyright holders.
383
+ ## License
384
+ Apache License 2.0. See LICENSE and NOTICE.
327
385
 
328
386
  <br>
329
387