
GitHub डेटा विश्लेषण के लिए टर्मिनल-आधारित टूलकिट।

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 डेटा क्वेरी करें:
# 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 --json
सामान्य विकल्प:
--page - पृष्ठ संख्या (डिफ़ॉल्ट: 1)--per-page - प्रति पृष्ठ परिणाम, अधिकतम 100 (डिफ़ॉल्ट: 100)--json - JSON के रूप में आउटपुट--export DIR - निर्देशिका में निर्यात करेंउपलब्ध डेटा प्रकार फ़्लैग के लिए octosuite <command> --help चलाएँ।
अपने Python प्रोजेक्ट्स में octosuite का उपयोग करें:
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()
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
MIT लाइसेंस। विवरण के लिए LICENCE फ़ाइल देखें।