Skip to content

Instantly share code, notes, and snippets.

@rdegges
Created June 17, 2014 20:00
Show Gist options
  • Save rdegges/6cd8724e3a2394cd0860 to your computer and use it in GitHub Desktop.
Save rdegges/6cd8724e3a2394cd0860 to your computer and use it in GitHub Desktop.
Iterate Through Stormpath Accounts, Printing Custom Data
from json import dumps
from os import environ
from stormpath.client import Client
APPLICATION_NAME = 'test'
client = Client(
id = environ.get('STORMPATH_API_KEY_ID'),
secret = environ.get('STORMPATH_API_KEY_SECRET'),
)
application = client.applications.search(APPLICATION_NAME)[0]
for account in application.accounts.query(status='ENABLED'):
print account.given_name, account.surname, account.email
print dumps(dict(account.custom_data), indent=2, sort_keys=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment