Skip to content

Commit

Permalink
Include org members
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jan 18, 2024
1 parent 19c2b0f commit b751ff7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions issues_by_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import csv
import os
from collections import Counter
from itertools import chain
from typing import Any, NamedTuple, TypeAlias

import requests # pip install requests
Expand Down Expand Up @@ -62,12 +63,25 @@ def main() -> None:
parser.add_argument("--limit", type=int, help="Limit to this number of usernames")
args = parser.parse_args()

# https://docs.github.com/en/rest/orgs/members?apiVersion=2022-11-28#list-organization-members
api = GhApi(owner="python", repo="cpython", token=GITHUB_TOKEN)
org_members = [
member.login
for member in chain.from_iterable(
paged(api.orgs.list_members, "python", per_page=100)
)
]
print(f"Found {len(org_members)} org members")

# Download usernames CSV
print("Download CSV")
r = requests.get(URL)
reader = csv.reader(r.text.splitlines())
usernames = [row[1] for row in reader if row[1]]
print(f"Found {len(usernames)} usernames")
core_devs = [row[1] for row in reader if row[1]]
print(f"Found {len(core_devs)} core devs")

usernames = list(set(org_members) | set(core_devs))
print(f"Found {len(usernames)} total users")

# Find issues for each user
authors = {}
Expand Down

0 comments on commit b751ff7

Please sign in to comment.