Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:05
What would you like to do?
#!/usr/bin/env python
from sys import stdin
import json
import base64
report = json.loads(
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