Organizations¶
Note
See the official GitHub API v2 documentation for organizations and teams.
- class github2.organizations.Organization(type)[source]¶
Organization container.
New in version 0.4.0.
- email¶
The organization’s e-mail address.
- company¶
The organization’s company name.
- permission¶
Permissions within this organization.
- name¶
The full name of the organization.
- followers_count¶
Number of users following this organization.
- following_count¶
Number of users the organization is following.
- location¶
Location of the organization.
- id¶
The organization id.
- login¶
The login username.
- blog¶
The organization’s blog.
- gravatar_id¶
Gravatar ID.
- public_gist_count¶
Organization’s number of active public gists.
- public_repo_count¶
Organization’s number of active repositories.
- plan¶
GitHub plan for this organization.
- created_at¶
The date the organization was created.
- class github2.organizations.Organizations(type)[source]¶
GitHub API organizations functionality.
New in version 0.4.0.
Add a team to an organization.
param str organization: organization to add team to param str team: name of team to add param str permission: permissions for team(push, pull or admin) param list projects: optional GitHub projects for this team Warning
Requires authentication
- public_members(organization)[source]¶
Get list of public members in an organization.
Parameters: organization (str) – organization to list members for
- public_repositories(organization)[source]¶
Get list of public repositories in an organization.
Parameters: organization (str) – organization to list public repositories for
- repositories(organization='')[source]¶
Get list of all repositories in an organization.
If organization is not given, or is empty, then this will list repositories for all organizations the authenticated user belongs to.
Param : str organization: organization to list repositories for
Examples¶
Fetch Organizations Info¶
>>> org = github.organizations.show("JNRowe-test-only")
>>> org.created_at
datetime.datetime(2011, 5, 10, 11, 37, 27)
>>> repos = github.organizations.public_repositories(org.login)
>>> users = github.organizations.public_members(org.login)
>>> teams = github2.organizations.teams(org.login)
Fetch Authenticated User’s Organizations Data¶
>>> orgs = github.organizations.list()
>>> repos = github.organizations.repositories()