0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

だいたい非AI系のGitHubトレンドをnushellで収集および記録する

0
Posted at
  • GitHubには膨大なリポジトリが日々公開されていますが、現時点ではトレンド上位はAI関連が占めています。
  • GitHub Search APIを利用してトレンドを取得する際に、「AI + 非AI」としてAI以外の開発ツールやライブラリも把握したいです。
  • 今回は、データをそのまま構造体として扱いフィルタ・加工・整形が得意な nushell を使って、Githubの非AIトレンド情報をTSVファイルに保存する方法を紹介します。

環境

  • macOS 13.7.8 Ventura
  • nushell 0.110.0

アプローチ

  • 単純に以下のエンドポイント(約1ヶ月前の作成 + star数の多い)で上位10件を取得すると、現状ほぼAIで埋まってしまいます。
https://api.github.com/search/repositories?q=created:%3E2026-01-26+language:typescript&sort=stars&order=desc&per_page=10
  • そのため、以下の方式でフィルタリングします。
最大500件を取得
リポジトリ名・説明文・トピックにAIキーワードが含まれるものを除外
残った中からスター数上位10件を保存
  • ※READMEの内容まではチェックしていないため、完全にAIと無関係とは言い切れません。あくまで「表面上AIを前面に出していないリポジトリ」を拾うイメージです。

手順

ファイル作成

$ mkdir gh-trend
$ cd gh-trend
$ touch gh_noai.nu

コード記述

gh_noai.nu に以下のコードを記述します。

# 検索期間: 現在から4週間前の日付
let since = (date now) - 4wk | format date "%Y-%m-%d"

# 出力ファイル名: 実行日付_gh_trend_noai.tsv
let filename = (date now | format date "%Y%m%d") + "_gh_trend_noai.tsv"

# 対象言語
let language = "typescript"

# 除外するAI関連キーワード
let ai_keywords = ["llm", "gpt", "chatgpt", "openai", "gemini",
                   "claude", "copilot", "agent", "rag",
                   "neural", "diffusion", "transformer", "deepseek",
                   "mistral", "ollama", "mcp", "qwen", "glm", "sora", "asr", "openclaw", "anthropic"]

# 5ページ分(最大500件)取得してフラットに結合
let repos = 1..5 | each { |page|
    let url = $"https://api.github.com/search/repositories?q=created:%3E($since)+language:($language)&sort=stars&order=desc&per_page=100&page=($page)"
    http get $url | get items
} | flatten

# AIキーワードを含むリポジトリを除外
let filtered = $repos | where { |repo|
    # リポジトリ名と説明文を結合
    let text = ([$repo.name ($repo.description? | default "")] | str join " " | str downcase)
    # トピックを結合
    let topics = ($repo.topics | str join " " | str downcase)
    # キーワードリストにマッチするか
    let keyword_match = $ai_keywords | any { |kw| ($text | str contains $kw) or ($topics | str contains $kw) }
    # 単語境界で "ai" にマッチするか
    let ai_word_match = ($text =~ '\bai\b') or ($topics =~ '\bai\b')
    not ($keyword_match or $ai_word_match)
}

mkdir $"data/($language)"

# フィルタ後の上位10件をTSVに保存
$filtered | select name stargazers_count html_url | first 10 | to tsv | save -f $"data/($language)/($filename)"

実行

$ nu gh_noai.nu

フィルタ前後の比較

name              stargazers_count
nanoclaw          12398            ← AI (topics: ai-agents, claude-code)
moltworker         9078            ← AI (topics: ai-agents)
beautiful-mermaid  7271
react-doctor       4278            ← AI (description: "coding agents")
skills             3540            ← AI (topics: agent-skills)
ClawRouter         3317            ← AI (topics: ai, llm, anthropic, deepseek...)
excalidraw-mcp     2649            ← AI (mcp)
tinyclaw           2397            ← AI
CodePilot          2121            ← AI (topics: claude, anthropic)
portless           2115            ← AI (description: "For humans and agents")
  • 10件中9件がAI関連で、非AIは beautiful-mermaid のみです。
  • 次に、フィルタを適用した結果がこちらです。
$ cat data/typescript/20260223_gh_trend_noai.tsv

name              stargazers_count  html_url
beautiful-mermaid 7271              https://github.com/lukilabs/beautiful-mermaid
k-id-age-verifier 1676              https://github.com/xyzeva/k-id-age-verifier
neko-master       1277              https://github.com/foru17/neko-master
sileo             1179              https://github.com/hiaaryan/sileo
almostnode        874               https://github.com/macaly/almostnode
...
  • Mermaid図のビューア、年齢確認ツール、音楽プレーヤーなど、AI以外のプロジェクトが揃っています。

まとめ

  • READMEの内容を除外していないため完全なフィルターではないですが、「だいたい非AI」くらいの精度感で取得できます。
  • 「AI + 非AI」を並行してトレンド情報を記録することで、正確な現時点での流れを把握することができると感じました。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?