Python 命令行工具 · 开箱即用 · 单文件实现Python CLI tool · out of the box · single-file core

每天 20:00,一份 GitHub 热门早报自动到手 A fresh GitHub trending report in your hands, every day at 20:00

按 topics 检索 GitHub 最近 N 天新建的仓库,硬性质量过滤与热度评分精选 Top N,并发拉取 README 自动生成中文摘要,输出暗黑卡片风 HTML 与 Markdown 双格式报告,可选推送飞书 / 钉钉群。 It searches GitHub for repos created within the last N days by topics, applies hard quality filters and a weighted trending score to pick the Top N, fetches READMEs concurrently to build automatic Chinese summaries, and outputs a dark-themed HTML + Markdown report — with optional Feishu / DingTalk group push.

GitHub 热门项目早报GitHub Trending Report 2026-10-24 20:01
1 MemTensor/MemT-1.0 ★ 382+16 145.9
2 h9-tec/ai-roadmap-2026 ★ 148+18 101.9
3 liyupi/dafeiyu-cleaner ★ 55+26 83.5
4 AnythingLLM-Desktop🆕 ★ 37 76.1
扫描 200 → 去重 192 → 过滤后 51 → Top 12Scanned 200 → deduped 192 → filtered to 51 → Top 12

摘自 2026-10-24 由计划任务自动生成的真实早报,数据未做修改 From the real report auto-generated by the scheduled task on 2026-10-24 — unedited

16 份reports
累计自动生成的日报归档(reports/ 目录,10 月 2 日起)daily reports auto-generated so far (in reports/, since Oct 2)
200 → 12
单轮扫描、合并去重、硬性过滤后的精选数量repos scanned, deduped and hard-filtered per run
20:00
每天由 Windows 计划任务自动运行,睡眠中可唤醒daily auto-run via Windows scheduled task, wake-from-sleep enabled
5 / 3.9+
第三方依赖数量 / 最低 Python 版本(建议 3.10+)third-party dependencies / minimum Python (3.10+ recommended)
功能特性Features

从检索到推送,一条命令全搞定From search to push, one command does it all

九个环节全部内置在一个 main.py 里(Config / GitHubClient / RepoFilter / Scorer / ReadmeSummarizer / Translator / ReportRenderer / Notifier / Pipeline),装好依赖即可运行。 All nine stages live inside a single main.py (Config / GitHubClient / RepoFilter / Scorer / ReadmeSummarizer / Translator / ReportRenderer / Notifier / Pipeline) — install the dependencies and you are ready to go.

多维度检索Multi-dimensional search

调用 GitHub Search API,topic:{t} + created:>{N天前} + language:{lang} 多组合逐个查询、合并去重,只盯最近 N 天新冒出来的仓库。Queries the GitHub Search API with topic:{t} + created:>{N-days-ago} + language:{lang} combinations, merged and deduplicated — only repos created within the last N days.

Token 池与限流容错Token pool & rate-limit resilience

多 PAT 自动轮换,实时监控 x-ratelimit-remaining;全部耗尽按 x-ratelimit-reset 等待(封顶 120 秒);网络异常 / 5xx 指数退避重试,超时 connect 10s / read 30s。Rotates multiple PATs automatically while watching x-ratelimit-remaining; when exhausted it waits per x-ratelimit-reset (capped at 120 s). Network errors and 5xx get exponential-backoff retries; timeouts are 10 s connect / 30 s read.

硬性质量过滤Hard quality filters

剔除 fork 仓库、Star 低于 min_stars、无描述、README 拉取失败或为空的条目,全程打印各阶段过滤统计。Drops forks, repos below min_stars, entries without a description, and repos whose README fetch failed or came back empty — with per-stage filter stats printed along the way.

可配权重热度评分Weighted trending score

日均增星 + 对数压缩的 Star / Fork 体量三项加权求和,权重 w1/w2/w3 全部可在配置里调整,按分数排序取 Top N。Combines stars-per-day with log-scaled star and fork volume; the three weights w1/w2/w3 are fully configurable, and the list is ranked by score to keep the Top N.

LLM 摘要 + 规则兜底LLM summaries with rule fallback

线程池并发拉取 README(raw 优先、Base64 回退,截前 2000 字符),LLM 提炼【核心功能】【技术栈】【适用场景】与一句话亮点;未配置 LLM 时本地规则生成同等结构,任何字段不会留空。Fetches READMEs concurrently (raw first, Base64 fallback, first 2,000 chars) and distills core features, tech stack, use cases and a one-line highlight via any OpenAI-compatible LLM. Without an LLM key, local rules produce the same structure — no field is ever left empty.

免费中文翻译Free Chinese translation

MyMemory 免费引擎(无需 API Key,匿名额度约 5000 字符/天),翻译结果缓存到本地,重复内容零消耗;超额度内容次日自动补翻,失败只跳过该条,绝不中断报告。The MyMemory engine works without an API key (roughly 5,000 chars/day anonymously). Results are cached locally so repeated content costs nothing; anything over the daily budget is translated the next day, and a failed item is simply skipped — report generation never breaks.

双格式报告Dual-format reports

Jinja2 内嵌模板渲染暗黑扁平风、响应式卡片 HTML(作者头像 / Star·Fork / 语言徽章 / 热度分 / 三个摘要小节 / 直达链接),同步生成 Markdown 报告。A built-in Jinja2 template renders a dark, flat, responsive card-style HTML report (author avatar, stars & forks, language badge, trending score, three summary sections, direct links), with a matching Markdown report generated side by side.

飞书 / 钉钉推送Feishu / DingTalk push

飞书 interactive 卡片与钉钉 markdown 消息两种格式独立开关;推送失败只打印告警,不影响本地 HTML / Markdown 输出;未配置 Webhook 时保存后自动用浏览器打开。Feishu interactive cards and DingTalk markdown messages, each with an independent switch. A failed push only prints a warning and never affects local output; with no webhook configured, the HTML opens in your browser right after saving.

抗改名计划任务Rename-proof scheduled task

双击 install_task.bat 注册每天 20:00 的计划任务;启动器部署在 %LOCALAPPDATA%,凭标记文件定位工具目录——本文件夹改名、移动都不会让任务失效。Double-click install_task.bat to register the daily 20:00 task. The launcher lives under %LOCALAPPDATA% and locates the tool by a marker file — renaming or moving the tool folder never breaks the task.

快速开始Quick Start

三步跑起来,一键常驻后台Three steps to run, one click to keep it running

需要 Python 3.9+(建议 3.10+)。全部实现集中在 main.py 一个文件,没有 Web 服务、没有数据库,clone 下来就能用。 Requires Python 3.9+ (3.10+ recommended). Everything lives in the single main.py — no web server, no database. Clone it and go.

1

安装依赖Install the dependencies

只有 5 个第三方依赖,一条命令装完:Just five third-party dependencies, installed in one command:

pip
$ pip install -r requirements.txt
requestsrichPyYAMLJinja2APScheduler
2

立即运行一次Run it right now

run 是默认子命令,可省略;schedule 启动后立即跑第一轮,Ctrl+C 退出:run is the default sub-command and can be omitted; schedule runs the first round immediately and stops with Ctrl+C:

github-trending
$ python main.py run # 立即执行一次(默认子命令,可省略)run once immediately (default sub-command)
$ python main.py schedule --every-hours 24 # 每 24 小时定时执行一轮loop every 24 hours (Ctrl+C to stop)
$ python main.py --config D:/my.yaml run # 使用自定义配置文件use a custom config file

运行时终端输出扫描进度条、过滤统计表与 Top N 摘要表格;结束后报告落盘,未配置 Webhook 且 auto_open: true 时自动在浏览器打开 HTML。 The terminal shows a scan progress bar, filter statistics and a Top N summary table; reports are written on finish, and with no webhook plus auto_open: true the HTML opens in your browser automatically.

3

一键安装每日计划任务(Windows)One-click daily scheduled task (Windows)

双击 install_task.bat,注册名为 GitHubTrendingDaily 的计划任务,安装一次长期无人值守:Double-click install_task.bat to register a scheduled task named GitHubTrendingDaily — install once and forget about it:

  • 每天 20:00 自动运行;睡眠中可唤醒执行;错过时间(如关机)下次开机自动补跑;失败每 15 分钟重试一次,共 3 次。Runs automatically at 20:00 every day; it can wake the machine from sleep, catches up on missed runs (e.g. after a shutdown) at next boot, and retries every 15 minutes up to 3 times on failure.
  • 任务不直接指向本文件夹,而是指向 %LOCALAPPDATA%\GitHubTrending\run_task.ps1 稳定启动器;启动器凭 trending-tool.marker 标记文件在桌面 / 文档 / 下载等位置自动定位工具目录,因此本文件夹改名、移动都不会让任务失效。The task does not point at the tool folder. It points to a stable launcher at %LOCALAPPDATA%\GitHubTrending\run_task.ps1, which finds the tool through the trending-tool.marker file by searching Desktop / Documents / Downloads — so renaming or moving the tool folder never breaks it.
  • 运行日志写入 logs\daily.log,超过约 2 MB 自动轮转;计划任务环境已强制 UTF-8,emoji 描述不会导致崩溃。Run logs go to logs\daily.log with automatic rotation past ~2 MB; UTF-8 is forced in the scheduled environment so emoji in repo descriptions never crash it.
  • 生成失败时弹 Windows 系统通知,并写入 logs\LAST_RUN_FAILED.txt;成功运行会自动清除该文件。On failure it raises a Windows toast notification and writes logs\LAST_RUN_FAILED.txt; a successful run clears that file automatically.
  • 想改运行时间:修改 install_task.ps1 里的 "20:00" 后重新双击 install_task.bat 即可;卸载双击 uninstall_task.bat。To change the run time, edit "20:00" in install_task.ps1 and double-click install_task.bat again; uninstall via uninstall_task.bat.

每次运行会生成什么(reports/ 目录)What every run produces (the reports/ directory)

报告按时间戳归档,同时维护固定文件名的「最新报告」与可翻阅的历史索引: Each report is archived by timestamp, alongside a fixed-name "latest" copy and a browsable history index:

github_trending_时间戳.html / .mdgithub_trending_<timestamp>.html / .md
每次运行的历史报告归档,一份不落。Archived copy of every run, nothing is lost.
最新报告.html / .md
固定文件名,始终指向最近一次报告——记不住路径就双击这里。Fixed file name that always holds the latest report — double-click this one if you can't remember paths.
index.html
历史报告索引页,可点击翻阅全部往期报告。A history index page listing every past report, one click away.
history.json
跨天累积的历史数据,支撑报告中的 🆕 新上榜与 Star 增量(+N)标注。Cross-day history that powers the 🆕 new-entry and star-delta (+N) markers in the reports.
配置说明Configuration

一个 config.yaml,所有选项都有注释One config.yaml, every option commented

所有字段均可省略,省略时使用内置默认值;工具附带完整注释版配置文件,改哪一行都有说明。 Every field is optional — omit it and the built-in default applies. A fully commented config file ships with the tool.

配置项Option 默认值Default 说明Description
topics unity · game-development · llm · agent 要监控的 GitHub topics,逐个参与组合查询。GitHub topics to watch; each is queried in combination.
languages [](不限语言)[] (any language) 只关注这些编程语言,与 topics 组合查询;留空表示不限。Restrict searches to these languages; empty means any language.
days 7 只检索最近 N 天内创建的仓库。Only repos created within the last N days.
top_n 12 最终榜单数量(建议 10~15)。Final list size (10–15 recommended).
min_stars 20 硬性过滤:低于该 Star 数的仓库直接剔除。Hard filter: repos below this star count are dropped.
per_page 50 单次搜索请求返回的仓库数上限(1~100)。Max results per search request (1–100).
weights w1 2.0 / w2 1.0 / w3 0.5 热度评分公式三项权重,见下方公式。The three weights of the trending formula, see below.
tokens [](匿名访问)[] (anonymous access) GitHub PAT 列表,多 Token 自动轮换;留空为匿名限流 60 次/小时。GitHub PAT pool, rotated automatically; empty means anonymous access at 60 requests/hour.
max_workers 6 拉取 README / 调用 LLM 的并发线程数。Worker threads for README fetching and LLM calls.
llm.enabled false 启用后由任意 OpenAI 兼容接口提炼中文摘要;关闭时走本地规则。When on, any OpenAI-compatible API writes the Chinese summaries; when off, local rules apply.
webhooks.feishu / dingtalk false / "" 飞书、钉钉群机器人的独立开关与 Webhook 地址。Independent Feishu / DingTalk bot toggles and webhook URLs.
translate.enabled true 免费中文翻译(MyMemory 引擎,结果缓存,超额度次日补翻)。Free Chinese translation (MyMemory engine, cached; over-budget content is caught up the next day).
output_dir reports 报告输出目录(相对路径基于脚本所在目录)。Report output directory (relative paths resolve against the script).
auto_open true 未配置任何 Webhook 时,保存报告后自动用浏览器打开 HTML。With no webhook configured, auto-open the HTML report in your browser after saving.

热度评分公式The trending score

更看重「刚创建就快速涨星」,同时保留体量参考: It favors repos that gain stars fast right after creation, while keeping volume in play:

score
score = w1 × (stars / days_since_created) # 日均增星,衡量「近期增速」
      + w2 × log10(1 + stars) # 绝对热度(对数压缩,避免头部碾压)
      + w3 × log10(1 + forks) # 社区参与度
score = w1 × (stars / days_since_created) # stars per day since creation (growth speed)
      + w2 × log10(1 + stars) # absolute popularity, log-scaled
      + w3 × log10(1 + forks) # community engagement

仓库年龄下限 1.0 天,避免除零与超新仓库失真;想更偏体量就调大 w2 / w3,更偏增速就调大 w1。 Repo age is clamped to a 1.0-day minimum to avoid division blow-ups; raise w2 / w3 to favor volume, raise w1 to favor growth speed.

接入 LLM(可选,任意 OpenAI 兼容服务)Plug in an LLM (optional, any OpenAI-compatible service)

直接用 HTTP 调用 {base_url}/chat/completions,不依赖 openai SDK;LLM 调用失败自动回退本地规则摘要: Calls {base_url}/chat/completions over plain HTTP with no openai SDK; a failed LLM call falls back to the local rule-based summarizer:

config.yaml
llm:
  enabled: true
  api_key: "sk-xxxx" # 任意 OpenAI 兼容服务的密钥
  base_url: "https://api.deepseek.com/v1" # 如 DeepSeek / 通义 / OpenAI
  model: "deepseek-chat"
llm:
  enabled: true
  api_key: "sk-xxxx" # key of any OpenAI-compatible service
  base_url: "https://api.deepseek.com/v1" # e.g. DeepSeek / OpenAI / your relay
  model: "deepseek-chat"

模型按 JSON 返回 core_features / tech_stack / use_cases / highlight 四个字段;终端会统计「LLM 提炼 N 个,规则兜底 M 个」。 The model returns four JSON fields — core_features / tech_stack / use_cases / highlight — and the terminal reports how many summaries came from the LLM versus the fallback rules.

真实样例A Real Sample

一份没修过的日报长这样What an unedited daily report looks like

以下内容摘自 reports/github_trending_20261024_2001.md——2026-10-24 20:01 由计划任务自动生成,数据未做任何修改。工具默认输出中文报告(免费翻译已开启)。 Excerpted from reports/github_trending_20261024_2001.md — generated automatically by the scheduled task at 20:01 on 2026-10-24, completely unedited. The tool produces reports in Chinese by default (free translation enabled).

GitHub 热门项目早报 · 2026-10-24
生成时间: 2026-10-24 20:01:52 | 检索窗口: 近 7 天 | 扫描 200 个仓库(去重 192, 硬性过滤后 51) | 精选 Top 12
# 项目 Star Fork 语言 热度分 一句话亮点
1 MemTensor/MemT-1.0 382+16 17 Python 145.9 MemT-1.0:扩展和应用。研究记忆……
2 h9-tec/ai-roadmap-2026 148+18 14 未知 101.9 ai-roadmap-2026:逐层。选择一个图层,……
3 liyupi/dafeiyu-cleaner 55+26 1 JavaScript 83.5 dafeiyu-cleaner: 一眼认出大肥鱼:评论一加载就鉴定…
4 QuickButlerPace65/AnythingLLM-Desktop🆕 新上榜 37 12 未知 76.1 AnythingLLM-Desktop:🧳真正的便携性:无插件……
5 C4rohan/Lampline 171+7 30 Python 68.5 Lampline:让您的代理商从Dialogflo过来……
6 Umair/stalemap 100+1 41 TypeScript 45.4 stalemap:编码代理从tr学习库……

MemTensor/MemT-1.0

创建时间: 2026-10-19 | 语言: Python | Star: 382 | Fork: 17 | 热度分: 145.9

描述: MemT-1.0 的官方存储库

一句话亮点:MemT-1.0:扩展和应用。研究记忆……

【核心功能】

  • 扩展和应用。研究记忆扩展并演示……

【技术栈】

PythonRAGLLM

【适用场景】

  • 内存架构。引入 MemT-1.0,改进内存存储和……
  • 扩展和应用。研究内存扩展并演示原生…
🆕 表示与往期报告对比后新上榜的项目;+N 为自上一份报告以来的 Star 增量,两者都由跨天累积的 reports/history.json 提供数据。表格列依次为:名次 · 项目 · Star(增量)· Fork · 语言 · 热度分 · 一句话亮点;报告内每个项目都附有一张如上方的详情卡。 🆕 marks a repo that is new to the list compared with previous reports; +N is the star gain since the last report — both are powered by the cross-day reports/history.json. Table columns: rank · repo · stars (delta) · forks · language · trending score · one-line highlight. Every repo in the report gets a detail card like the one above.

样例仅节选榜单前 6 名与 1 张详情卡;完整报告含 Top 12 全部条目,HTML 版为暗黑卡片风单文件。 This excerpt shows only the top 6 rows and one detail card; the full report covers all Top 12 entries as a dark-themed single-file HTML.

常见问题FAQ

你可能想问You might be wondering

报「GitHub API 限流警告」或搜索结果为空?Seeing rate-limit warnings or empty results?
匿名访问配额为 60 次/小时(Search 接口 10 次/分钟)。在 tokens 里填 1~2 个无权限要求的 classic PAT(github.com/settings/tokens),配额提升至 5000 次/小时;工具会自动轮换,全部耗尽时按 x-ratelimit-reset 等待(封顶 120 秒)。 The anonymous quota is 60 requests/hour (10/minute for the Search API). Add one or two classic PATs — no scopes needed — to tokens to raise it to 5,000/hour. The tool rotates tokens automatically and, when all are exhausted, waits per x-ratelimit-reset (capped at 120 seconds).
代理环境如何配置?Behind a proxy?
无需配置——工具默认自动使用系统代理(环境变量或 Windows Internet 选项);代理软件没运行 / 端口失效时,会自动切换为直连模式继续运行。特殊场景可显式设置 HTTP_PROXY / HTTPS_PROXY 环境变量。 Nothing to configure — the system proxy (environment variables or Windows Internet options) is picked up automatically, and if the proxy is down or its port is stale the tool falls back to a direct connection and keeps going. For special cases you can set HTTP_PROXY / HTTPS_PROXY explicitly.
Windows 控制台中文乱码?Garbled Chinese in the Windows console?
本工具所有文件均为 UTF-8,在 Windows Terminal / Git Bash 下正常显示。若在旧版 cmd 中乱码,先执行 chcp 65001;由计划任务运行的 run_daily.bat 已强制 UTF-8,不受此影响。 Everything is UTF-8 and renders fine in Windows Terminal / Git Bash. In a legacy cmd console, run chcp 65001 first; the scheduled run_daily.bat already forces UTF-8, so it is unaffected.
为什么有些仓库被过滤掉了?Why are some repos filtered out?
命中任一硬性条件即剔除:fork 仓库、Star 低于 min_stars、无描述、README 拉取失败或为空。运行结束的过滤统计表会展示各阶段剔除数量。 A repo is dropped if it hits any hard rule: it is a fork, its stars are below min_stars, it has no description, or its README fetch failed or came back empty. The filter-statistics table shows the count removed at every stage.

把 GitHub 趋势装进每天 20:00 的日程Put GitHub trending on your 20:00 schedule

clone、装依赖、双击 install_task.bat——之后每天的早报都会安静地出现在 reports/ 目录里。 Clone it, install the dependencies, double-click install_task.bat — from then on, every day's report quietly lands in the reports/ directory.

回到安装步骤Back to the install steps
反馈Feedback