Skip to content

Instantly share code, notes, and snippets.

@dimastatz
Created July 7, 2020 06:19
Show Gist options
  • Save dimastatz/9b029bf0ebb7796daa86738b3f78680e to your computer and use it in GitHub Desktop.
Save dimastatz/9b029bf0ebb7796daa86738b3f78680e to your computer and use it in GitHub Desktop.
from github import Github, Organization, NamedUser
def create_github(url, token):
return Github(base_url="https://{}/api/v3".format(url), login_or_token=token)
def get_org(g: Github, org_name: str):
return [x for x in g.get_user().get_orgs() if x.name == org_name][0]
def get_members(org: Organization.Organization):
return [(m.name, t.name) for t in org.get_teams() for m in t.get_members()]
@sbalasu27
Copy link

sbalasu27 commented Jan 26, 2021

Could you please share the repo link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment