pptx-wzq 1.0.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_wzq-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wu Zheqian
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.
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: pptx-wzq
3
+ Version: 1.0.0
4
+ Summary: PPT 多模态教学知识库自动化构建:图片/公式/文本提取 → 图片AI解读 → 教材文案 → 图文绑定 → 教材HTML/Deck
5
+ Author: Wu Zheqian
6
+ License: MIT
7
+ Keywords: pptx,education,knowledge-base,multimodal,latex,ocr
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Education
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Topic :: Education
13
+ Classifier: Topic :: Text Processing :: Markup :: LaTeX
14
+ Requires-Python: >=3.9
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: Pillow>=9.0
18
+ Requires-Dist: openai>=1.0
19
+ Requires-Dist: olefile>=0.46
20
+ Requires-Dist: ultralytics>=8.0
21
+ Requires-Dist: omml2latex>=0.1.1
22
+ Requires-Dist: pywin32>=306; platform_system == "Windows"
23
+ Provides-Extra: ocr
24
+ Requires-Dist: pix2tex>=0.1.2; extra == "ocr"
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7.0; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # pptx-wzq · PPT 多模态教学知识库自动化构建
30
+
31
+ > **作者:吴振谦 · wuzhenqian@nbu.edu.cn · QQ:38328063**
32
+ > 本项目帮助高校教师把教学 PPT 自动转化为图文并茂的多模态教学知识库。
33
+
34
+ 把一份教学 PPT 自动转化为**可检索、可复用、可再加工**的多模态教学知识库:
35
+ 图片集 + 图片 AI 理解 + 公式 LaTeX + 教材文案 + 图文绑定 JSON,并可一键导出
36
+ 教材 HTML 与教学 Deck。
37
+
38
+ ```
39
+ PPT(.pptx)
40
+ → 图片提取/过滤 pptx-img
41
+ → 公式提取 pptx-formula
42
+ → 文本提取 pptx-text
43
+ → 图片AI解读 pptx-caption
44
+ → 教材文案 pptx-author
45
+ → 图文绑定 pptx-bind
46
+ → 一条命令编排 pptx-paser
47
+ → 教材 HTML/Deck pptx-html / pptx-deck
48
+ ```
49
+
50
+ ## 安装
51
+
52
+ ```bash
53
+ pip install pptx-wzq # 核心
54
+ pip install "pptx-wzq[ocr]" # 含本地公式 OCR(pix2tex,可选)
55
+ ```
56
+
57
+ Windows 下会自动安装 pywin32(用于 PowerPoint 渲染矢量图)。
58
+ 首次运行 `pptx-paser` 会自动补齐缺失组件、检查 API Key
59
+ (DeepSeek / 阿里云百炼)并引导注册。
60
+
61
+ ## 快速开始
62
+
63
+ ```bash
64
+ # 一条命令跑完整流水线(自动装依赖 / 引导 Key / 预估 Token / 确认执行)
65
+ pptx-paser 第九章功率放大电路.pptx -o output
66
+
67
+ # 结果目录:
68
+ # output/images/ + output/<名>_captions.md + <名>_textbook.md + <名>_binding.json
69
+
70
+ # 导出教材 HTML(MathJax 公式渲染)
71
+ pptx-html output -o output/第九章.html
72
+
73
+ # 分步执行 / 断点续跑
74
+ pptx-img 课件.pptx -o out
75
+ pptx-caption out/images -o cap.md --texts out/texts.md --formulas out/formulas.md
76
+ pptx-paser 课件.pptx -o out --skip img,formula,text
77
+ ```
78
+
79
+ ## 指令一览
80
+
81
+ | 命令 | 功能 | 模型 | Token |
82
+ |---|---|---|---|
83
+ | `pptx-img` | 图片提取 + 三路过滤 + WMF 识别/渲染 + 公式图片补提 | — | 0 |
84
+ | `pptx-formula` | 公式三路径提取(OMML / EQ3-MTEF / OCR)→ LaTeX | — | 0 |
85
+ | `pptx-text` | 逐页文本/表格提取,排除页眉页脚 | — | 0 |
86
+ | `pptx-caption` | 图片 AI 解读(文档上下文模式,教材角度) | qwen3.7-plus | 有 |
87
+ | `pptx-author` | 教材文案(学科推断 + 整文生成 + 自适应分批) | deepseek-v4-flash | 有 |
88
+ | `pptx-bind` | 图文绑定 JSON(每页文案 ↔ 该页图片) | — | 0 |
89
+ | `pptx-paser` | 整体编排:环境自检 / Key 引导 / Token 预估 / 汇报 | — | — |
90
+ | `pptx-html` | 单文件教材 HTML(MathJax 公式 + PPT 原生标题) | — | 0 |
91
+ | `pptx-deck` | 教育蓝图风格教学 Deck(示例脚本) | — | 0 |
92
+
93
+ ## API Key
94
+
95
+ | 用途 | 平台 | 模型 |
96
+ |---|---|---|
97
+ | 图片 AI 解读 / 公式图片识别 | 阿里云百炼(bailian.console.aliyun.com) | qwen3.7-plus |
98
+ | 教材文案 / 学科判断 | DeepSeek(platform.deepseek.com) | deepseek-v4-flash |
99
+
100
+ 缺失时 `pptx-paser` 会打印注册引导并交互写入环境变量(`DEEPSEEK_API_KEY` /
101
+ `DASHSCOPE_API_KEY`)。
102
+
103
+ ## 产物
104
+
105
+ ```
106
+ 结果目录/
107
+ ├─ images/ 教学图片集(PNG,曲线矢量图已由 PowerPoint 渲染)
108
+ ├─ <名>_captions.md 图片理解(图片类型/内容理解/教学用途)
109
+ ├─ <名>_textbook.md 教材文案(每页一节,≥300 字教材口吻)
110
+ ├─ <名>_binding.json 图文绑定(按页 {page, text, images[{file, caption}]})
111
+ └─ 过程文件/ 中间产物(by_page / manifest / texts / formulas / …)
112
+ ```
113
+
114
+ ## 应用
115
+
116
+ - 课程知识内容体系自动构建(章 → 节 → 知识点 → 公式 + 配图)
117
+ - 基于学情测验的个性化学习内容生成
118
+ - 教材二次开发与多形态出版(HTML / Deck / Word / PDF)
119
+ - 智能问答与 RAG 检索(binding.json 作索引,答案图文并茂)
120
+ - 试题与测验生成(按 Bloom 认知层次,真实配图出题)
121
+
122
+ ## License
123
+
124
+ MIT
@@ -0,0 +1,96 @@
1
+ # pptx-wzq · PPT 多模态教学知识库自动化构建
2
+
3
+ > **作者:吴振谦 · wuzhenqian@nbu.edu.cn · QQ:38328063**
4
+ > 本项目帮助高校教师把教学 PPT 自动转化为图文并茂的多模态教学知识库。
5
+
6
+ 把一份教学 PPT 自动转化为**可检索、可复用、可再加工**的多模态教学知识库:
7
+ 图片集 + 图片 AI 理解 + 公式 LaTeX + 教材文案 + 图文绑定 JSON,并可一键导出
8
+ 教材 HTML 与教学 Deck。
9
+
10
+ ```
11
+ PPT(.pptx)
12
+ → 图片提取/过滤 pptx-img
13
+ → 公式提取 pptx-formula
14
+ → 文本提取 pptx-text
15
+ → 图片AI解读 pptx-caption
16
+ → 教材文案 pptx-author
17
+ → 图文绑定 pptx-bind
18
+ → 一条命令编排 pptx-paser
19
+ → 教材 HTML/Deck pptx-html / pptx-deck
20
+ ```
21
+
22
+ ## 安装
23
+
24
+ ```bash
25
+ pip install pptx-wzq # 核心
26
+ pip install "pptx-wzq[ocr]" # 含本地公式 OCR(pix2tex,可选)
27
+ ```
28
+
29
+ Windows 下会自动安装 pywin32(用于 PowerPoint 渲染矢量图)。
30
+ 首次运行 `pptx-paser` 会自动补齐缺失组件、检查 API Key
31
+ (DeepSeek / 阿里云百炼)并引导注册。
32
+
33
+ ## 快速开始
34
+
35
+ ```bash
36
+ # 一条命令跑完整流水线(自动装依赖 / 引导 Key / 预估 Token / 确认执行)
37
+ pptx-paser 第九章功率放大电路.pptx -o output
38
+
39
+ # 结果目录:
40
+ # output/images/ + output/<名>_captions.md + <名>_textbook.md + <名>_binding.json
41
+
42
+ # 导出教材 HTML(MathJax 公式渲染)
43
+ pptx-html output -o output/第九章.html
44
+
45
+ # 分步执行 / 断点续跑
46
+ pptx-img 课件.pptx -o out
47
+ pptx-caption out/images -o cap.md --texts out/texts.md --formulas out/formulas.md
48
+ pptx-paser 课件.pptx -o out --skip img,formula,text
49
+ ```
50
+
51
+ ## 指令一览
52
+
53
+ | 命令 | 功能 | 模型 | Token |
54
+ |---|---|---|---|
55
+ | `pptx-img` | 图片提取 + 三路过滤 + WMF 识别/渲染 + 公式图片补提 | — | 0 |
56
+ | `pptx-formula` | 公式三路径提取(OMML / EQ3-MTEF / OCR)→ LaTeX | — | 0 |
57
+ | `pptx-text` | 逐页文本/表格提取,排除页眉页脚 | — | 0 |
58
+ | `pptx-caption` | 图片 AI 解读(文档上下文模式,教材角度) | qwen3.7-plus | 有 |
59
+ | `pptx-author` | 教材文案(学科推断 + 整文生成 + 自适应分批) | deepseek-v4-flash | 有 |
60
+ | `pptx-bind` | 图文绑定 JSON(每页文案 ↔ 该页图片) | — | 0 |
61
+ | `pptx-paser` | 整体编排:环境自检 / Key 引导 / Token 预估 / 汇报 | — | — |
62
+ | `pptx-html` | 单文件教材 HTML(MathJax 公式 + PPT 原生标题) | — | 0 |
63
+ | `pptx-deck` | 教育蓝图风格教学 Deck(示例脚本) | — | 0 |
64
+
65
+ ## API Key
66
+
67
+ | 用途 | 平台 | 模型 |
68
+ |---|---|---|
69
+ | 图片 AI 解读 / 公式图片识别 | 阿里云百炼(bailian.console.aliyun.com) | qwen3.7-plus |
70
+ | 教材文案 / 学科判断 | DeepSeek(platform.deepseek.com) | deepseek-v4-flash |
71
+
72
+ 缺失时 `pptx-paser` 会打印注册引导并交互写入环境变量(`DEEPSEEK_API_KEY` /
73
+ `DASHSCOPE_API_KEY`)。
74
+
75
+ ## 产物
76
+
77
+ ```
78
+ 结果目录/
79
+ ├─ images/ 教学图片集(PNG,曲线矢量图已由 PowerPoint 渲染)
80
+ ├─ <名>_captions.md 图片理解(图片类型/内容理解/教学用途)
81
+ ├─ <名>_textbook.md 教材文案(每页一节,≥300 字教材口吻)
82
+ ├─ <名>_binding.json 图文绑定(按页 {page, text, images[{file, caption}]})
83
+ └─ 过程文件/ 中间产物(by_page / manifest / texts / formulas / …)
84
+ ```
85
+
86
+ ## 应用
87
+
88
+ - 课程知识内容体系自动构建(章 → 节 → 知识点 → 公式 + 配图)
89
+ - 基于学情测验的个性化学习内容生成
90
+ - 教材二次开发与多形态出版(HTML / Deck / Word / PDF)
91
+ - 智能问答与 RAG 检索(binding.json 作索引,答案图文并茂)
92
+ - 试题与测验生成(按 Bloom 认知层次,真实配图出题)
93
+
94
+ ## License
95
+
96
+ MIT
@@ -0,0 +1,51 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pptx-wzq"
7
+ version = "1.0.0"
8
+ description = "PPT 多模态教学知识库自动化构建:图片/公式/文本提取 → 图片AI解读 → 教材文案 → 图文绑定 → 教材HTML/Deck"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Wu Zheqian" }]
13
+ keywords = ["pptx", "education", "knowledge-base", "multimodal", "latex", "ocr"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Education",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Programming Language :: Python :: 3",
19
+ "Topic :: Education",
20
+ "Topic :: Text Processing :: Markup :: LaTeX",
21
+ ]
22
+ dependencies = [
23
+ "Pillow>=9.0",
24
+ "openai>=1.0",
25
+ "olefile>=0.46",
26
+ "ultralytics>=8.0",
27
+ "omml2latex>=0.1.1",
28
+ "pywin32>=306; platform_system == 'Windows'",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ ocr = ["pix2tex>=0.1.2"]
33
+ dev = ["pytest>=7.0"]
34
+
35
+ [project.scripts]
36
+ pptx-img = "pptx_wzq.cli_img:main"
37
+ pptx-formula = "pptx_wzq.cli_formula:main"
38
+ pptx-text = "pptx_wzq.cli_text:main"
39
+ pptx-caption = "pptx_wzq.cli_caption:main"
40
+ pptx-author = "pptx_wzq.cli_author:main"
41
+ pptx-bind = "pptx_wzq.cli_bind:main"
42
+ pptx-paser = "pptx_wzq.cli_paser:main"
43
+ pptx-html = "pptx_wzq.gen_html:main"
44
+ pptx-deck = "pptx_wzq.build_deck:main"
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+ include = ["pptx_wzq*"]
49
+
50
+ [tool.setuptools.package-data]
51
+ pptx_wzq = ["mtef_decoder/*.py"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ __version__ = "1.0.0"
2
+ __all__ = ["cli_common", "extract_pptx_images", "img_filter", "pptrender",
3
+ "cli_img", "cli_formula", "cli_text", "cli_caption",
4
+ "cli_author", "cli_bind", "cli_paser", "gen_html", "build_deck"]