Terminal-based toolkit for GitHub data analysis.
$ octosuite user torvaldsfrom pprint import pprint
import octosuite
user = octosuite.User(name="torvalds")
exists, profile = user.exists()
if exists:
pprint(profile)pip install octosuiteLaunch the interactive terminal interface:
octosuite -t/--tuiNavigate using arrow keys and Enter to select options.
Query GitHub data directly from the command line:
# User data
octosuite user torvalds
octosuite user torvalds --repos --page 1 --per-page 50
octosuite user torvalds --followers --json
# Repository data
octosuite repo torvalds/linux
octosuite repo torvalds/linux --commits
octosuite repo torvalds/linux --stargazers --export ./data
# Organisation data
octosuite org github
octosuite org github --members --json
# Search
octosuite search "machine learning" --repos
octosuite search "python cli" --users --jsonCommon options:
--page- Page number (default: 1)--per-page- Results per page, max 100 (default: 100)--json- Output as JSON--export DIR- Export to directory
Run octosuite <command> --help for available data type flags.
Use octosuite in your Python projects:
from octosuite import User, Repo, Org, Search
# Get user data
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)
# Get repository data
repo = Repo(name="linux", owner="torvalds")
exists, profile = repo.exists()
if exists:
commits = repo.commits(page=1, per_page=100)
languages = repo.languages()
# Get organisation data
org = Org("github")
exists, profile = org.exists()
if exists:
members = org.members(page=1, per_page=100)
# Search GitHub
search = Search(query="machine learning", page=1, per_page=50)
results = search.repos()Data Types
User: profile, repos, subscriptions, starred, followers, following, orgs, gists, events, received_events
Repository: profile, forks, issue_events, events, assignees, branches, tags, languages, stargazers, subscribers, commits, comments, issues, releases, deployments, labels
Organisation: profile, repos, events, hooks, issues, members
Search: repos, users, commits, issues, topics
Export Formats
- JSON
- CSV
- HTML
MIT Licence. See the LICENCE file for details.
