Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Query for email addresses of Fedora contributors by country
#!/usr/bin/python
from fedora.client import AccountSystem
from getpass import getpass
import sys
if len(sys.argv) != 2:
print "Usage: %s <country code>" % (sys.argv[0])
sys.exit(1)
country = sys.argv[1].upper().strip()
username = raw_input("FAS Username: ")
password = getpass()
fas = AccountSystem(username=username,password=password)
people = fas.people_by_key(key='username', fields=['human_name','username', 'country_code','email'])
for p in people:
if people[p]['country_code'] == country:
print '"%s" <%s>,' % (people[p]['human_name'],people[p]['email'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment