How to create a new repository with PyGithub

The solution to my question is the following

g = Github(token)
user = g.get_user()
repo = user.create_repo(full_name)

I stumbled across this question trying to figure out how to coax PyGithub into creating a Repository within an Organization and thought it would be relevant here.

g = Github(token)
organization = g.get_organization("org-name")
organization.create_repo(
        name,
        allow_rebase_merge=True,
        auto_init=False,
        description=description,
        has_issues=True,
        has_projects=False,
        has_wiki=False,
        private=True,
       )

The full set of keyword arguments may be found here: https://developer.github.com/v3/repos/#input

Tags:

Python

Git

Github