-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathreporting.py
More file actions
19 lines (16 loc) · 769 Bytes
/
reporting.py
File metadata and controls
19 lines (16 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Author: Clément Notin
import csv
import json
with open("all_groups.json", "r", encoding="utf-8") as f:
groups = json.load(f)
with open("all_groups.csv", "w", newline="", encoding="utf8") as csvfile:
csvwriter = csv.writer(csvfile, delimiter=';', quotechar='"', quoting=csv.QUOTE_MINIMAL)
csvwriter.writerow(("Name", "Visibility", "Teams enabled", "Owners", "Members"))
csvwriter.writerows([
group['displayName'],
group['visibility'],
group['hasTeams'],
";".join(filter(None, group['owners'])),
";".join(filter(None, group['members'])),
]
for group in groups)