pptx-md 0.1.0__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.
- pptx_md-0.1.0/.gitignore +34 -0
- pptx_md-0.1.0/LICENSE +21 -0
- pptx_md-0.1.0/PKG-INFO +220 -0
- pptx_md-0.1.0/README.md +190 -0
- pptx_md-0.1.0/pyproject.toml +77 -0
- pptx_md-0.1.0/src/pptx_md/__init__.py +48 -0
- pptx_md-0.1.0/src/pptx_md/api.py +130 -0
- pptx_md-0.1.0/src/pptx_md/assembler.py +267 -0
- pptx_md-0.1.0/src/pptx_md/classifier.py +284 -0
- pptx_md-0.1.0/src/pptx_md/describer.py +79 -0
- pptx_md-0.1.0/src/pptx_md/description_pipeline.py +162 -0
- pptx_md-0.1.0/src/pptx_md/errors.py +24 -0
- pptx_md-0.1.0/src/pptx_md/image_pipeline.py +84 -0
- pptx_md-0.1.0/src/pptx_md/ir.py +164 -0
- pptx_md-0.1.0/src/pptx_md/masking.py +96 -0
- pptx_md-0.1.0/src/pptx_md/mermaid.py +163 -0
- pptx_md-0.1.0/src/pptx_md/parser.py +362 -0
- pptx_md-0.1.0/src/pptx_md/providers/__init__.py +81 -0
- pptx_md-0.1.0/src/pptx_md/providers/anthropic.py +172 -0
- pptx_md-0.1.0/src/pptx_md/providers/openai.py +171 -0
- pptx_md-0.1.0/src/pptx_md/py.typed +0 -0
- pptx_md-0.1.0/src/pptx_md/validator.py +173 -0
- pptx_md-0.1.0/src/pptx_md/vector.py +141 -0
- pptx_md-0.1.0/tests/__init__.py +0 -0
- pptx_md-0.1.0/tests/conftest.py +285 -0
- pptx_md-0.1.0/tests/fixtures/other_shape.pptx +0 -0
- pptx_md-0.1.0/tests/test_api.py +715 -0
- pptx_md-0.1.0/tests/test_assembler.py +447 -0
- pptx_md-0.1.0/tests/test_classifier.py +525 -0
- pptx_md-0.1.0/tests/test_coverage_gate.py +151 -0
- pptx_md-0.1.0/tests/test_describer.py +335 -0
- pptx_md-0.1.0/tests/test_description_pipeline.py +697 -0
- pptx_md-0.1.0/tests/test_docs.py +294 -0
- pptx_md-0.1.0/tests/test_ir.py +457 -0
- pptx_md-0.1.0/tests/test_masking.py +274 -0
- pptx_md-0.1.0/tests/test_mermaid_fallback.py +313 -0
- pptx_md-0.1.0/tests/test_parser.py +630 -0
- pptx_md-0.1.0/tests/test_pipeline.py +484 -0
- pptx_md-0.1.0/tests/test_providers.py +737 -0
- pptx_md-0.1.0/tests/test_release.py +458 -0
- pptx_md-0.1.0/tests/test_smoke.py +12 -0
- pptx_md-0.1.0/tests/test_validator.py +312 -0
- pptx_md-0.1.0/tests/test_vector.py +480 -0
pptx_md-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.pyo
|
|
6
|
+
*.pyd
|
|
7
|
+
|
|
8
|
+
# Distribution / packaging
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
*.egg-info/
|
|
12
|
+
*.egg
|
|
13
|
+
.eggs/
|
|
14
|
+
|
|
15
|
+
# Virtual environments
|
|
16
|
+
.venv/
|
|
17
|
+
venv/
|
|
18
|
+
env/
|
|
19
|
+
|
|
20
|
+
# Testing / coverage
|
|
21
|
+
.coverage
|
|
22
|
+
.coverage.*
|
|
23
|
+
htmlcov/
|
|
24
|
+
.pytest_cache/
|
|
25
|
+
|
|
26
|
+
# Hatch
|
|
27
|
+
.hatch/
|
|
28
|
+
|
|
29
|
+
# Type checking
|
|
30
|
+
.mypy_cache/
|
|
31
|
+
|
|
32
|
+
# IDE
|
|
33
|
+
.vscode/
|
|
34
|
+
.idea/
|
pptx_md-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ms9648
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pptx_md-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pptx-md
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Convert PPTX files into LLM-friendly Markdown (VLM-first image understanding).
|
|
5
|
+
Project-URL: Homepage, https://github.com/ms9648/pptx-md
|
|
6
|
+
Project-URL: Repository, https://github.com/ms9648/pptx-md
|
|
7
|
+
Author: ms9648
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: llm,markdown,powerpoint,pptx,vlm
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Requires-Dist: pillow
|
|
19
|
+
Requires-Dist: python-pptx
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: black; extra == 'dev'
|
|
22
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
23
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
25
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
26
|
+
Provides-Extra: vlm
|
|
27
|
+
Requires-Dist: anthropic>=0.40; extra == 'vlm'
|
|
28
|
+
Requires-Dist: openai>=1.0; extra == 'vlm'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# pptx-md
|
|
32
|
+
|
|
33
|
+
[](https://github.com/ms9648/pptx-md/actions/workflows/ci.yml)
|
|
34
|
+
[](https://pypi.org/project/pptx-md/)
|
|
35
|
+
[](https://pypi.org/project/pptx-md/)
|
|
36
|
+
|
|
37
|
+
PPTX 파일을 LLM-friendly Markdown으로 변환하는 Python 라이브러리.
|
|
38
|
+
|
|
39
|
+
VLM(Vision Language Model) 기반 이미지 이해와 개인정보 마스킹을 지원합니다.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 설치
|
|
44
|
+
|
|
45
|
+
### Core (텍스트 변환만)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install pptx-md
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### VLM 지원 포함 (이미지 설명 생성)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install pptx-md[vlm]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
VLM extras는 `anthropic` 및 `openai` SDK를 함께 설치합니다.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
|
|
63
|
+
### 기본 변환 (core-only)
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from pptx_md import convert
|
|
67
|
+
|
|
68
|
+
md = convert("deck.pptx")
|
|
69
|
+
print(md)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`convert()`는 파싱 → 이미지 분류 → Markdown 어셈블 파이프라인을 실행하고
|
|
73
|
+
Markdown 문자열을 반환합니다.
|
|
74
|
+
|
|
75
|
+
### 옵션과 함께
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from pptx_md import convert, ConvertOptions
|
|
79
|
+
|
|
80
|
+
opts = ConvertOptions(validate=True)
|
|
81
|
+
md = convert("deck.pptx", options=opts)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## VLM 이미지 설명
|
|
87
|
+
|
|
88
|
+
VLM을 사용하면 이미지 슬라이드에 자연어 설명을 자동으로 생성합니다.
|
|
89
|
+
API 키는 **반드시 환경변수**로 전달합니다 (NFR-05).
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import os
|
|
93
|
+
from pptx_md import convert, ConvertOptions, get_describer
|
|
94
|
+
|
|
95
|
+
describer = get_describer("anthropic", api_key=os.environ["ANTHROPIC_API_KEY"])
|
|
96
|
+
opts = ConvertOptions(describer=describer)
|
|
97
|
+
md = convert("deck.pptx", options=opts)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
OpenAI를 사용하려면:
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
import os
|
|
104
|
+
from pptx_md import convert, ConvertOptions, get_describer
|
|
105
|
+
|
|
106
|
+
describer = get_describer("openai", api_key=os.environ["OPENAI_API_KEY"])
|
|
107
|
+
opts = ConvertOptions(describer=describer)
|
|
108
|
+
md = convert("deck.pptx", options=opts)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 개인정보 마스킹 (opt-in)
|
|
114
|
+
|
|
115
|
+
이메일·전화번호 등 PII를 `[REDACTED]`로 치환합니다. 기본값은 **비활성**입니다.
|
|
116
|
+
|
|
117
|
+
### 기본 패턴 활성화
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from pptx_md import convert, ConvertOptions, MaskingOptions
|
|
121
|
+
|
|
122
|
+
opts = ConvertOptions(masking=MaskingOptions(enabled=True))
|
|
123
|
+
md = convert("deck.pptx", options=opts)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 커스텀 패턴 추가
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
import re
|
|
130
|
+
from pptx_md import convert, ConvertOptions, MaskingOptions
|
|
131
|
+
|
|
132
|
+
custom_masking = MaskingOptions(
|
|
133
|
+
enabled=True,
|
|
134
|
+
patterns=[
|
|
135
|
+
re.compile(r"\d{6}-\d{7}"), # 주민등록번호
|
|
136
|
+
re.compile(r"사번\s*:\s*\d+"), # 사번
|
|
137
|
+
],
|
|
138
|
+
)
|
|
139
|
+
opts = ConvertOptions(masking=custom_masking)
|
|
140
|
+
md = convert("deck.pptx", options=opts)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Markdown 검증
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
from pptx_md import convert, validate_markdown
|
|
149
|
+
|
|
150
|
+
md = convert("deck.pptx")
|
|
151
|
+
result = validate_markdown(md)
|
|
152
|
+
|
|
153
|
+
if not result.valid:
|
|
154
|
+
print("검증 실패:", result.warnings)
|
|
155
|
+
elif result.warnings:
|
|
156
|
+
print("경고:", result.warnings)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`convert(validate=True)`를 사용하면 변환과 동시에 검증 결과를 로그로 출력합니다
|
|
160
|
+
(반환값은 항상 `str`).
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 커스텀 VLM 제공자 (플러그인)
|
|
165
|
+
|
|
166
|
+
`ImageDescriber` 프로토콜을 구현하면 어떤 VLM 제공자도 플러그인으로 사용할 수
|
|
167
|
+
있습니다.
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
from pptx_md import convert, ConvertOptions, ImageDescriber
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class MyDescriber:
|
|
174
|
+
def describe(
|
|
175
|
+
self,
|
|
176
|
+
image_bytes: bytes,
|
|
177
|
+
image_ext: str,
|
|
178
|
+
shape_hint: str | None,
|
|
179
|
+
) -> str:
|
|
180
|
+
return "이미지에 대한 설명"
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
opts = ConvertOptions(describer=MyDescriber())
|
|
184
|
+
md = convert("deck.pptx", options=opts)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 예외 처리
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
from pptx_md import convert, ParseError, DescribeError
|
|
193
|
+
|
|
194
|
+
try:
|
|
195
|
+
md = convert("deck.pptx")
|
|
196
|
+
except ParseError as e:
|
|
197
|
+
print(f"PPTX 파일을 읽을 수 없습니다: {e}")
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 전체 API 레퍼런스
|
|
203
|
+
|
|
204
|
+
[docs/api.md](docs/api.md) 에 공개 심볼 전체 레퍼런스가 있습니다.
|
|
205
|
+
|
|
206
|
+
상세 사용 가이드는 [docs/usage.md](docs/usage.md)를 참고하세요.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 요구사항
|
|
211
|
+
|
|
212
|
+
- Python 3.11+
|
|
213
|
+
- Core: `python-pptx`, `Pillow`
|
|
214
|
+
- VLM 지원: `pip install pptx-md[vlm]` (`anthropic` 또는 `openai` SDK)
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## 라이선스
|
|
219
|
+
|
|
220
|
+
[MIT](LICENSE)
|
pptx_md-0.1.0/README.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# pptx-md
|
|
2
|
+
|
|
3
|
+
[](https://github.com/ms9648/pptx-md/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/pptx-md/)
|
|
5
|
+
[](https://pypi.org/project/pptx-md/)
|
|
6
|
+
|
|
7
|
+
PPTX 파일을 LLM-friendly Markdown으로 변환하는 Python 라이브러리.
|
|
8
|
+
|
|
9
|
+
VLM(Vision Language Model) 기반 이미지 이해와 개인정보 마스킹을 지원합니다.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 설치
|
|
14
|
+
|
|
15
|
+
### Core (텍스트 변환만)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install pptx-md
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### VLM 지원 포함 (이미지 설명 생성)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install pptx-md[vlm]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
VLM extras는 `anthropic` 및 `openai` SDK를 함께 설치합니다.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
### 기본 변환 (core-only)
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from pptx_md import convert
|
|
37
|
+
|
|
38
|
+
md = convert("deck.pptx")
|
|
39
|
+
print(md)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`convert()`는 파싱 → 이미지 분류 → Markdown 어셈블 파이프라인을 실행하고
|
|
43
|
+
Markdown 문자열을 반환합니다.
|
|
44
|
+
|
|
45
|
+
### 옵션과 함께
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from pptx_md import convert, ConvertOptions
|
|
49
|
+
|
|
50
|
+
opts = ConvertOptions(validate=True)
|
|
51
|
+
md = convert("deck.pptx", options=opts)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## VLM 이미지 설명
|
|
57
|
+
|
|
58
|
+
VLM을 사용하면 이미지 슬라이드에 자연어 설명을 자동으로 생성합니다.
|
|
59
|
+
API 키는 **반드시 환경변수**로 전달합니다 (NFR-05).
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
import os
|
|
63
|
+
from pptx_md import convert, ConvertOptions, get_describer
|
|
64
|
+
|
|
65
|
+
describer = get_describer("anthropic", api_key=os.environ["ANTHROPIC_API_KEY"])
|
|
66
|
+
opts = ConvertOptions(describer=describer)
|
|
67
|
+
md = convert("deck.pptx", options=opts)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
OpenAI를 사용하려면:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import os
|
|
74
|
+
from pptx_md import convert, ConvertOptions, get_describer
|
|
75
|
+
|
|
76
|
+
describer = get_describer("openai", api_key=os.environ["OPENAI_API_KEY"])
|
|
77
|
+
opts = ConvertOptions(describer=describer)
|
|
78
|
+
md = convert("deck.pptx", options=opts)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 개인정보 마스킹 (opt-in)
|
|
84
|
+
|
|
85
|
+
이메일·전화번호 등 PII를 `[REDACTED]`로 치환합니다. 기본값은 **비활성**입니다.
|
|
86
|
+
|
|
87
|
+
### 기본 패턴 활성화
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from pptx_md import convert, ConvertOptions, MaskingOptions
|
|
91
|
+
|
|
92
|
+
opts = ConvertOptions(masking=MaskingOptions(enabled=True))
|
|
93
|
+
md = convert("deck.pptx", options=opts)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 커스텀 패턴 추가
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import re
|
|
100
|
+
from pptx_md import convert, ConvertOptions, MaskingOptions
|
|
101
|
+
|
|
102
|
+
custom_masking = MaskingOptions(
|
|
103
|
+
enabled=True,
|
|
104
|
+
patterns=[
|
|
105
|
+
re.compile(r"\d{6}-\d{7}"), # 주민등록번호
|
|
106
|
+
re.compile(r"사번\s*:\s*\d+"), # 사번
|
|
107
|
+
],
|
|
108
|
+
)
|
|
109
|
+
opts = ConvertOptions(masking=custom_masking)
|
|
110
|
+
md = convert("deck.pptx", options=opts)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Markdown 검증
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
from pptx_md import convert, validate_markdown
|
|
119
|
+
|
|
120
|
+
md = convert("deck.pptx")
|
|
121
|
+
result = validate_markdown(md)
|
|
122
|
+
|
|
123
|
+
if not result.valid:
|
|
124
|
+
print("검증 실패:", result.warnings)
|
|
125
|
+
elif result.warnings:
|
|
126
|
+
print("경고:", result.warnings)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`convert(validate=True)`를 사용하면 변환과 동시에 검증 결과를 로그로 출력합니다
|
|
130
|
+
(반환값은 항상 `str`).
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 커스텀 VLM 제공자 (플러그인)
|
|
135
|
+
|
|
136
|
+
`ImageDescriber` 프로토콜을 구현하면 어떤 VLM 제공자도 플러그인으로 사용할 수
|
|
137
|
+
있습니다.
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from pptx_md import convert, ConvertOptions, ImageDescriber
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class MyDescriber:
|
|
144
|
+
def describe(
|
|
145
|
+
self,
|
|
146
|
+
image_bytes: bytes,
|
|
147
|
+
image_ext: str,
|
|
148
|
+
shape_hint: str | None,
|
|
149
|
+
) -> str:
|
|
150
|
+
return "이미지에 대한 설명"
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
opts = ConvertOptions(describer=MyDescriber())
|
|
154
|
+
md = convert("deck.pptx", options=opts)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 예외 처리
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from pptx_md import convert, ParseError, DescribeError
|
|
163
|
+
|
|
164
|
+
try:
|
|
165
|
+
md = convert("deck.pptx")
|
|
166
|
+
except ParseError as e:
|
|
167
|
+
print(f"PPTX 파일을 읽을 수 없습니다: {e}")
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 전체 API 레퍼런스
|
|
173
|
+
|
|
174
|
+
[docs/api.md](docs/api.md) 에 공개 심볼 전체 레퍼런스가 있습니다.
|
|
175
|
+
|
|
176
|
+
상세 사용 가이드는 [docs/usage.md](docs/usage.md)를 참고하세요.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 요구사항
|
|
181
|
+
|
|
182
|
+
- Python 3.11+
|
|
183
|
+
- Core: `python-pptx`, `Pillow`
|
|
184
|
+
- VLM 지원: `pip install pptx-md[vlm]` (`anthropic` 또는 `openai` SDK)
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 라이선스
|
|
189
|
+
|
|
190
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pptx-md"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Convert PPTX files into LLM-friendly Markdown (VLM-first image understanding)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [{ name = "ms9648" }]
|
|
13
|
+
keywords = ["pptx", "markdown", "powerpoint", "llm", "vlm"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Topic :: Text Processing :: Markup :: Markdown",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"python-pptx",
|
|
24
|
+
"Pillow",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
# VLM SDK 는 반드시 여기에만 (스킬 §4, ADR-002). core 에 포함 금지.
|
|
29
|
+
vlm = [
|
|
30
|
+
"anthropic>=0.40",
|
|
31
|
+
"openai>=1.0",
|
|
32
|
+
]
|
|
33
|
+
dev = [
|
|
34
|
+
"pytest",
|
|
35
|
+
"pytest-cov",
|
|
36
|
+
"ruff",
|
|
37
|
+
"black",
|
|
38
|
+
"mypy",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.urls]
|
|
42
|
+
Homepage = "https://github.com/ms9648/pptx-md"
|
|
43
|
+
Repository = "https://github.com/ms9648/pptx-md"
|
|
44
|
+
|
|
45
|
+
[tool.hatch.build.targets.wheel]
|
|
46
|
+
packages = ["src/pptx_md"]
|
|
47
|
+
|
|
48
|
+
[tool.hatch.build.targets.sdist]
|
|
49
|
+
include = [
|
|
50
|
+
"src/pptx_md",
|
|
51
|
+
"tests",
|
|
52
|
+
"README.md",
|
|
53
|
+
"LICENSE",
|
|
54
|
+
"pyproject.toml",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[tool.ruff]
|
|
58
|
+
line-length = 88
|
|
59
|
+
target-version = "py311"
|
|
60
|
+
|
|
61
|
+
[tool.ruff.lint]
|
|
62
|
+
select = ["E", "F", "I", "UP"]
|
|
63
|
+
|
|
64
|
+
[tool.black]
|
|
65
|
+
line-length = 88
|
|
66
|
+
target-version = ["py311"]
|
|
67
|
+
|
|
68
|
+
[tool.mypy]
|
|
69
|
+
python_version = "3.11"
|
|
70
|
+
strict = true
|
|
71
|
+
ignore_missing_imports = true
|
|
72
|
+
files = ["src"]
|
|
73
|
+
|
|
74
|
+
[tool.pytest.ini_options]
|
|
75
|
+
testpaths = ["tests"]
|
|
76
|
+
# M6: 커버리지 게이트 활성화 (FR-17, ADR-005 / 원 예고: ADR-004)
|
|
77
|
+
addopts = "--cov=src/pptx_md --cov-report=term-missing --cov-fail-under=75"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""pptx-md — Convert PPTX files into LLM-friendly Markdown.
|
|
2
|
+
|
|
3
|
+
Public API (FR-16, ADR-603):
|
|
4
|
+
|
|
5
|
+
from pptx_md import convert, ConvertOptions
|
|
6
|
+
|
|
7
|
+
md = convert("deck.pptx")
|
|
8
|
+
|
|
9
|
+
# With options:
|
|
10
|
+
from pptx_md import ConvertOptions, MaskingOptions, get_describer
|
|
11
|
+
opts = ConvertOptions(
|
|
12
|
+
describer=get_describer("anthropic", api_key="..."),
|
|
13
|
+
masking=MaskingOptions(enabled=True),
|
|
14
|
+
validate=True,
|
|
15
|
+
)
|
|
16
|
+
md = convert("deck.pptx", options=opts)
|
|
17
|
+
|
|
18
|
+
Internal submodules (parse_presentation, enrich_images, etc.) are NOT part
|
|
19
|
+
of the public API and may change without notice. Access via
|
|
20
|
+
``from pptx_md.parser import parse_presentation`` is possible but outside
|
|
21
|
+
SemVer guarantees (ADR-603).
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
from pptx_md.api import ConvertOptions, convert
|
|
27
|
+
from pptx_md.describer import ImageDescriber
|
|
28
|
+
from pptx_md.errors import DescribeError, InstallationError, ParseError, PptxMdError
|
|
29
|
+
from pptx_md.masking import MASK_TOKEN, MaskingOptions
|
|
30
|
+
from pptx_md.providers import get_describer
|
|
31
|
+
from pptx_md.validator import ValidationResult, validate_markdown
|
|
32
|
+
|
|
33
|
+
__version__: str = "0.1.0"
|
|
34
|
+
|
|
35
|
+
__all__ = [
|
|
36
|
+
"convert",
|
|
37
|
+
"ConvertOptions",
|
|
38
|
+
"MaskingOptions",
|
|
39
|
+
"MASK_TOKEN",
|
|
40
|
+
"validate_markdown",
|
|
41
|
+
"ValidationResult",
|
|
42
|
+
"ImageDescriber",
|
|
43
|
+
"get_describer",
|
|
44
|
+
"PptxMdError",
|
|
45
|
+
"ParseError",
|
|
46
|
+
"DescribeError",
|
|
47
|
+
"InstallationError",
|
|
48
|
+
]
|