Search code examples
pythonpython-3.xpygithub

Get a User Information in Github using PyGithub


I am new to Github programming. I'd like to get user details who are in github by giving the username as input. How do I do that using pygithub?

Also how do I get their profile photo too?

Thank you


Solution

  • https://help.github.com/en/articles/searching-users

    This link has the syntax for searching users information

    Import github
    g=github.Github()
    users=g.search_users(str(username)+" in:login")
    

    You can refer the formate and use it in python like this This search_users function returns all the information about the user which are available in public.