Users — github2 0.6.2 documentation
Note
See the official GitHub API v2 documentation for users.
- class github2.users.User(type)[source]¶
GitHub user container.
- public_repo_count¶
Number of active repositories owned by the user
- plan¶
Current active github plan
- total_private_repo_count¶
Number of private repositories
- company¶
Name of the company the user is associated with
- following_count¶
Number of other users the user is following
- name¶
The users full name
- followers_count¶
Number of users following this user
- login¶
The login username
- disk_usage¶
Currently used disk space
- public_gist_count¶
Number of active public gists owned by the user
- id¶
The user id
- created_at¶
The date this user was registered
- email¶
The users e-mail address
- owned_private_repo_count¶
Number of privately owned repos
- private_gist_count¶
Number of private gists owned by the user
- location¶
Location of the user
- collaborators¶
Number of collaborators
- blog¶
The users blog
- class github2.users.Users(type)[source]¶
GitHub API user functionality.
- add_key(key, title='')[source]¶
Add a SSH key for the authenticated user.
param str key: SSH key identifier param str title: Optional title for the SSH key Warning
Requires authentication
- follow(other_user)[source]¶
Follow a GitHub user.
param str other_user: GitHub user name Warning
Requires authentication
- followers(username)[source]¶
Get list of GitHub user’s followers.
Parameters: username (str) – GitHub user name
- following(username)[source]¶
Get list of users a GitHub user is following.
Parameters: username (str) – GitHub user name
- list_keys()[source]¶
Get list of SSH keys for the authenticated user. .. warning:: Requires authentication
- remove_key(key_id)[source]¶
Remove a SSH key for the authenticated user.
param int key_id: SSH key’s GitHub identifier Warning
Requires authentication
- search_by_email(query)[source]¶
Search for users by email address.
Parameters: query (str) – email to search for
- class github2.users.Key(type)[source]¶
SSH key container.
- key¶
The SSH key data
- title¶
The title for the SSH key
- id¶
The key id
Examples¶
Searching¶
>>> results = github.users.search("foo")
Getting User Information¶
>>> user = github.users.show("ask") >>> user.name "Ask Solem"
Getting User Network¶
>>> github.users.followers("ask") ['greut', 'howiworkdaily', 'emanchado', 'webiest']
>>> github.users.following("ask") ['sverrejoh', 'greut', 'jezdez', 'bradleywright', 'ericflo', 'howiworkdaily', 'emanchado', 'traviscline', 'russell']