I want to get the github users and their location. I know there is Github apI(GET /users) which can provide me the list of user. Currently I am using PyGithub to access the github but seems this library hasn't implemented this API. Can anyone please suggest me how to get the github users and their location using any github API library?
EDIT1: I updated the code which is as following. But some how I am not able to get the email-Id and location.
import github3
from datetime import datetime
def main():
g = github3.login(username="rakeshcusat", password="mypassword")
for user in g.iter_emails():
print user
current_time = datetime.now()
fhandler = open("githubuser_"+current_time.strftime("%d-%m-%y-%H:%M:%S"), "w")
for user in g.iter_all_users():
fhandler.write(" user: {0}, email: {1}, location: {2}\n".format(user, user.email, user.location))
#fhandler.flush()
fhandler.close()
if __name__ == "__main__":
main()
Sample output
user: andywatts, email: None, location:
user: mueller, email: None, location:
user: cp, email: None, location:
user: davea, email: None, location:
user: vrieskist, email: None, location: