PkgStats
PkgStats is a native desktop app (Rust and egui) that shows developer and package stats from GitHub, npm, PyPI and crates.io. Look up a user on every registry at once, or a single package or repo, with charts, and follow the ones you care about day by day.
Install
- Windows: the installer from qlinter.org (
pkgstats-setup-0.1.6.exe), orpkgstats-windows-x64.exefrom the latest GitHub release. - macOS: the disk image from qlinter.org (
pkgstats-0.1.6.dmg), for Apple Silicon and Intel. It isn't signed with an Apple Developer ID, so open it once, then go to System Settings → Privacy & Security → Open Anyway. - With Rust:
cargo install pkgstats
pkgstats
Quick start
Pick User or Package, type a name in the search box and press Go. Try a username of yours in User mode, or react, requests, serde or owner/repo in Package mode.
Modes
User looks the name up on each selected registry at once.
| Source | What you get |
|---|---|
| GitHub | Followers, following, repo count, total stars and forks, a top repos chart, a repo table |
| npm | Package count, weekly and monthly downloads across all packages, top packages |
| PyPI | Owned and maintained packages with weekly and monthly downloads (first 40, via pypistats.org) |
| crates.io | Crate count, all-time and 90-day downloads, top crates |
Package / repo takes a package name, or owner/repo for GitHub.
| Source | What you get |
|---|---|
| GitHub | Stars, forks, watchers, issues, license, latest release, language breakdown |
| npm | Last day, week, month and year downloads, a daily chart for the last year, dependencies, license |
| PyPI | Last day, week and month downloads, a daily chart for about 180 days, releases, Python requirement |
| crates.io | All-time and 90-day downloads, a daily chart for 90 days, version count |
With no exact match, GitHub, npm and crates.io show search results instead; click one to open its stats. PyPI has no search API, so it needs the exact name.
In a user report, click a package or repo name to see its stats, or the arrow beside it to open its page in your browser. Open page in a report's header opens that user's or package's page, and the back arrow returns to the previous report.
Following (daily tracking)
- Click Follow (the star) on any report, or enter your username on the Following page and click Follow me on all sites. Sites where the name doesn't exist are skipped.
- PkgStats saves one snapshot per day of every count. The Following page shows the current value, the change over 1, 7 and 30 days, and a history chart. Report cards show "vs yesterday" for followed items, with a change badge and a small trend line.
- Snapshots are taken when the app opens and every 30 minutes while it runs. To keep recording while it's closed, use Settings → Enable background task. That adds an hourly Windows Task Scheduler job that runs
pkgstats --snapshot, which fetches at most once a day.
Window, menu and history
PkgStats draws its own title bar, holding the menu, back, Search and Following buttons, the User / Package toggle, the search box and settings. Drag the empty part of the bar to move the window, double-click it to maximize, and drag any edge to resize.
The menu opens a sidebar with Search, Following, History and Settings, plus your followed items and latest searches. History lists every search by day; click one to run it again, or remove entries.
Settings → App style sets the app colour: Claude (the default, matching Claude Desktop's dark theme), Blue, Soft yellow, Peach, Rose, Lavender, Sky, Mint, Silver, or a custom colour that tints the whole app.
How it works
PkgStats is one Rust program drawn with egui (eframe), with charts from egui_plot. It calls each registry's public API over HTTPS with ureq:
- GitHub's REST API, for users, repos and search.
- npm's registry search, plus its official downloads API at api.npmjs.org.
- PyPI's JSON API and pypistats.org. User lookups use PyPI's XML-RPC
user_packagescall, because PyPI's user pages sit behind a bot check. - The crates.io API.
Responses are cached in memory for 10 minutes. npm's downloads API throttles bursts, so PkgStats backs off and retries; if it's still blocked, it shows search's cached counts and says so.
Files and settings
| Item | Where |
|---|---|
| History (last 200 searches) | %APPDATA%\PkgStats\history.json |
| Followed items and daily snapshots | %APPDATA%\PkgStats\following.json |
| App style | %APPDATA%\PkgStats\settings.json |
| GitHub token | Windows Credential Manager (menu → Add token) |
GITHUB_TOKEN |
Used when no token was added in the app. |
Without a token, GitHub allows 60 requests an hour and 10 searches a minute. A token raises that to 5,000 an hour and 30 searches a minute. It needs no scopes. npm, PyPI and crates.io need no token.
Limits and troubleshooting
- PyPI usernames are case-sensitive, and PyPI needs exact package names.
- npm's search returns at most 1,000 packages per maintainer.
- The background task uses Windows Task Scheduler, so it's Windows only.
- Hitting GitHub's limit: add a token.
- Tests:
cargo testruns offline;cargo test -- --ignored --nocapturehits the live APIs.
Worked examples
See everything one person has published. Choose User, type the username and press Go. Each selected registry is searched at once: GitHub followers and stars, npm and crates.io package counts and downloads, and PyPI packages with their downloads.
Check one package. Choose Package, type serde and press Go. You get crates.io's all-time and 90-day downloads with a daily chart. Type facebook/react for the GitHub repo instead.
Recover from a typo. Type reqests in Package mode. With no exact match, npm and crates.io show search results; click the one you meant. PyPI needs the exact name.
Track your own numbers every day. Open Following, enter your username and click Follow me on all sites. Then Settings → Enable background task, so a snapshot is taken daily even when the app is closed. The Following page shows the change over 1, 7 and 30 days.
Avoid GitHub's rate limit. Open menu → Add token, follow the link to GitHub's token form, create a token with no scopes and paste it in.
Edge cases
- GitHub limit reached: without a token you get 60 requests an hour and 10 searches a minute. Add a token, or wait.
- npm downloads blocked: npm's downloads API throttles bursts. PkgStats backs off and retries; if it's still blocked, it shows search's cached counts and says so.
- More than 1,000 npm packages: npm's search returns at most 1,000 per maintainer.
- PyPI user lookups: usernames are case-sensitive, and only the first 40 packages get download numbers.
- A user missing on some sites: Follow me on all sites skips the sites where the name doesn't exist.
- Stale numbers: responses are cached for 10 minutes. Restart the app to fetch fresh ones sooner.
- Background task on a Mac: it uses Windows Task Scheduler, so it's Windows only; on a Mac, snapshots are taken while the app is open.
FAQ
Does it need an account? No. A GitHub token is optional and only raises the rate limit.
Where is my token stored? In Windows Credential Manager. If none is added, GITHUB_TOKEN is used.
What does the token need? No scopes at all.
How far back do the charts go? About a year for npm, about 180 days for PyPI and 90 days for crates.io.
Can I clear my history? Yes, in History: remove single entries or clear them all.
Can I change the colours? Settings → App style has nine presets and a custom colour.
Does it send data anywhere? Only requests to GitHub, npm, PyPI, pypistats.org and crates.io for the stats you ask for.
Version and source
This page describes PkgStats 0.1.6. Version 0.1.7 only changed the README screenshot.
- Source: https://github.com/acus9345/pkgstats
- crates.io: https://crates.io/crates/pkgstats
- License: MIT
PkgStats 是一個原生桌面 App(Rust 與 egui),顯示來自 GitHub、npm、PyPI 和 crates.io 的開發者與套件統計。一次在所有套件庫查詢某位使用者,或查詢單一套件或 repo,附圖表,並逐日追蹤你關心的項目。
安裝
- Windows: qlinter.org 的安裝程式(
pkgstats-setup-0.1.6.exe),或 GitHub 最新版本 的pkgstats-windows-x64.exe。 - macOS: qlinter.org 的磁碟映像檔(
pkgstats-0.1.6.dmg),適用 Apple Silicon 和 Intel。它沒有用 Apple Developer ID 簽署,所以請先打開一次,再到 系統設定 → 隱私權與安全性 → 強制打開。 - 使用 Rust:
cargo install pkgstats
pkgstats
快速開始
選 User 或 Package,在搜尋框輸入名稱,按 Go。在 User 模式試試你自己的使用者名稱,或在 Package 模式試試 react、requests、serde 或 owner/repo。
模式
User 會在每個選取的套件庫同時查詢這個名稱。
| 來源 | 你會看到 |
|---|---|
| GitHub | 追蹤者、追蹤中、repo 數量、星星與 fork 總數、熱門 repo 圖表、repo 表格 |
| npm | 套件數量、所有套件的每週與每月下載量、熱門套件 |
| PyPI | 擁有及維護的套件與其每週、每月下載量(前 40 個,透過 pypistats.org) |
| crates.io | crate 數量、總下載量與 90 天下載量、熱門 crate |
Package / repo 接受套件名稱,GitHub 則用 owner/repo。
| 來源 | 你會看到 |
|---|---|
| GitHub | 星星、fork、watcher、issue、授權、最新版本、語言分布 |
| npm | 最近一天、一週、一個月和一年的下載量、過去一年的每日圖表、相依套件、授權 |
| PyPI | 最近一天、一週和一個月的下載量、約 180 天的每日圖表、版本、Python 需求 |
| crates.io | 總下載量與 90 天下載量、90 天的每日圖表、版本數 |
沒有完全相符時,GitHub、npm 和 crates.io 會改顯示搜尋結果;點一個即可開啟它的統計。PyPI 沒有搜尋 API,所以需要完整正確的名稱。
在使用者報告中,點套件或 repo 名稱可看它的統計,點旁邊的箭頭則在瀏覽器打開它的頁面。報告標題列的 Open page 會打開該使用者或套件的頁面,返回箭頭會回到上一份報告。
追蹤(每日記錄)
- 在任何報告上點 Follow(星星),或在 Following 頁面輸入你的使用者名稱並點 Follow me on all sites。名稱不存在的網站會被略過。
- PkgStats 每天為每個數字存一份快照。Following 頁面顯示目前數值、1、7、30 天的變化,以及歷史圖表。對已追蹤的項目,報告卡片會顯示「vs yesterday」,附變化標記和小趨勢線。
- 快照在 App 開啟時、以及執行期間每 30 分鐘拍一次。要在關閉時繼續記錄,請用 Settings → Enable background task。這會新增一個每小時執行
pkgstats --snapshot的 Windows 工作排程器工作,每天最多抓取一次。
視窗、選單與歷史
PkgStats 自己畫標題列,裡面有選單、返回、Search 和 Following 按鈕、User / Package 切換、搜尋框和設定。拖曳標題列的空白處可移動視窗,雙擊可最大化,拖曳任何邊緣可調整大小。
選單會打開側邊欄,有 Search、Following、History 和 Settings,以及你追蹤的項目和最近的搜尋。History 依日期列出每次搜尋;點一個可重新執行,也可以移除項目。
Settings → App style 設定 App 顏色:Claude(預設,與 Claude Desktop 的深色主題一致)、Blue、Soft yellow、Peach、Rose、Lavender、Sky、Mint、Silver,或為整個 App 上色的自訂顏色。
運作原理
PkgStats 是一個用 egui(eframe)繪製的 Rust 程式,圖表來自 egui_plot。它用 ureq 透過 HTTPS 呼叫各套件庫的公開 API:
- GitHub 的 REST API,用於使用者、repo 和搜尋。
- npm 的套件庫搜尋,加上 api.npmjs.org 的官方下載量 API。
- PyPI 的 JSON API 和 pypistats.org。使用者查詢使用 PyPI 的 XML-RPC
user_packages呼叫,因為 PyPI 的使用者頁面有機器人檢查。 - crates.io API。
回應會在記憶體中快取 10 分鐘。npm 的下載量 API 會限制突發請求,所以 PkgStats 會退避並重試;如果仍然被擋,就顯示搜尋的快取數字並加以說明。
檔案與設定
| 項目 | 位置 |
|---|---|
| 歷史(最近 200 次搜尋) | %APPDATA%\PkgStats\history.json |
| 追蹤項目與每日快照 | %APPDATA%\PkgStats\following.json |
| App 樣式 | %APPDATA%\PkgStats\settings.json |
| GitHub 權杖 | Windows 認證管理員(menu → Add token) |
GITHUB_TOKEN |
沒在 App 中加入權杖時使用。 |
沒有權杖時,GitHub 每小時允許 60 次請求、每分鐘 10 次搜尋。權杖會提高到每小時 5,000 次、每分鐘 30 次搜尋,而且不需要任何 scope。npm、PyPI 和 crates.io 不需要權杖。
限制與疑難排解
- PyPI 使用者名稱區分大小寫,PyPI 也需要完整正確的套件名稱。
- npm 的搜尋每位維護者最多回傳 1,000 個套件。
- 背景工作使用 Windows 工作排程器,所以僅限 Windows。
- 碰到 GitHub 的限制:加入權杖。
- 測試:
cargo test離線執行;cargo test -- --ignored --nocapture會呼叫真實 API。
實例
看某人發布過的所有東西。 選 User,輸入使用者名稱,按 Go。每個選取的套件庫會同時查詢:GitHub 的追蹤者和星星、npm 和 crates.io 的套件數與下載量,以及 PyPI 的套件和下載量。
查一個套件。 選 Package,輸入 serde,按 Go。你會看到 crates.io 的總下載量與 90 天下載量,附每日圖表。輸入 facebook/react 則查 GitHub repo。
從打錯字中救回來。 在 Package 模式輸入 reqests。沒有完全相符時,npm 和 crates.io 會顯示搜尋結果;點你要的那個。PyPI 需要完整正確的名稱。
每天追蹤你自己的數字。 打開 Following,輸入你的使用者名稱,點 Follow me on all sites。再到 Settings → Enable background task,這樣即使 App 關閉也會每天拍快照。Following 頁面會顯示 1、7、30 天的變化。
避開 GitHub 的速率限制。 打開 menu → Add token,依連結到 GitHub 的權杖表單,建立一個不帶 scope 的權杖並貼上。
特殊情況
- 達到 GitHub 限制: 沒有權杖時每小時 60 次請求、每分鐘 10 次搜尋。加入權杖,或等一下。
- npm 下載量被擋: npm 的下載量 API 會限制突發請求。PkgStats 會退避並重試;仍被擋時,就顯示搜尋的快取數字並加以說明。
- 超過 1,000 個 npm 套件: npm 的搜尋每位維護者最多回傳 1,000 個。
- PyPI 使用者查詢: 使用者名稱區分大小寫,而且只有前 40 個套件有下載數字。
- 某些網站沒有這個使用者: Follow me on all sites 會略過名稱不存在的網站。
- 數字過舊: 回應快取 10 分鐘。想更快拿到新數字,重新啟動 App。
- Mac 上的背景工作: 它使用 Windows 工作排程器,所以僅限 Windows;在 Mac 上,只有 App 開著時才會拍快照。
常見問題
需要帳號嗎? 不需要。GitHub 權杖是選用的,只是用來提高速率限制。
我的權杖存在哪裡? 在 Windows 認證管理員。沒加入時會使用 GITHUB_TOKEN。
權杖需要什麼權限? 完全不需要 scope。
圖表能看多久以前? npm 約一年,PyPI 約 180 天,crates.io 90 天。
能清除歷史嗎? 可以,在 History 中可以移除單筆或全部清除。
能換顏色嗎? Settings → App style 有九種預設和一個自訂顏色。
它會把資料送到別處嗎? 只會為你查詢的統計向 GitHub、npm、PyPI、pypistats.org 和 crates.io 發出請求。
版本與原始碼
本頁說明 PkgStats 0.1.6。0.1.7 版只更換了 README 的截圖。
- 原始碼:https://github.com/acus9345/pkgstats
- crates.io:https://crates.io/crates/pkgstats
- 授權:MIT