Skip to content

Instantly share code, notes, and snippets.

@dehio3
Created July 28, 2020 02:15
Show Gist options
  • Save dehio3/2109f6869bfa2f69e2e55f350a761b3a to your computer and use it in GitHub Desktop.
Save dehio3/2109f6869bfa2f69e2e55f350a761b3a to your computer and use it in GitHub Desktop.
#!/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