mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
16 KiB
16 KiB
You don't normaly create instances of any class but Github.
You obtain instances through calls to get_ and create_ methods.
Class Github
- Constructed from user's login and password
get_user():AuthenticatedUserget_user( login ):NamedUserget_organization( login ):Organizationget_gist( id ):Gistget_gists(): list ofGist
Class AuthenticatedUser
Attributes
loginidavatar_urlgravatar_idurlnamecompanybloglocationemailhireablebiopublic_repospublic_gistsfollowersfollowinghtml_urlcreated_attypetotal_private_reposowned_private_reposprivate_gistsdisk_usagecollaboratorsplan
Modification
edit( [name, email, blog, company, location, hireable, bio] )
Emails
get_emails(): list of stringadd_to_emails( email, ... )email: string
remove_from_emails( email, ... )email: string
Authorizations
get_authorizations(): list ofAuthorizationget_authorization( id ):Authorizationcreate_authorization( [scopes, note, note_url] ):Authorization
Keys
get_keys(): list ofUserKeyget_key( id ):UserKeycreate_key( title, key ):UserKey
Events
get_events(): list ofEvent
Followers
get_followers(): list ofNamedUser
Following
get_following(): list ofNamedUseradd_to_following( following )following:NamedUser
remove_from_following( following )following:NamedUser
has_in_following( following ): boolfollowing:NamedUser
Orgs
get_orgs(): list ofOrganizationget_organization_events( org ): list ofEvent
Repos
get_repos( [type] ): list ofRepositoryget_repo( name ):Repositorycreate_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] ):Repository
Watched
get_watched(): list ofRepositoryadd_to_watched( watched )watched:Repository
remove_from_watched( watched )watched:Repository
has_in_watched( watched ): boolwatched:Repository
Forking
create_fork( repo ):Repository
Gists
get_gists(): list ofGistcreate_gist( public, files, [description] ):Gistget_starred_gists(): list ofGist
Issues
get_issues(): list ofIssue
Class Authorization
Attributes
idurlscopestokenappnotenote_urlupdated_atcreated_at
Modification
edit( [scopes, add_scopes, remove_scopes, note, note_url] )
Deletion
delete()
Class Branch
Attributes
namecommit:Commit
Class Commit
Attributes
shaurlparentsstatsfilescommit:GitCommitauthor:NamedUsercommitter:NamedUser
Comments
get_comments(): list ofCommitCommentcreate_comment( body, [commit_id, line, path, position] ):CommitComment
Class CommitComment
Attributes
urlidbodypathpositioncommit_idcreated_atupdated_athtml_urllineuser:NamedUser
Modification
edit( body )
Deletion
delete()
Class Download
Attributes
urlhtml_urlidnamedescriptionsizedownload_countcontent_typepolicysignaturebucketaccesskeyidpathaclexpirationdateprefixmime_typeredirects3_urlcreated_at
Deletion
delete()
Class Event
Attributes
typepublicpayloadcreated_atidcommit_idurleventissuerepo:Repositoryactor:NamedUserorg:Organization
Class Gist
Attributes
urliddescriptionpublicfilescommentshtml_urlgit_pull_urlgit_push_urlcreated_atforkshistoryupdated_atuser:NamedUser
Modification
edit( [description, files] )
Deletion
delete()
Comments
get_comments(): list ofGistCommentget_comment( id ):GistCommentcreate_comment( body ):GistComment
Starring
is_starred(): boolset_starred()reset_starred()
Forking
create_fork():Gist
Class GistComment
Attributes
idurlbodycreated_atupdated_atuser:NamedUser
Modification
edit( body )
Deletion
delete()
Class GitBlob
Attributes
shasizeurlcontentencoding
Class GitCommit
Attributes
shaurlmessageparentsauthorcommittertree:GitTree
Class GitRef
Attributes
refurlobject
Modification
edit( sha, [force] )
Deletion
delete()
Class GitTag
Attributes
tagshaurlmessagetaggerobject
Class GitTree
Attributes
shaurltreerecursive
Class Hook
Attributes
urlupdated_atcreated_atnameeventsactiveconfigidlast_response
Modification
edit( name, config, [events, add_events, remove_events, active] )
Deletion
delete()
Testing
test()
Class Issue
Attributes
urlhtml_urlnumberstatetitlebodylabelscommentsclosed_atcreated_atupdated_atidclosed_bypull_requestuser:NamedUserassignee:NamedUsermilestone:Milestone
Modification
edit( [title, body, assignee, state, milestone, labels] )
Labels
get_labels(): list ofLabeladd_to_labels( label, ... )label:Label
set_labels( label, ... )label:Label
delete_labels()remove_from_labels( label )label:Label
Comments
get_comments(): list ofIssueCommentget_comment( id ):IssueCommentcreate_comment( body ):IssueComment
Events
get_events(): list ofIssueEvent
Class IssueComment
Attributes
urlbodycreated_atupdated_atiduser:NamedUser
Modification
edit( body )
Deletion
delete()
Class IssueEvent
Attributes
idurlcreated_atissueeventcommit_idactor:NamedUser
Class Label
Attributes
urlnamecolor
Modification
edit( name, color )
Deletion
delete()
Class Milestone
Attributes
urlnumberstatetitledescriptionopen_issuesclosed_issuescreated_atdue_oncreator:NamedUser
Modification
edit( title, [state, description, due_on] )
Deletion
delete()
Labels
get_labels(): list ofLabel
Class NamedUser
Attributes
loginidavatar_urlgravatar_idurlnamecompanybloglocationemailhireablebiopublic_repospublic_gistsfollowersfollowinghtml_urlcreated_attypecontributionsdisk_usagecollaboratorsplantotal_private_reposowned_private_reposprivate_gists
Followers
get_followers(): list ofNamedUser
Following
get_following(): list ofNamedUser
Orgs
get_orgs(): list ofOrganization
Events
get_events(): list ofEventget_public_events(): list ofEvent
Received events
get_received_events(): list ofEventget_public_received_events(): list ofEvent
Repos
get_repos( [type] ): list ofRepositoryget_repo( name ):Repository
Watched
get_watched(): list ofRepository
Gists
get_gists(): list ofGistcreate_gist( public, files, [description] ):Gist
Class Organization
Attributes
loginidurlavatar_urlnamecompanybloglocationemailpublic_repospublic_gistsfollowersfollowinghtml_urlcreated_attypegravatar_iddisk_usagecollaboratorsbilling_emailplanprivate_giststotal_private_reposowned_private_repos
Modification
edit( [billing_email, blog, company, email, location, name] )
Public members
get_public_members(): list ofNamedUseradd_to_public_members( public_member )public_member:NamedUser
remove_from_public_members( public_member )public_member:NamedUser
has_in_public_members( public_member ): boolpublic_member:NamedUser
Members
get_members(): list ofNamedUserremove_from_members( member )member:NamedUser
has_in_members( member ): boolmember:NamedUser
Repos
get_repos( [type] ): list ofRepositoryget_repo( name ):Repositorycreate_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] ):Repository
Forking
create_fork( repo ):Repository
Teams
get_teams(): list ofTeamcreate_team( name, [repo_names, permission] ):Team
Events
get_events(): list ofEvent
Class PullRequest
Attributes
idurlhtml_urldiff_urlpatch_urlissue_urlnumberstatetitlebodycreated_atupdated_atclosed_atmerged_atmergedmergeablecommentscommitsadditionsdeletionschanged_filesheadbasemerged_byreview_commentsuser:NamedUser
Modification
edit( [title, body, state] )
Commits
get_commits(): list ofCommit
Files
get_files(): list ofPullRequestFile
Comments
get_comments(): list ofPullRequestCommentget_comment( id ):PullRequestCommentcreate_comment( < body, commit_id, path, position > or < body, in_reply_to > ):PullRequestCommentis_merged(): boolmerge( [commit_message] )
Class PullRequestComment
Attributes
urlidbodypathpositioncommit_idcreated_atupdated_athtml_urllineuser:NamedUser
Modification
edit( body )
Deletion
delete()
Class PullRequestFile
Attributes
shafilenamestatusadditionsdeletionschangesblob_urlraw_urlpatch
Class Repository
Attributes
urlhtml_urlclone_urlgit_urlssh_urlsvn_urlnamedescriptionhomepagelanguageprivateforkforkswatcherssizemaster_branchopen_issuespushed_atcreated_atorganizationhas_issueshas_wikihas_downloadsmirror_urlupdated_atidowner:NamedUserparent:Repositorysource:Repository
Issues events
get_issues_events(): list ofIssueEventget_issues_event( id ):IssueEvent
Forks
get_forks(): list ofRepository
Modification
edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads] )
Languages
get_languages(): dictionary of strings to integers
Hooks
get_hooks(): list ofHookget_hook( id ):Hookcreate_hook( name, config, [events, active] ):Hook
Keys
get_keys(): list ofRepositoryKeyget_key( id ):RepositoryKeycreate_key( title, key ):RepositoryKey
Collaborators
get_collaborators(): list ofNamedUseradd_to_collaborators( collaborator )collaborator:NamedUser
remove_from_collaborators( collaborator )collaborator:NamedUser
has_in_collaborators( collaborator ): boolcollaborator:NamedUser
Contributors
get_contributors(): list ofNamedUser
Watchers
get_watchers(): list ofNamedUser
Git refs
get_git_refs(): list ofGitRefget_git_ref( ref ):GitRefcreate_git_ref( ref, sha ):GitRef
Git commits
get_git_commit( sha ):GitCommitcreate_git_commit( message, tree, parents, [author, committer] ):GitCommit
Git trees
get_git_tree( sha, [recursive] ):GitTreecreate_git_tree( tree, [base_tree] ):GitTree
Git blobs
get_git_blob( sha ):GitBlobcreate_git_blob( content, encoding ):GitBlob
Git tags
get_git_tag( sha ):GitTagcreate_git_tag( tag, message, object, type, [tagger] ):GitTag
Labels
get_labels(): list ofLabelget_label( name ):Labelcreate_label( name, color ):Label
Milestones
get_milestones( [state, sort, direction] ): list ofMilestoneget_milestone( number ):Milestonecreate_milestone( title, [state, description, due_on] ):Milestone
Issues
get_issues( [milestone, state, assignee, mentioned, labels, sort, direction, since] ): list ofIssueget_issue( number ):Issuecreate_issue( title, [body, assignee, milestone, labels] ):Issue
Downloads
get_downloads(): list ofDownloadget_download( id ):Downloadcreate_download( name, size, [description, content_type] ):Download
Comments
get_comments(): list ofCommitCommentget_comment( id ):CommitComment
Commits
get_commits( [sha, path] ): list ofCommitget_commit( sha ):Commit
Tags
get_tags(): list ofTag
Branches
get_branches(): list ofBranch
Pulls
get_pulls( [state] ): list ofPullRequestget_pull( number ):PullRequestcreate_pull( < title, body, base, head > or < issue, base, head > ):PullRequestcompare( base, head )
Teams
get_teams(): list ofTeam
Events
get_events(): list ofEventget_network_events(): list ofEvent
Class RepositoryKey
Attributes
urlidtitlekey
Modification
edit( title, key )
Deletion
delete()
Class Tag
Attributes
namezipball_urltarball_urlcommit:Commit
Class Team
Attributes
urlnameidpermissionmembers_countrepos_count
Modification
edit( name, [permission] )
Deletion
delete()
Members
get_members(): list ofNamedUseradd_to_members( member )member:NamedUser
remove_from_members( member )member:NamedUser
has_in_members( member ): boolmember:NamedUser
Repos
get_repos(): list ofRepositoryadd_to_repos( repo )repo:Repository
remove_from_repos( repo )repo:Repository
has_in_repos( repo ): boolrepo:Repository
Class UserKey
Attributes
urlidtitlekey
Modification
edit( [title, key] )
Deletion
delete()