Created
July 28, 2020 02:15
-
-
Save dehio3/2109f6869bfa2f69e2e55f350a761b3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# -*- coding: utf-8 -*- | |
from github import Github | |
def get_members(token, organization): | |
github = Github(token) | |
org = github.get_organization(organization) | |
members = org.get_members() | |
rows = [] | |
for i in range(members.totalCount): | |
member = members[i] | |
row = {} | |
row['organization'] = organization | |
row['login'] = member.login | |
row['name'] = member.name | |
row['email'] = member.email | |
row['created_at'] = member.created_at.strftime( | |
'%Y-%m-%d %H:%M:%S') | |
row['role'] = member.get_organization_membership(org).role | |
rows.append(row) | |
return rows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment