

GitHubデータ分析のためのターミナルベースのツールキット。
$ octosuite user torvalds
from pprint import pprint
import octosuite
user = octosuite.User(name="torvalds")
exists, profile = user.exists()
if exists:
pprint(profile)
pip install octosuite
対話型ターミナルインターフェースを起動:
octosuite -t/--tui
矢印キーとEnterキーでオプションを選択します。
コマンドラインから直接GitHubデータを照会:
# ユーザーデータ
octosuite user torvalds
octosuite user torvalds --repos --page 1 --per-page 50
octosuite user torvalds --followers --json
# リポジトリデータ
octosuite repo torvalds/linux
octosuite repo torvalds/linux --commits
octosuite repo torvalds/linux --stargazers --export ./data
# 組織データ
octosuite org github
octosuite org github --members --json
# 検索
octosuite search "machine learning" --repos
octosuite search "python cli" --users --json
共通オプション:
--page - ページ番号(デフォルト: 1)--per-page - 1ページあたりの結果数、最大100(デフォルト: 100)--json - JSONとして出力--export DIR - ディレクトリにエクスポート利用可能なデータ型フラグについては octosuite <command> --help を実行してください。
Pythonプロジェクトでoctosuiteを使用:
from octosuite import User, Repo, Org, Search
# ユーザーデータを取得
user = User("torvalds")
exists, profile = user.exists()
if exists:
repos = user.repos(page=1, per_page=100)
followers = user.followers(page=1, per_page=50)
# リポジトリデータを取得
repo = Repo(name="linux", owner="torvalds")
exists, profile = repo.exists()
if exists:
commits = repo.commits(page=1, per_page=100)
languages = repo.languages()
# 組織データを取得
org = Org("github")
exists, profile = org.exists()
if exists:
members = org.members(page=1, per_page=100)
# GitHubを検索
search = Search(query="machine learning", page=1, per_page=50)
results = search.repos()
ユーザー: profile, repos, subscriptions, starred, followers, following, orgs, gists, events, received_events
リポジトリ: profile, forks, issue_events, events, assignees, branches, tags, languages, stargazers, subscribers, commits, comments, issues, releases, deployments, labels
組織: profile, repos, events, hooks, issues, members
検索: repos, users, commits, issues, topics
MIT ライセンス。詳細については LICENCE ファイルを参照してください。