AuthenticatedUser

class github.AuthenticatedUser.AuthenticatedUser

This class represents AuthenticatedUsers as returned by https://docs.github.com/en/rest/reference/users#get-the-authenticated-user

An AuthenticatedUser object can be created by calling get_user() on a Github object.

avatar_url
Type:string
bio
Type:string
blog
Type:string
collaborators
Type:integer
company
Type:string
created_at
Type:datetime
disk_usage
Type:integer
email
Type:string
events_url
Type:string
followers
Type:integer
followers_url
Type:string
following
Type:integer
following_url
Type:string
gists_url
Type:string
gravatar_id
Type:string
hireable
Type:bool
html_url
Type:string
id
Type:integer
location
Type:string
login
Type:string
name
Type:string
node_id
Type:string
organizations_url
Type:string
owned_private_repos
Type:integer
plan
Type:github.Plan.Plan
private_gists
Type:integer
public_gists
Type:integer
public_repos
Type:integer
received_events_url
Type:string
repos_url
Type:string
site_admin
Type:bool
starred_url
Type:string
subscriptions_url
Type:string
total_private_repos
Type:integer
type
Type:string
updated_at
Type:datetime
url
Type:string
two_factor_authentication
Type:bool
add_to_emails(*emails)
Calls:POST /user/emails
Parameters:email – string
Return type:None
add_to_following(following)
Calls:PUT /user/following/{user}
Parameters:followinggithub.NamedUser.NamedUser
Return type:None
add_to_starred(starred)
Calls:PUT /user/starred/{owner}/{repo}
Parameters:starredgithub.Repository.Repository
Return type:None
add_to_subscriptions(subscription)
Calls:PUT /user/subscriptions/{owner}/{repo}
Parameters:subscriptiongithub.Repository.Repository
Return type:None
add_to_watched(watched)
Calls:PUT /repos/{owner}/{repo}/subscription
Parameters:watchedgithub.Repository.Repository
Return type:None
create_authorization(scopes=NotSet, note=NotSet, note_url=NotSet, client_id=NotSet, client_secret=NotSet, onetime_password=None)
Calls:

POST /authorizations

Parameters:
  • scopes – list of string
  • note – string
  • note_url – string
  • client_id – string
  • client_secret – string
  • onetime_password – string
Return type:

github.Authorization.Authorization

static create_fork(repo, name=NotSet, default_branch_only=NotSet)
Calls:

POST /repos/{owner}/{repo}/forks

Parameters:
Return type:

github.Repository.Repository

create_repo_from_template(name, repo, description=NotSet, private=NotSet)
Calls:POST /repos/{template_owner}/{template_repo}/generate
Parameters:name – string

:param repo github.Repository.Repository :param description: string :param private: bool :rtype: github.Repository.Repository

create_gist(public, files, description=NotSet)
Calls:

POST /gists

Parameters:
Return type:

github.Gist.Gist

create_key(title, key)
Calls:

POST /user/keys

Parameters:
  • title – string
  • key – string
Return type:

github.UserKey.UserKey

create_project(name, body=NotSet)
Calls:

POST /user/projects

Parameters:
  • name – string
  • body – string
Return type:

github.Project.Project

create_repo(name, description=NotSet, homepage=NotSet, private=NotSet, has_issues=NotSet, has_wiki=NotSet, has_downloads=NotSet, has_projects=NotSet, auto_init=NotSet, license_template=NotSet, gitignore_template=NotSet, allow_squash_merge=NotSet, allow_merge_commit=NotSet, allow_rebase_merge=NotSet, delete_branch_on_merge=NotSet)
Calls:

POST /user/repos

Parameters:
  • name – string
  • description – string
  • homepage – string
  • private – bool
  • has_issues – bool
  • has_wiki – bool
  • has_downloads – bool
  • has_projects – bool
  • auto_init – bool
  • license_template – string
  • gitignore_template – string
  • allow_squash_merge – bool
  • allow_merge_commit – bool
  • allow_rebase_merge – bool
  • delete_branch_on_merge – bool
Return type:

github.Repository.Repository

edit(name=NotSet, email=NotSet, blog=NotSet, company=NotSet, location=NotSet, hireable=NotSet, bio=NotSet)
Calls:

PATCH /user

Parameters:
  • name – string
  • email – string
  • blog – string
  • company – string
  • location – string
  • hireable – bool
  • bio – string
Return type:

None

get_authorization(id)
Calls:GET /authorizations/{id}
Parameters:id – integer
Return type:github.Authorization.Authorization
get_authorizations()
Calls:GET /authorizations
Return type:github.PaginatedList.PaginatedList of github.Authorization.Authorization
get_emails()
Calls:GET /user/emails
Return type:list of namedtuples with members email, primary, verified and visibility
get_events()
Calls:GET /events
Return type:github.PaginatedList.PaginatedList of github.Event.Event
get_followers()
Calls:GET /user/followers
Return type:github.PaginatedList.PaginatedList of github.NamedUser.NamedUser
get_following()
Calls:GET /user/following
Return type:github.PaginatedList.PaginatedList of github.NamedUser.NamedUser
get_gists(since=NotSet)
Calls:GET /gists
Parameters:since – datetime format YYYY-MM-DDTHH:MM:SSZ
Return type:github.PaginatedList.PaginatedList of github.Gist.Gist
get_issues(filter=NotSet, state=NotSet, labels=NotSet, sort=NotSet, direction=NotSet, since=NotSet)
Calls:

GET /issues

Return type:

github.PaginatedList.PaginatedList of github.Issue.Issue

Parameters:
  • filter – string
  • state – string
  • labels – list of github.Label.Label
  • sort – string
  • direction – string
  • since – datetime
Return type:

github.PaginatedList.PaginatedList of github.Issue.Issue

get_user_issues(filter=NotSet, state=NotSet, labels=NotSet, sort=NotSet, direction=NotSet, since=NotSet)
Calls:

GET /user/issues

Return type:

github.PaginatedList.PaginatedList of github.Issue.Issue

Parameters:
  • filter – string
  • state – string
  • labels – list of github.Label.Label
  • sort – string
  • direction – string
  • since – datetime
Return type:

github.PaginatedList.PaginatedList of github.Issue.Issue

get_key(id)
Calls:GET /user/keys/{id}
Parameters:id – integer
Return type:github.UserKey.UserKey
get_keys()
Calls:GET /user/keys
Return type:github.PaginatedList.PaginatedList of github.UserKey.UserKey
get_notification(id)
Calls:GET /notifications/threads/{id}
Return type:github.Notification.Notification
get_notifications(all=NotSet, participating=NotSet, since=NotSet, before=NotSet)
Calls:

GET /notifications

Parameters:
  • all – bool
  • participating – bool
  • since – datetime
  • before – datetime
Return type:

github.PaginatedList.PaginatedList of github.Notification.Notification

get_organization_events(org)
Calls:GET /users/{user}/events/orgs/{org}
Parameters:orggithub.Organization.Organization
Return type:github.PaginatedList.PaginatedList of github.Event.Event
get_orgs()
Calls:GET /user/orgs
Return type:github.PaginatedList.PaginatedList of github.Organization.Organization
get_repo(name)
Calls:GET /repos/{owner}/{repo}
Parameters:name – string
Return type:github.Repository.Repository
get_repos(visibility=NotSet, affiliation=NotSet, type=NotSet, sort=NotSet, direction=NotSet)
Calls:

GET /user/repos

Parameters:
  • visibility – string
  • affiliation – string
  • type – string
  • sort – string
  • direction – string
Return type:

github.PaginatedList.PaginatedList of github.Repository.Repository

get_starred()
Calls:GET /user/starred
Return type:github.PaginatedList.PaginatedList of github.Repository.Repository
get_starred_gists()
Calls:GET /gists/starred
Return type:github.PaginatedList.PaginatedList of github.Gist.Gist
get_subscriptions()
Calls:GET /user/subscriptions
Return type:github.PaginatedList.PaginatedList of github.Repository.Repository
get_teams()
Calls:GET /user/teams
Return type:github.PaginatedList.PaginatedList of github.Team.Team
get_watched()
Calls:GET /user/subscriptions
Return type:github.PaginatedList.PaginatedList of github.Repository.Repository
get_installations()
Calls:GET /user/installations
Return type:github.PaginatedList.PaginatedList of github.Installation.Installation
has_in_following(following)
Calls:GET /user/following/{user}
Parameters:followinggithub.NamedUser.NamedUser
Return type:bool
has_in_starred(starred)
Calls:GET /user/starred/{owner}/{repo}
Parameters:starredgithub.Repository.Repository
Return type:bool
has_in_subscriptions(subscription)
Calls:GET /user/subscriptions/{owner}/{repo}
Parameters:subscriptiongithub.Repository.Repository
Return type:bool
has_in_watched(watched)
Calls:GET /repos/{owner}/{repo}/subscription
Parameters:watchedgithub.Repository.Repository
Return type:bool
mark_notifications_as_read(last_read_at=datetime.datetime(2023, 8, 10, 7, 42, 54, 28343, tzinfo=datetime.timezone.utc))
Calls:PUT /notifications
Parameters:last_read_at – datetime
remove_from_emails(*emails)
Calls:DELETE /user/emails
Parameters:email – string
Return type:None
remove_from_following(following)
Calls:DELETE /user/following/{user}
Parameters:followinggithub.NamedUser.NamedUser
Return type:None
remove_from_starred(starred)
Calls:DELETE /user/starred/{owner}/{repo}
Parameters:starredgithub.Repository.Repository
Return type:None
remove_from_subscriptions(subscription)
Calls:DELETE /user/subscriptions/{owner}/{repo}
Parameters:subscriptiongithub.Repository.Repository
Return type:None
remove_from_watched(watched)
Calls:DELETE /repos/{owner}/{repo}/subscription
Parameters:watchedgithub.Repository.Repository
Return type:None
accept_invitation(invitation)
Calls:PATCH /user/repository_invitations/{invitation_id}
Parameters:invitationgithub.Invitation.Invitation or int
Return type:None
get_invitations()
Calls:GET /user/repository_invitations
Return type:github.PaginatedList.PaginatedList of github.Invitation.Invitation
create_migration(repos, lock_repositories=NotSet, exclude_attachments=NotSet)
Calls:

POST /user/migrations

Parameters:
  • repos – list or tuple of str
  • lock_repositories – bool
  • exclude_attachments – bool
Return type:

github.Migration.Migration

get_migrations()
Calls:GET /user/migrations
Return type:github.PaginatedList.PaginatedList of github.Migration.Migration
get_organization_membership(org)
Calls:GET /user/memberships/orgs/{org}
Return type:github.Membership.Membership