LIVE · 真实运行验证通过

GitHub Issue 一键获取桌面工具

基于 GitHub 官方公开 REST API(无需登录 token),纯 Python 标准库打造的跨平台桌面程序。 API 请求层与 tkinter 界面层完全分离,已用真实仓库 psf/requests 完成端到端验证,附 PyInstaller 双平台打包方案。

23 条真实拉取 Issue(psf/requests)
17 / 17API 层自动化测试断言通过
0 个第三方依赖 · 纯标准库
2 平台Windows .exe / macOS .app 打包
01

程序界面 · 真实数据渲染

GitHub Issue 获取工具
仓库地址
状态
关键词筛选
#标题状态标签创建时间作者
#7634Non-string form field names raise AttributeError when files are attachedopen—2026-10-12jbrown9513
#7633merge_cookies raises "You can only merge into CookieJar" when http.cookiejar is loaded twiceclosed—2026-10-08Ur5u5
#7622Encoding of escaped values in parameter?closedQuestion/Not a bug2026-09-11abellgithub
#7621API-provided proxies are silently overridden by environment variablesclosedFeature Request2026-09-10getrun
#7632Lingering docstring references to python2.7 cookielibopen—2026-10-06hemberger
#7631TestTimeout abandons three delay/10 requests and later tests wait out the serveropen—2026-09-30quotentiroler
✓ 获取成功 —— 本页 23 条(open 10 / closed 13)
第 1 页
已加载 23 条 / 命中 23 条
▲ 上图为 tkinter 真实界面 1:1 复刻 · 数据来自 api.github.com 真实响应(非模拟数据)· 已自动过滤 Pull Request
02

功能矩阵

🔗

仓库地址容错解析

支持 owner/repo、https://github.com/owner/repo、.git 后缀、git@github.com:owner/repo 四种写法

🎯

状态筛选 open/closed

服务端筛选随请求下发(?state=),all / open / closed 三态任意切换

🔍

关键词实时过滤

对已加载结果按标题与标签即时过滤,输入即生效,无需重新请求

📄

分页浏览

上一页 / 下一页翻页,依返回条数智能判断是否还有下一页

📊

一键导出 CSV

utf-8-sig 编码,Excel / WPS 双击打开中文不乱码,只导出筛选命中的结果

🧵

后台线程请求

网络请求全部走 threading 后台线程,界面零卡死,请求期间按钮自动禁用防重复

03

代码架构 · 请求层与界面层分离

API Layer

github_api.py

  • parse_repo_url() 地址容错解析
  • fetch_issues() 拉取列表 → (issues, has_next)
  • _request() urllib 请求 + 异常翻译
  • RateLimitError / RepoNotFoundError
⇄ 后台线程调用
root.after() 回调
⇄
GUI Layer · main.py

IssueApp (tkinter)

  • 控制区 地址输入 / 状态选择 / 触发
  • 结果区 Treeview 表格 + 滚动条
  • 分页区 翻页 / 统计 / 导出 CSV
  • run() 程序运行入口
04

异常防御矩阵 · 每种失败都有人话提示

URLError

网络请求失败

「网络请求失败:xxx,请检查网络连接或代理设置」—— showerror 弹窗

403 / 429

接口限流

「匿名调用每小时最多 60 次,请稍后再试,或配置 token 提升额度」—— RateLimitError

404

仓库不存在

「仓库不存在,请检查仓库名称,或该仓库是否为私有仓库」—— RepoNotFoundError

格式错误

地址写错

「仓库地址格式不正确,支持 owner/repo 或 https://github.com/owner/repo」—— 输入校验前置拦截

05

真实测试报告 · 拒绝纸上谈兵

test_api.py · 真实调用 api.github.com 17 / 17 PASS
✓解析 'octocat/Hello-World'
✓解析 'https://github.com/psf/requests'
✓解析 '.git' 后缀 / git@ / 裸域名
✓异常地址(空 / 单段 / 裸域名)应报错
✓真实接口返回非空列表(23 条)
✓字段完整 number/title/state/labels/created_at
✓状态值合法 open/closed
✓state=closed 服务端筛选生效(16 条全 closed)
✓仓库不存在 → RepoNotFoundError
✓URL → owner/repo 规范化
GUI 自检 + 端到端 ALL PASS
test_gui.py — 窗口创建 / 默认仓库值 / 表格渲染 / 关键词过滤 / 按钮状态切换
端到端 — 启动真实 GUI → 输入 psf/requests → 后台线程真实请求 → 23 条数据渲染 → CSV 导出成功
CSV 抽检 — utf-8-sig 编码,8 列表头,23 行数据完整
修复记录 — 测试中发现裸域名解析边界 bug(https://github.com/ 误判为 owner/repo),已修复并回归通过
06

PyInstaller 双平台打包

windows — cmd
# 打包为单文件 exe(无控制台窗口)
C:\> pip install pyinstaller
C:\> pyinstaller --onefile --windowed --name "GitHubIssue工具" main.py
→ dist/GitHubIssue工具.exe
  双击即可运行,目标机器无需安装 Python
macos — zsh
# 打包为 .app 应用包
$ pip install pyinstaller
$ pyinstaller --windowed --name "GitHubIssue工具" main.py
→ dist/GitHubIssue工具.app
  可直接拖入「应用程序」文件夹