pyvision-bot 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 邱祺峰
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,256 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyvision-bot
3
+ Version: 0.1.0
4
+ Summary: OpenCV image automation for desktop and Android (ADB) with template matching.
5
+ Author: 邱祺峰
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Chifeng-chiu/_se/tree/main/HW8/pyvision-bot
8
+ Project-URL: Repository, https://github.com/Chifeng-chiu/_se
9
+ Project-URL: Issues, https://github.com/Chifeng-chiu/_se/issues
10
+ Keywords: automation,opencv,template-matching,adb,android,gui,rpa
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Testing
21
+ Classifier: Topic :: Software Development :: User Interfaces
22
+ Classifier: Topic :: Multimedia :: Graphics
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: opencv-python>=4.8.0
27
+ Requires-Dist: numpy>=1.23.0
28
+ Requires-Dist: mss>=9.0.1
29
+ Requires-Dist: pyautogui>=0.9.54
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.4; extra == "dev"
32
+ Requires-Dist: build>=1.0; extra == "dev"
33
+ Requires-Dist: twine>=5.0; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ # pyvision-bot
37
+
38
+ [![PyPI](https://img.shields.io/pypi/v/pyvision-bot.svg)](https://pypi.org/project/pyvision-bot/)
39
+ [![Python](https://img.shields.io/pypi/pyversions/pyvision-bot.svg)](https://pypi.org/project/pyvision-bot/)
40
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
41
+
42
+ 以 **OpenCV 模板比對**驅動的影像自動化套件,同時支援 **Windows / macOS / Linux 桌面**與 **Android(ADB)**。用一張按鈕截圖就能等待畫面出現、點擊、拖曳,適合 GUI 測試、RPA 與手機遊戲自動化。
43
+
44
+ ## 特色
45
+
46
+ * **雙模式後端**:`DesktopBackend`(`mss` 截圖 + `pyautogui` 操作)與 `ADBBackend`(`adb exec-out screencap` + `adb shell input`)
47
+ * **OpenCV 找圖**:`cv2.matchTemplate` + `TM_CCOEFF_NORMED`,支援灰階加速與 ROI 裁切
48
+ * **座標正確**:使用 ROI 時,回傳的仍是全螢幕絕對座標
49
+ * **多目標偵測**:`find_all()` 內建非極大值抑制(NMS),同一個目標不會重複回報
50
+ * **擬人化操作**:點擊/滑動支援 `jitter` 隨機偏移與隨機微延遲
51
+ * **等待流程**:`wait_for()`、`wait_and_click()` 自動輪詢直到目標出現或逾時
52
+ * **不落地截圖**:ADB 截圖直接在記憶體用 `cv2.imdecode` 解碼,不寫暫存檔
53
+ * **完整型別註記**:所有公開 API 都有 Type Hints 與 Docstrings,附 `py.typed`
54
+
55
+ ## 安裝
56
+
57
+ ```bash
58
+ pip install pyvision-bot
59
+ ```
60
+
61
+ 從原始碼安裝(含開發工具):
62
+
63
+ ```bash
64
+ git clone https://github.com/Chifeng-chiu/_se.git
65
+ cd _se/HW8/pyvision-bot
66
+ python -m pip install -e ".[dev]"
67
+ ```
68
+
69
+ 需求:Python 3.9 以上。
70
+
71
+ > Linux 桌面若缺少 `pyautogui` 需要的系統套件,請先安裝 `python3-xlib`、`scrot` 等相依套件;ADB 模式不需要 `pyautogui`。
72
+
73
+ ## 快速上手:Desktop
74
+
75
+ ```python
76
+ from pyvision_bot import ROI, VisionBot
77
+
78
+ bot = VisionBot(mode="desktop")
79
+
80
+ # 等待按鈕出現(最多 15 秒),找到後點擊中心,加入 ±3 px 隨機偏移
81
+ clicked = bot.wait_and_click("assets/login_button.png", timeout=15, jitter=3)
82
+ print("clicked:", clicked)
83
+
84
+ # 只在畫面左上角區域找圖
85
+ match = bot.find("assets/icon.png", roi=ROI(0, 0, 1280, 720))
86
+ if match:
87
+ print("center:", match.center, "confidence:", match.confidence)
88
+ ```
89
+
90
+ * `DesktopBackend` 預設擷取 **主螢幕**(`monitor=1`)。若要擷取所有螢幕的聯集,可建立 `DesktopBackend(monitor=0)` 後注入 `VisionBot(backend=...)`。
91
+ * 座標以擷取到的螢幕左上角為原點;多螢幕且非主螢幕時請自行換算全域座標。
92
+
93
+ ## 快速上手:Android(ADB)
94
+
95
+ 前置:安裝 Android platform-tools、開啟手機 USB 偵錯,並確認 `adb devices` 看得到裝置。
96
+
97
+ ```bash
98
+ adb devices
99
+ # List of devices attached
100
+ # emulator-5554 device
101
+ ```
102
+
103
+ ```python
104
+ from pyvision_bot import VisionBot
105
+
106
+ bot = VisionBot(mode="adb", device_serial="emulator-5554")
107
+
108
+ # 等待遊戲開始按鈕並點擊
109
+ bot.wait_and_click("assets/start.png", timeout=20, jitter=2)
110
+
111
+ # 由下往上滑動
112
+ bot.swipe(540, 1600, 540, 400, duration=0.4, jitter=5)
113
+
114
+ # 取得目前畫面(BGR ndarray)
115
+ screen = bot.screenshot()
116
+ print(screen.shape)
117
+ ```
118
+
119
+ 不指定 `device_serial` 時,ADB 會使用目前唯一的裝置:
120
+
121
+ ```python
122
+ bot = VisionBot(mode="adb")
123
+ ```
124
+
125
+ ## API 說明
126
+
127
+ ### `VisionBot`
128
+
129
+ ```python
130
+ VisionBot(
131
+ mode: Literal["desktop", "adb"] = "desktop",
132
+ device_serial: str | None = None,
133
+ default_threshold: float = 0.85,
134
+ *,
135
+ backend: BaseBackend | None = None,
136
+ matcher: TemplateMatcher | None = None,
137
+ rng: random.Random | None = None,
138
+ )
139
+ ```
140
+
141
+ | 方法 | 說明 |
142
+ | --- | --- |
143
+ | `screenshot() -> np.ndarray` | 取得目前畫面(BGR) |
144
+ | `find(template_path, threshold=None, roi=None) -> MatchResult \| None` | 找最佳匹配 |
145
+ | `find_all(template_path, threshold=None, roi=None, max_results=None) -> list[MatchResult]` | 找所有不重疊匹配(NMS) |
146
+ | `click(x, y, jitter=0)` | 點擊,支援 ±jitter 像素隨機偏移 |
147
+ | `swipe(x1, y1, x2, y2, duration=0.3, jitter=0)` | 拖曳/滑動 |
148
+ | `wait_for(template_path, timeout=10.0, interval=0.5, threshold=None, roi=None)` | 輪詢等待目標出現 |
149
+ | `wait_and_click(template_path, timeout=10.0, interval=0.5, threshold=None, roi=None, jitter=3)` | 等待目標並點擊中心 |
150
+
151
+ `backend`、`matcher`、`rng` 是進階注入點:測試時可傳入自訂 backend,或傳入固定種子的 `random.Random` 讓 jitter 可重現。
152
+
153
+ ### `TemplateMatcher`
154
+
155
+ ```python
156
+ from pyvision_bot import TemplateMatcher
157
+
158
+ matcher = TemplateMatcher(threshold=0.9, grayscale=True, nms_iou=0.3)
159
+ screen = bot.screenshot()
160
+
161
+ best = matcher.find(screen, "assets/target.png")
162
+ all_matches = matcher.find_all(screen, "assets/target.png", max_results=5)
163
+ ```
164
+
165
+ | 參數 | 預設 | 說明 |
166
+ | --- | --- | --- |
167
+ | `threshold` | `0.85` | 相似度門檻(0~1) |
168
+ | `grayscale` | `True` | 轉灰階比對,速度較快 |
169
+ | `nms_iou` | `0.3` | `find_all()` 的 NMS IoU 門檻 |
170
+
171
+ `template_path` 可以是檔案路徑、`pathlib.Path`,或直接傳入 `numpy` 陣列。
172
+
173
+ ### 資料結構
174
+
175
+ ```python
176
+ from pyvision_bot import MatchResult, ROI
177
+
178
+ match = MatchResult(x=100, y=50, width=40, height=30, confidence=0.97)
179
+ print(match.center) # (120, 65)
180
+
181
+ roi = ROI(0, 0, 1280, 720)
182
+ print(roi.box) # (0, 0, 1280, 720)
183
+ ```
184
+
185
+ * `MatchResult.center` 回傳 `(cx, cy)`。
186
+ * `ROI` 也接受 `(x, y, w, h)` tuple;超出螢幕的區域會自動裁切,完全在畫面外則拋出 `ValueError`。
187
+
188
+ ### 自訂 Backend
189
+
190
+ 繼承 `BaseBackend` 即可接入其他來源(例如模擬器、遠端桌面):
191
+
192
+ ```python
193
+ from pyvision_bot import BaseBackend
194
+ import numpy as np
195
+
196
+
197
+ class MyBackend(BaseBackend):
198
+ def screenshot(self) -> np.ndarray:
199
+ ...
200
+
201
+ def click(self, x: int, y: int) -> None:
202
+ ...
203
+
204
+ def swipe(self, x1: int, y1: int, x2: int, y2: int, duration: float) -> None:
205
+ ...
206
+ ```
207
+
208
+ ## 擬人化行為
209
+
210
+ `click()` 與 `swipe()` 會:
211
+
212
+ 1. 在動作前插入 20~80 ms 的隨機延遲
213
+ 2. 若 `jitter > 0`,在每個座標軸加入 `±jitter` 像素的隨機偏移
214
+
215
+ ```python
216
+ bot.click(500, 300, jitter=4)
217
+ bot.swipe(200, 800, 200, 200, duration=0.5, jitter=3)
218
+ ```
219
+
220
+ 這可以降低固定座標、固定節奏造成的機械感,但**不保證**能繞過任何特定服務的偵測機制。
221
+
222
+ ## 開發與測試
223
+
224
+ ```bash
225
+ python -m pip install -e ".[dev]"
226
+ pytest
227
+ ```
228
+
229
+ 測試完全使用合成的 `numpy` 圖片與 Mock Backend,不需要真實螢幕、滑鼠或 ADB 裝置。
230
+
231
+ ## 打包與發佈
232
+
233
+ ```bash
234
+ python -m build
235
+ twine check dist/*
236
+ twine upload dist/*
237
+ ```
238
+
239
+ 發佈前請確認 `pyproject.toml` 的 `authors`、`project.urls` 是你要的資訊,並設定 PyPI API token:
240
+
241
+ ```bash
242
+ # PowerShell
243
+ $env:TWINE_USERNAME = "__token__"
244
+ $env:TWINE_PASSWORD = "pypi-..."
245
+ ```
246
+
247
+ ## 注意事項
248
+
249
+ * 桌面模式的座標與螢幕縮放(DPI scaling)有關;若 Windows 設定 125% / 150% 縮放,請確認截圖與 `pyautogui` 使用相同的座標系。
250
+ * `pyautogui` 預設啟用滑鼠移到左上角即中止的 failsafe,緊急時可把滑鼠移到 (0, 0)。
251
+ * ADB 模式需要裝置已授權此電腦;首次連線請在手機上按「允許 USB 偵錯」。
252
+ * 本套件只提供影像比對與輸入模擬,請僅用於你擁有或獲授權操作的裝置與服務。
253
+
254
+ ## License
255
+
256
+ MIT License,詳見 [LICENSE](LICENSE)。
@@ -0,0 +1,221 @@
1
+ # pyvision-bot
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/pyvision-bot.svg)](https://pypi.org/project/pyvision-bot/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/pyvision-bot.svg)](https://pypi.org/project/pyvision-bot/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+
7
+ 以 **OpenCV 模板比對**驅動的影像自動化套件,同時支援 **Windows / macOS / Linux 桌面**與 **Android(ADB)**。用一張按鈕截圖就能等待畫面出現、點擊、拖曳,適合 GUI 測試、RPA 與手機遊戲自動化。
8
+
9
+ ## 特色
10
+
11
+ * **雙模式後端**:`DesktopBackend`(`mss` 截圖 + `pyautogui` 操作)與 `ADBBackend`(`adb exec-out screencap` + `adb shell input`)
12
+ * **OpenCV 找圖**:`cv2.matchTemplate` + `TM_CCOEFF_NORMED`,支援灰階加速與 ROI 裁切
13
+ * **座標正確**:使用 ROI 時,回傳的仍是全螢幕絕對座標
14
+ * **多目標偵測**:`find_all()` 內建非極大值抑制(NMS),同一個目標不會重複回報
15
+ * **擬人化操作**:點擊/滑動支援 `jitter` 隨機偏移與隨機微延遲
16
+ * **等待流程**:`wait_for()`、`wait_and_click()` 自動輪詢直到目標出現或逾時
17
+ * **不落地截圖**:ADB 截圖直接在記憶體用 `cv2.imdecode` 解碼,不寫暫存檔
18
+ * **完整型別註記**:所有公開 API 都有 Type Hints 與 Docstrings,附 `py.typed`
19
+
20
+ ## 安裝
21
+
22
+ ```bash
23
+ pip install pyvision-bot
24
+ ```
25
+
26
+ 從原始碼安裝(含開發工具):
27
+
28
+ ```bash
29
+ git clone https://github.com/Chifeng-chiu/_se.git
30
+ cd _se/HW8/pyvision-bot
31
+ python -m pip install -e ".[dev]"
32
+ ```
33
+
34
+ 需求:Python 3.9 以上。
35
+
36
+ > Linux 桌面若缺少 `pyautogui` 需要的系統套件,請先安裝 `python3-xlib`、`scrot` 等相依套件;ADB 模式不需要 `pyautogui`。
37
+
38
+ ## 快速上手:Desktop
39
+
40
+ ```python
41
+ from pyvision_bot import ROI, VisionBot
42
+
43
+ bot = VisionBot(mode="desktop")
44
+
45
+ # 等待按鈕出現(最多 15 秒),找到後點擊中心,加入 ±3 px 隨機偏移
46
+ clicked = bot.wait_and_click("assets/login_button.png", timeout=15, jitter=3)
47
+ print("clicked:", clicked)
48
+
49
+ # 只在畫面左上角區域找圖
50
+ match = bot.find("assets/icon.png", roi=ROI(0, 0, 1280, 720))
51
+ if match:
52
+ print("center:", match.center, "confidence:", match.confidence)
53
+ ```
54
+
55
+ * `DesktopBackend` 預設擷取 **主螢幕**(`monitor=1`)。若要擷取所有螢幕的聯集,可建立 `DesktopBackend(monitor=0)` 後注入 `VisionBot(backend=...)`。
56
+ * 座標以擷取到的螢幕左上角為原點;多螢幕且非主螢幕時請自行換算全域座標。
57
+
58
+ ## 快速上手:Android(ADB)
59
+
60
+ 前置:安裝 Android platform-tools、開啟手機 USB 偵錯,並確認 `adb devices` 看得到裝置。
61
+
62
+ ```bash
63
+ adb devices
64
+ # List of devices attached
65
+ # emulator-5554 device
66
+ ```
67
+
68
+ ```python
69
+ from pyvision_bot import VisionBot
70
+
71
+ bot = VisionBot(mode="adb", device_serial="emulator-5554")
72
+
73
+ # 等待遊戲開始按鈕並點擊
74
+ bot.wait_and_click("assets/start.png", timeout=20, jitter=2)
75
+
76
+ # 由下往上滑動
77
+ bot.swipe(540, 1600, 540, 400, duration=0.4, jitter=5)
78
+
79
+ # 取得目前畫面(BGR ndarray)
80
+ screen = bot.screenshot()
81
+ print(screen.shape)
82
+ ```
83
+
84
+ 不指定 `device_serial` 時,ADB 會使用目前唯一的裝置:
85
+
86
+ ```python
87
+ bot = VisionBot(mode="adb")
88
+ ```
89
+
90
+ ## API 說明
91
+
92
+ ### `VisionBot`
93
+
94
+ ```python
95
+ VisionBot(
96
+ mode: Literal["desktop", "adb"] = "desktop",
97
+ device_serial: str | None = None,
98
+ default_threshold: float = 0.85,
99
+ *,
100
+ backend: BaseBackend | None = None,
101
+ matcher: TemplateMatcher | None = None,
102
+ rng: random.Random | None = None,
103
+ )
104
+ ```
105
+
106
+ | 方法 | 說明 |
107
+ | --- | --- |
108
+ | `screenshot() -> np.ndarray` | 取得目前畫面(BGR) |
109
+ | `find(template_path, threshold=None, roi=None) -> MatchResult \| None` | 找最佳匹配 |
110
+ | `find_all(template_path, threshold=None, roi=None, max_results=None) -> list[MatchResult]` | 找所有不重疊匹配(NMS) |
111
+ | `click(x, y, jitter=0)` | 點擊,支援 ±jitter 像素隨機偏移 |
112
+ | `swipe(x1, y1, x2, y2, duration=0.3, jitter=0)` | 拖曳/滑動 |
113
+ | `wait_for(template_path, timeout=10.0, interval=0.5, threshold=None, roi=None)` | 輪詢等待目標出現 |
114
+ | `wait_and_click(template_path, timeout=10.0, interval=0.5, threshold=None, roi=None, jitter=3)` | 等待目標並點擊中心 |
115
+
116
+ `backend`、`matcher`、`rng` 是進階注入點:測試時可傳入自訂 backend,或傳入固定種子的 `random.Random` 讓 jitter 可重現。
117
+
118
+ ### `TemplateMatcher`
119
+
120
+ ```python
121
+ from pyvision_bot import TemplateMatcher
122
+
123
+ matcher = TemplateMatcher(threshold=0.9, grayscale=True, nms_iou=0.3)
124
+ screen = bot.screenshot()
125
+
126
+ best = matcher.find(screen, "assets/target.png")
127
+ all_matches = matcher.find_all(screen, "assets/target.png", max_results=5)
128
+ ```
129
+
130
+ | 參數 | 預設 | 說明 |
131
+ | --- | --- | --- |
132
+ | `threshold` | `0.85` | 相似度門檻(0~1) |
133
+ | `grayscale` | `True` | 轉灰階比對,速度較快 |
134
+ | `nms_iou` | `0.3` | `find_all()` 的 NMS IoU 門檻 |
135
+
136
+ `template_path` 可以是檔案路徑、`pathlib.Path`,或直接傳入 `numpy` 陣列。
137
+
138
+ ### 資料結構
139
+
140
+ ```python
141
+ from pyvision_bot import MatchResult, ROI
142
+
143
+ match = MatchResult(x=100, y=50, width=40, height=30, confidence=0.97)
144
+ print(match.center) # (120, 65)
145
+
146
+ roi = ROI(0, 0, 1280, 720)
147
+ print(roi.box) # (0, 0, 1280, 720)
148
+ ```
149
+
150
+ * `MatchResult.center` 回傳 `(cx, cy)`。
151
+ * `ROI` 也接受 `(x, y, w, h)` tuple;超出螢幕的區域會自動裁切,完全在畫面外則拋出 `ValueError`。
152
+
153
+ ### 自訂 Backend
154
+
155
+ 繼承 `BaseBackend` 即可接入其他來源(例如模擬器、遠端桌面):
156
+
157
+ ```python
158
+ from pyvision_bot import BaseBackend
159
+ import numpy as np
160
+
161
+
162
+ class MyBackend(BaseBackend):
163
+ def screenshot(self) -> np.ndarray:
164
+ ...
165
+
166
+ def click(self, x: int, y: int) -> None:
167
+ ...
168
+
169
+ def swipe(self, x1: int, y1: int, x2: int, y2: int, duration: float) -> None:
170
+ ...
171
+ ```
172
+
173
+ ## 擬人化行為
174
+
175
+ `click()` 與 `swipe()` 會:
176
+
177
+ 1. 在動作前插入 20~80 ms 的隨機延遲
178
+ 2. 若 `jitter > 0`,在每個座標軸加入 `±jitter` 像素的隨機偏移
179
+
180
+ ```python
181
+ bot.click(500, 300, jitter=4)
182
+ bot.swipe(200, 800, 200, 200, duration=0.5, jitter=3)
183
+ ```
184
+
185
+ 這可以降低固定座標、固定節奏造成的機械感,但**不保證**能繞過任何特定服務的偵測機制。
186
+
187
+ ## 開發與測試
188
+
189
+ ```bash
190
+ python -m pip install -e ".[dev]"
191
+ pytest
192
+ ```
193
+
194
+ 測試完全使用合成的 `numpy` 圖片與 Mock Backend,不需要真實螢幕、滑鼠或 ADB 裝置。
195
+
196
+ ## 打包與發佈
197
+
198
+ ```bash
199
+ python -m build
200
+ twine check dist/*
201
+ twine upload dist/*
202
+ ```
203
+
204
+ 發佈前請確認 `pyproject.toml` 的 `authors`、`project.urls` 是你要的資訊,並設定 PyPI API token:
205
+
206
+ ```bash
207
+ # PowerShell
208
+ $env:TWINE_USERNAME = "__token__"
209
+ $env:TWINE_PASSWORD = "pypi-..."
210
+ ```
211
+
212
+ ## 注意事項
213
+
214
+ * 桌面模式的座標與螢幕縮放(DPI scaling)有關;若 Windows 設定 125% / 150% 縮放,請確認截圖與 `pyautogui` 使用相同的座標系。
215
+ * `pyautogui` 預設啟用滑鼠移到左上角即中止的 failsafe,緊急時可把滑鼠移到 (0, 0)。
216
+ * ADB 模式需要裝置已授權此電腦;首次連線請在手機上按「允許 USB 偵錯」。
217
+ * 本套件只提供影像比對與輸入模擬,請僅用於你擁有或獲授權操作的裝置與服務。
218
+
219
+ ## License
220
+
221
+ MIT License,詳見 [LICENSE](LICENSE)。
@@ -0,0 +1,71 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pyvision-bot"
7
+ version = "0.1.0"
8
+ description = "OpenCV image automation for desktop and Android (ADB) with template matching."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ { name = "邱祺峰" },
15
+ ]
16
+ keywords = [
17
+ "automation",
18
+ "opencv",
19
+ "template-matching",
20
+ "adb",
21
+ "android",
22
+ "gui",
23
+ "rpa",
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 4 - Beta",
27
+ "Intended Audience :: Developers",
28
+ "Operating System :: OS Independent",
29
+ "Programming Language :: Python :: 3",
30
+ "Programming Language :: Python :: 3.9",
31
+ "Programming Language :: Python :: 3.10",
32
+ "Programming Language :: Python :: 3.11",
33
+ "Programming Language :: Python :: 3.12",
34
+ "Programming Language :: Python :: 3.13",
35
+ "Topic :: Software Development :: Testing",
36
+ "Topic :: Software Development :: User Interfaces",
37
+ "Topic :: Multimedia :: Graphics",
38
+ ]
39
+ dependencies = [
40
+ "opencv-python>=4.8.0",
41
+ "numpy>=1.23.0",
42
+ "mss>=9.0.1",
43
+ "pyautogui>=0.9.54",
44
+ ]
45
+
46
+ [project.optional-dependencies]
47
+ dev = [
48
+ "pytest>=7.4",
49
+ "build>=1.0",
50
+ "twine>=5.0",
51
+ ]
52
+
53
+ [project.urls]
54
+ Homepage = "https://github.com/Chifeng-chiu/_se/tree/main/HW8/pyvision-bot"
55
+ Repository = "https://github.com/Chifeng-chiu/_se"
56
+ Issues = "https://github.com/Chifeng-chiu/_se/issues"
57
+
58
+ [tool.setuptools]
59
+ package-dir = { "" = "src" }
60
+
61
+ [tool.setuptools.packages.find]
62
+ where = ["src"]
63
+
64
+ [tool.setuptools.package-data]
65
+ pyvision_bot = ["py.typed"]
66
+
67
+ [tool.pytest.ini_options]
68
+ minversion = "7.0"
69
+ testpaths = ["tests"]
70
+ pythonpath = ["src"]
71
+ addopts = "-ra"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,19 @@
1
+ """pyvision-bot: OpenCV image automation for desktop and Android (ADB)."""
2
+
3
+ from .backends import ADBBackend, BaseBackend, DesktopBackend
4
+ from .bot import VisionBot
5
+ from .matcher import TemplateMatcher
6
+ from .models import MatchResult, ROI
7
+
8
+ __version__ = "0.1.0"
9
+
10
+ __all__ = [
11
+ "ADBBackend",
12
+ "BaseBackend",
13
+ "DesktopBackend",
14
+ "MatchResult",
15
+ "ROI",
16
+ "TemplateMatcher",
17
+ "VisionBot",
18
+ "__version__",
19
+ ]