-
Notifications
You must be signed in to change notification settings - Fork 23
/
get_org_details.py
46 lines (37 loc) · 1.02 KB
/
get_org_details.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from github import Github
from github_token import GITHUB_TOKEN, user, password
g1 = Github(GITHUB_TOKEN)
g2 = Github(user, password)
#Get org object
org = g1.get_organization('coala')
print(org)
#Get issues assigned to you in an org
issues = org.get_issues()
for issue in issues:
print(issue)
#Get members of an org
members = org.get_members()
members_list = []
for member in members:
members_list.append(member)
#Check if a user is in members
has_in_members = org.has_in_members(members_list[0])
print (has_in_members)
#Get public members
public_members = org.get_public_members()
public_members_list = []
for public_member in public_members:
public_members_list.append(public_member)
#Check if a user in public memebr
has_in_public_members = org.has_in_public_members(public_members_list[0])
print (has_in_public_members)
#Get repos for an org
repos = org.get_repos()
repos_lsit=[]
for repo in repos:
repos_lsit.append(repo)
#GEt teams for an org
teams = org.get_teams()
teams_list=[]
for team in teams:
teams_list.append(team)