Overview of an Organization

This notebook uses the github3.py project to use the GitHub API in gathering information about an organization's repositories.

To use: Set the ORGANIZATION to GitHub organization name. Authenticate via GitHub user/password or token to avoid rate limits.


In [ ]:
import github3
import os

In [ ]:
# Set ORGANIZATION
ORGANIZATION = 'jupyter'

In [ ]:
GH_NAME= os.environ.get('GH_NAME')
GH_PASSWD = os.environ.get('GH_PASSWORD')
GH_TOKEN = os.environ.get('GH_TOKEN')

In [ ]:
# Authenticate and get a github object for accessing API without rate limits
gh = github3.login(GH_NAME, GH_PASSWD)

Repos


In [ ]:
# Get all repos of the ORGANIZATION
repos = [r.refresh() for r in gh.repositories_by(ORGANIZATION)]

Open Issue Counts


In [ ]:
print('{0:30} {1:20}'.format("Repository name", "Open Issues"))
print('{0:30} {1:20}'.format("---------------", "-----------"))
for repo in repos:
    #print('%s: %d' % (repo.name, repo.open_issues_count))
    print('{0:30} {1:3d}'.format(repo.name, repo.open_issues_count))

Repo Creation Date and description


In [ ]:
import datetime
print('{0:30} {1:25} {2:30}'.format("Repository name", "created", "Description"))
print('{0:30} {1:25} {2:30}'.format("---------------", "-------", "-----------"))
for repo in repos:
    #print('%s: %d' % (repo.name, repo.open_issues_count))
    print('{0:30} {1:25} {2:30}'.format(repo.name, str(repo.created_at), repo.description))

In [ ]:


In [ ]:


In [ ]:
dir(repo)

In [ ]: