-
-
Save mihasya/a1fd1c4bbef04495a12b 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 python | |
from sys import stdin | |
import json | |
import base64 | |
report = json.loads(stdin.read()) | |
table = base64.b64decode(report["Content"]).splitlines() | |
head = table[0].split(",") | |
table = table[1:] | |
for row in iter(table): | |
user = dict(zip(head, row.split(","))) | |
# you now have a dictionary with keys like `user`, `mfa_active`, | |
# and `password_last_changed` | |
print "%s %s" % (user["user"], user["mfa_active"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment