def get_github_email(access_token):
 request = Request(u'https://api.github.com/user/emails')
 request.timeout = 1.0
 request.add_header(u'User-Agent', USER_AGENT)
 request.add_header(u'Authorization', u'token {0}'.format(access_token))
 handle = urlopen(request)
 data = json.loads(handle.read().decode(u'utf-8'))
 email = None
 for entry in data:
  if (not entry[u'verified']):
   continue
  email = entry[u'email']
  if entry[u'primary']:
   break
 return email

def get_github_email ( access_token ) : request = Request ( u'https://api.github.com/user/emails' ) request . timeout = 1.0 request . add_header ( u'User-Agent' , USER_AGENT ) request . add_header ( u'Authorization' , u'token {0}' . format ( access_token ) ) handle = urlopen ( request ) data = json . loads ( handle . read ( ) . decode ( u'utf-8' ) ) email = None for entry in data : if ( not entry [ u'verified' ] ) : continue email = entry [ u'email' ] if entry [ u'primary' ] : break return email
get real email from github .