Main Class

This is the main class.

Get current user

>>> user = g.get_user()
>>> user.login
u'sfdye'

Get user by name

>>> user = g.get_user("sfdye")
>>> user.name
u'Wan Liuyang'

Get repository by name

>>> repo = g.get_repo("PyGithub/PyGithub")
>>> repo.name
u'PyGithub'

Get organization by name

>>> org = g.get_organization("PyGithub")
>>> org.login
u'PyGithub'

Get enterprise consumed licenses by name

>>> enterprise = g.get_enterprise_consumed_licenses("PyGithub")
>>> enterprise_consumed_licenses = enterprise.get_enterprise_consumed_licenses()
>>> enterprise_consumed_licenses.total_seats_consumed
5000

Search repositories by language

>>> repositories = g.search_repositories(query='language:python')
>>> for repo in repositories:
...    print(repo)
...
Repository(full_name="vinta/awesome-python")
Repository(full_name="donnemartin/system-design-primer")
Repository(full_name="toddmotto/public-apis")
Repository(full_name="rg3/youtube-dl")
Repository(full_name="tensorflow/models")
Repository(full_name="django/django")

Search repositories based on number of issues with good-first-issue

>>> repositories = g.search_repositories(query='good-first-issues:>3')
>>> for repo in repositories:
...    print(repo)
...
Repository(full_name="vuejs/vue")
Repository(full_name="facebook/react")
Repository(full_name="facebook/react-native")
Repository(full_name="electron/electron")
Repository(full_name="Microsoft/vscode")