officecli-patch 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.
- officecli_patch-0.1.2/PKG-INFO +93 -0
- officecli_patch-0.1.2/README.md +82 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/setup.py +5 -0
- officecli_patch-0.1.2/src/officecli_patch.egg-info/PKG-INFO +93 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch.egg-info/SOURCES.txt +1 -0
- officecli_patch-0.1.1/PKG-INFO +0 -7
- officecli_patch-0.1.1/src/officecli_patch.egg-info/PKG-INFO +0 -7
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/pyproject.toml +0 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/setup.cfg +0 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch/__init__.py +0 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch/_release.py +0 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch/launcher.py +0 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch.egg-info/dependency_links.txt +0 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch.egg-info/entry_points.txt +0 -0
- {officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: officecli-patch
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Cross-platform launcher for officecli-patch GitHub Release binaries
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Dynamic: description
|
|
8
|
+
Dynamic: description-content-type
|
|
9
|
+
Dynamic: requires-python
|
|
10
|
+
Dynamic: summary
|
|
11
|
+
|
|
12
|
+
# officecli-patch
|
|
13
|
+
|
|
14
|
+
[繁體中文](#繁體中文) · [English](#english)
|
|
15
|
+
|
|
16
|
+
## 繁體中文
|
|
17
|
+
|
|
18
|
+
`officecli-patch` 是 [iOfficeAI OfficeCLI](https://github.com/iOfficeAI/OfficeCLI) 的相容擴充工具。它保留官方 OfficeCLI 的所有原生指令與參數,並新增 `diff` 與 `rewrite`。
|
|
19
|
+
|
|
20
|
+
### 為什麼會有這個套件?
|
|
21
|
+
|
|
22
|
+
官方 OfficeCLI 很適合 dump、檢查與批次處理 Office 文件。不過,當文件已有既定格式,例如信紙、合約、婚禮菜單或公司範本時,直接回寫 AI 產生的完整 JSON,可能影響原本不該變動的文件內容。
|
|
23
|
+
|
|
24
|
+
常見需求其實是:**只修改 AI 真正改過的文字,同時保留原始 DOCX 的 watermark、logo、頁首/頁尾、圖片、shape、表格、樣式與 relationship。**
|
|
25
|
+
|
|
26
|
+
官方 OfficeCLI 目前尚未提供這個「以原始文件為基礎、只套用文字差異」的整合流程。`officecli-patch` 因此將手動複製文件、比較 JSON、產生 patch、再執行 batch 的流程,收斂為 `rewrite` 指令。
|
|
27
|
+
|
|
28
|
+
### 安裝與使用
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install officecli-patch
|
|
32
|
+
|
|
33
|
+
# 先 dump 原始文件;AI 只修改 original.json 中的 props.text 後另存 ai.json
|
|
34
|
+
officecli-patch dump original.docx -o original.json
|
|
35
|
+
officecli-patch rewrite original.docx original.json ai.json -o rewritten.docx
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
若只需要查看文字差異:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
officecli-patch diff original.json ai.json -o patch.json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
其他命令都會直接轉交官方 OfficeCLI:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
officecli-patch validate original.docx
|
|
48
|
+
officecli-patch batch document.docx --input commands.json
|
|
49
|
+
officecli-patch raw --help
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
首次執行時,PyPI 啟動器會自動判斷作業系統、CPU 架構與 Linux libc 類型,從 GitHub Release 下載對應執行檔、驗證 SHA-256 並快取到本機。
|
|
53
|
+
|
|
54
|
+
## English
|
|
55
|
+
|
|
56
|
+
`officecli-patch` is a compatible extension for [iOfficeAI OfficeCLI](https://github.com/iOfficeAI/OfficeCLI). It preserves all official OfficeCLI commands and arguments, and adds `diff` and `rewrite`.
|
|
57
|
+
|
|
58
|
+
### Why does this package exist?
|
|
59
|
+
|
|
60
|
+
OfficeCLI is excellent for dumping, inspecting, and batch-processing Office documents. But for a document with an established design—such as letterhead, a contract, a wedding menu, or a company template—writing back an entire AI-generated JSON document can alter content that was never meant to change.
|
|
61
|
+
|
|
62
|
+
The practical requirement is usually: **change only the text the AI actually changed, while retaining the original DOCX watermark, logo, headers/footers, images, shapes, tables, styles, and relationships.**
|
|
63
|
+
|
|
64
|
+
Official OfficeCLI does not yet provide an integrated workflow that starts from the original document and applies text-only differences. `officecli-patch` provides that workflow through `rewrite`, replacing the manual copy → JSON comparison → patch generation → batch application sequence.
|
|
65
|
+
|
|
66
|
+
### Install and use
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install officecli-patch
|
|
70
|
+
|
|
71
|
+
# Dump the source document. Let the AI edit only props.text in original.json,
|
|
72
|
+
# then save it as ai.json.
|
|
73
|
+
officecli-patch dump original.docx -o original.json
|
|
74
|
+
officecli-patch rewrite original.docx original.json ai.json -o rewritten.docx
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
To inspect or save the text patch only:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
officecli-patch diff original.json ai.json -o patch.json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Every other command is passed through to the embedded official OfficeCLI:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
officecli-patch validate original.docx
|
|
87
|
+
officecli-patch batch document.docx --input commands.json
|
|
88
|
+
officecli-patch raw --help
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
On first use, the PyPI launcher detects the operating system, CPU architecture, and Linux libc variant. It downloads the matching GitHub Release binary, verifies its SHA-256 checksum, caches it locally, and runs it.
|
|
92
|
+
|
|
93
|
+
Source code, full documentation, and releases: [bruce601080102/officecli-patch](https://github.com/bruce601080102/officecli-patch).
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# officecli-patch
|
|
2
|
+
|
|
3
|
+
[繁體中文](#繁體中文) · [English](#english)
|
|
4
|
+
|
|
5
|
+
## 繁體中文
|
|
6
|
+
|
|
7
|
+
`officecli-patch` 是 [iOfficeAI OfficeCLI](https://github.com/iOfficeAI/OfficeCLI) 的相容擴充工具。它保留官方 OfficeCLI 的所有原生指令與參數,並新增 `diff` 與 `rewrite`。
|
|
8
|
+
|
|
9
|
+
### 為什麼會有這個套件?
|
|
10
|
+
|
|
11
|
+
官方 OfficeCLI 很適合 dump、檢查與批次處理 Office 文件。不過,當文件已有既定格式,例如信紙、合約、婚禮菜單或公司範本時,直接回寫 AI 產生的完整 JSON,可能影響原本不該變動的文件內容。
|
|
12
|
+
|
|
13
|
+
常見需求其實是:**只修改 AI 真正改過的文字,同時保留原始 DOCX 的 watermark、logo、頁首/頁尾、圖片、shape、表格、樣式與 relationship。**
|
|
14
|
+
|
|
15
|
+
官方 OfficeCLI 目前尚未提供這個「以原始文件為基礎、只套用文字差異」的整合流程。`officecli-patch` 因此將手動複製文件、比較 JSON、產生 patch、再執行 batch 的流程,收斂為 `rewrite` 指令。
|
|
16
|
+
|
|
17
|
+
### 安裝與使用
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install officecli-patch
|
|
21
|
+
|
|
22
|
+
# 先 dump 原始文件;AI 只修改 original.json 中的 props.text 後另存 ai.json
|
|
23
|
+
officecli-patch dump original.docx -o original.json
|
|
24
|
+
officecli-patch rewrite original.docx original.json ai.json -o rewritten.docx
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
若只需要查看文字差異:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
officecli-patch diff original.json ai.json -o patch.json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
其他命令都會直接轉交官方 OfficeCLI:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
officecli-patch validate original.docx
|
|
37
|
+
officecli-patch batch document.docx --input commands.json
|
|
38
|
+
officecli-patch raw --help
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
首次執行時,PyPI 啟動器會自動判斷作業系統、CPU 架構與 Linux libc 類型,從 GitHub Release 下載對應執行檔、驗證 SHA-256 並快取到本機。
|
|
42
|
+
|
|
43
|
+
## English
|
|
44
|
+
|
|
45
|
+
`officecli-patch` is a compatible extension for [iOfficeAI OfficeCLI](https://github.com/iOfficeAI/OfficeCLI). It preserves all official OfficeCLI commands and arguments, and adds `diff` and `rewrite`.
|
|
46
|
+
|
|
47
|
+
### Why does this package exist?
|
|
48
|
+
|
|
49
|
+
OfficeCLI is excellent for dumping, inspecting, and batch-processing Office documents. But for a document with an established design—such as letterhead, a contract, a wedding menu, or a company template—writing back an entire AI-generated JSON document can alter content that was never meant to change.
|
|
50
|
+
|
|
51
|
+
The practical requirement is usually: **change only the text the AI actually changed, while retaining the original DOCX watermark, logo, headers/footers, images, shapes, tables, styles, and relationships.**
|
|
52
|
+
|
|
53
|
+
Official OfficeCLI does not yet provide an integrated workflow that starts from the original document and applies text-only differences. `officecli-patch` provides that workflow through `rewrite`, replacing the manual copy → JSON comparison → patch generation → batch application sequence.
|
|
54
|
+
|
|
55
|
+
### Install and use
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install officecli-patch
|
|
59
|
+
|
|
60
|
+
# Dump the source document. Let the AI edit only props.text in original.json,
|
|
61
|
+
# then save it as ai.json.
|
|
62
|
+
officecli-patch dump original.docx -o original.json
|
|
63
|
+
officecli-patch rewrite original.docx original.json ai.json -o rewritten.docx
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
To inspect or save the text patch only:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
officecli-patch diff original.json ai.json -o patch.json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Every other command is passed through to the embedded official OfficeCLI:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
officecli-patch validate original.docx
|
|
76
|
+
officecli-patch batch document.docx --input commands.json
|
|
77
|
+
officecli-patch raw --help
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
On first use, the PyPI launcher detects the operating system, CPU architecture, and Linux libc variant. It downloads the matching GitHub Release binary, verifies its SHA-256 checksum, caches it locally, and runs it.
|
|
81
|
+
|
|
82
|
+
Source code, full documentation, and releases: [bruce601080102/officecli-patch](https://github.com/bruce601080102/officecli-patch).
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
from os import environ
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
from setuptools import find_packages, setup
|
|
3
4
|
|
|
5
|
+
root = Path(__file__).parent
|
|
6
|
+
|
|
4
7
|
setup(
|
|
5
8
|
name="officecli-patch",
|
|
6
9
|
version=environ.get("OFFICECLI_PATCH_VERSION", "0.2.0"),
|
|
7
10
|
description="Cross-platform launcher for officecli-patch GitHub Release binaries",
|
|
11
|
+
long_description=(root / "README.md").read_text(encoding="utf-8"),
|
|
12
|
+
long_description_content_type="text/markdown",
|
|
8
13
|
python_requires=">=3.9",
|
|
9
14
|
package_dir={"": "src"},
|
|
10
15
|
packages=find_packages("src"),
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: officecli-patch
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Cross-platform launcher for officecli-patch GitHub Release binaries
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Dynamic: description
|
|
8
|
+
Dynamic: description-content-type
|
|
9
|
+
Dynamic: requires-python
|
|
10
|
+
Dynamic: summary
|
|
11
|
+
|
|
12
|
+
# officecli-patch
|
|
13
|
+
|
|
14
|
+
[繁體中文](#繁體中文) · [English](#english)
|
|
15
|
+
|
|
16
|
+
## 繁體中文
|
|
17
|
+
|
|
18
|
+
`officecli-patch` 是 [iOfficeAI OfficeCLI](https://github.com/iOfficeAI/OfficeCLI) 的相容擴充工具。它保留官方 OfficeCLI 的所有原生指令與參數,並新增 `diff` 與 `rewrite`。
|
|
19
|
+
|
|
20
|
+
### 為什麼會有這個套件?
|
|
21
|
+
|
|
22
|
+
官方 OfficeCLI 很適合 dump、檢查與批次處理 Office 文件。不過,當文件已有既定格式,例如信紙、合約、婚禮菜單或公司範本時,直接回寫 AI 產生的完整 JSON,可能影響原本不該變動的文件內容。
|
|
23
|
+
|
|
24
|
+
常見需求其實是:**只修改 AI 真正改過的文字,同時保留原始 DOCX 的 watermark、logo、頁首/頁尾、圖片、shape、表格、樣式與 relationship。**
|
|
25
|
+
|
|
26
|
+
官方 OfficeCLI 目前尚未提供這個「以原始文件為基礎、只套用文字差異」的整合流程。`officecli-patch` 因此將手動複製文件、比較 JSON、產生 patch、再執行 batch 的流程,收斂為 `rewrite` 指令。
|
|
27
|
+
|
|
28
|
+
### 安裝與使用
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install officecli-patch
|
|
32
|
+
|
|
33
|
+
# 先 dump 原始文件;AI 只修改 original.json 中的 props.text 後另存 ai.json
|
|
34
|
+
officecli-patch dump original.docx -o original.json
|
|
35
|
+
officecli-patch rewrite original.docx original.json ai.json -o rewritten.docx
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
若只需要查看文字差異:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
officecli-patch diff original.json ai.json -o patch.json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
其他命令都會直接轉交官方 OfficeCLI:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
officecli-patch validate original.docx
|
|
48
|
+
officecli-patch batch document.docx --input commands.json
|
|
49
|
+
officecli-patch raw --help
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
首次執行時,PyPI 啟動器會自動判斷作業系統、CPU 架構與 Linux libc 類型,從 GitHub Release 下載對應執行檔、驗證 SHA-256 並快取到本機。
|
|
53
|
+
|
|
54
|
+
## English
|
|
55
|
+
|
|
56
|
+
`officecli-patch` is a compatible extension for [iOfficeAI OfficeCLI](https://github.com/iOfficeAI/OfficeCLI). It preserves all official OfficeCLI commands and arguments, and adds `diff` and `rewrite`.
|
|
57
|
+
|
|
58
|
+
### Why does this package exist?
|
|
59
|
+
|
|
60
|
+
OfficeCLI is excellent for dumping, inspecting, and batch-processing Office documents. But for a document with an established design—such as letterhead, a contract, a wedding menu, or a company template—writing back an entire AI-generated JSON document can alter content that was never meant to change.
|
|
61
|
+
|
|
62
|
+
The practical requirement is usually: **change only the text the AI actually changed, while retaining the original DOCX watermark, logo, headers/footers, images, shapes, tables, styles, and relationships.**
|
|
63
|
+
|
|
64
|
+
Official OfficeCLI does not yet provide an integrated workflow that starts from the original document and applies text-only differences. `officecli-patch` provides that workflow through `rewrite`, replacing the manual copy → JSON comparison → patch generation → batch application sequence.
|
|
65
|
+
|
|
66
|
+
### Install and use
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install officecli-patch
|
|
70
|
+
|
|
71
|
+
# Dump the source document. Let the AI edit only props.text in original.json,
|
|
72
|
+
# then save it as ai.json.
|
|
73
|
+
officecli-patch dump original.docx -o original.json
|
|
74
|
+
officecli-patch rewrite original.docx original.json ai.json -o rewritten.docx
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
To inspect or save the text patch only:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
officecli-patch diff original.json ai.json -o patch.json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Every other command is passed through to the embedded official OfficeCLI:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
officecli-patch validate original.docx
|
|
87
|
+
officecli-patch batch document.docx --input commands.json
|
|
88
|
+
officecli-patch raw --help
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
On first use, the PyPI launcher detects the operating system, CPU architecture, and Linux libc variant. It downloads the matching GitHub Release binary, verifies its SHA-256 checksum, caches it locally, and runs it.
|
|
92
|
+
|
|
93
|
+
Source code, full documentation, and releases: [bruce601080102/officecli-patch](https://github.com/bruce601080102/officecli-patch).
|
officecli_patch-0.1.1/PKG-INFO
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{officecli_patch-0.1.1 → officecli_patch-0.1.2}/src/officecli_patch.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|