Files
PyGithub/ReferenceOfClasses.md
T

1190 lines
19 KiB
Markdown

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()`: `AuthenticatedUser`
* `get_user( login )`: `NamedUser`
* `get_organization( login )`: `Organization`
* `get_gist( id )`: `Gist`
* `get_gists()`: list of `Gist`
Class `AuthenticatedUser`
=========================
Attributes
----------
* `avatar_url`
* `bio`
* `blog`
* `collaborators`
* `company`
* `created_at`
* `disk_usage`
* `email`
* `followers`
* `following`
* `gravatar_id`
* `hireable`
* `html_url`
* `id`
* `location`: string
* `login`: string
* `name`: string
* `owned_private_repos`
* `plan`
* `private_gists`
* `public_gists`
* `public_repos`
* `total_private_repos`
* `type`
* `url`
Authorizations
--------------
* `create_authorization( [scopes, note, note_url] )`: `Authorization`
* `scopes`
* `note`
* `note_url`
* `get_authorization( id )`: `Authorization`
* `id`
* `get_authorizations()`: list of `Authorization`
Emails
------
* `add_to_emails( email, ... )`
* `email`: string
* `get_emails()`: list of string
* `remove_from_emails( email, ... )`
* `email`: string
Events
------
* `get_events()`: list of `Event`
* `get_organization_events( org )`: list of `Event`
* `org`
Followers
---------
* `get_followers()`: list of `NamedUser`
Following
---------
* `add_to_following( following )`
* `following`: `NamedUser`
* `get_following()`: list of `NamedUser`
* `has_in_following( following )`: bool
* `following`: `NamedUser`
* `remove_from_following( following )`
* `following`: `NamedUser`
Forking
-------
* `create_fork( repo )`: `Repository`
* `repo`: `Repository`
Gists
-----
* `create_gist( public, files, [description] )`: `Gist`
* `public`: bool
* `files`: `dict`
* `description`: string
* `get_gists()`: list of `Gist`
* `get_starred_gists()`: list of `Gist`
Issues
------
* `get_issues()`: list of `Issue`
Keys
----
* `create_key( title, key )`: `UserKey`
* `title`
* `key`
* `get_key( id )`: `UserKey`
* `id`
* `get_keys()`: list of `UserKey`
Modification
------------
* `edit( [name, email, blog, company, location, hireable, bio] )`
* `name`: string
* `email`: string
* `blog`: string
* `company`: string
* `location`: string
* `hireable`: bool
* `bio`: string
Orgs
----
* `get_orgs()`: list of `Organization`
Repos
-----
* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] )`: `Repository`
* `name`: string
* `description`: string
* `homepage`: string
* `private`: bool
* `has_issues`: bool
* `has_wiki`: bool
* `has_downloads`: bool
* `team_id`: `int`
* `get_repo( name )`: `Repository`
* `name`: string
* `get_repos( [type] )`: list of `Repository`
* `type`
Watched
-------
* `add_to_watched( watched )`
* `watched`: `Repository`
* `get_watched()`: list of `Repository`
* `has_in_watched( watched )`: bool
* `watched`: `Repository`
* `remove_from_watched( watched )`
* `watched`: `Repository`
Class `Authorization`
=====================
Attributes
----------
* `app`
* `created_at`
* `id`
* `note`
* `note_url`
* `scopes`
* `token`
* `updated_at`
* `url`
Deletion
--------
* `delete()`
Modification
------------
* `edit( [scopes, add_scopes, remove_scopes, note, note_url] )`
* `scopes`
* `add_scopes`
* `remove_scopes`
* `note`
* `note_url`
Class `Branch`
==============
Attributes
----------
* `commit`: `Commit`
* `name`: string
Class `Commit`
==============
Attributes
----------
* `author`: `NamedUser`
* `commit`: `GitCommit`
* `committer`: `NamedUser`
* `files`
* `parents`
* `sha`: string
* `stats`
* `url`: string
Comments
--------
* `create_comment( body, [commit_id, line, path, position] )`: `CommitComment`
* `body`
* `commit_id`
* `line`
* `path`
* `position`
* `get_comments()`: list of `CommitComment`
Class `CommitComment`
=====================
Attributes
----------
* `body`
* `commit_id`
* `created_at`
* `html_url`
* `id`
* `line`
* `path`
* `position`
* `updated_at`
* `url`
* `user`: `NamedUser`
Deletion
--------
* `delete()`
Modification
------------
* `edit( body )`
* `body`
Class `Download`
================
Attributes
----------
* `accesskeyid`
* `acl`
* `bucket`
* `content_type`
* `created_at`
* `description`
* `download_count`
* `expirationdate`
* `html_url`
* `id`
* `mime_type`
* `name`
* `path`
* `policy`
* `prefix`
* `redirect`
* `s3_url`
* `signature`
* `size`
* `url`
Deletion
--------
* `delete()`
Class `Event`
=============
Attributes
----------
* `actor`: `NamedUser`
* `commit_id`
* `created_at`
* `event`
* `id`
* `issue`
* `org`: `Organization`
* `payload`
* `public`
* `repo`: `Repository`
* `type`
* `url`
Class `Gist`
============
Attributes
----------
* `comments`
* `created_at`
* `description`: string
* `files`
* `forks`
* `git_pull_url`
* `git_push_url`
* `history`
* `html_url`
* `id`: integer
* `public`
* `updated_at`
* `url`
* `user`: `NamedUser`
Comments
--------
* `create_comment( body )`: `GistComment`
* `body`
* `get_comment( id )`: `GistComment`
* `id`
* `get_comments()`: list of `GistComment`
Deletion
--------
* `delete()`
Forking
-------
* `create_fork()`: `Gist`
Modification
------------
* `edit( [description, files] )`
* `description`: string
* `files`
Starring
--------
* `is_starred()`: bool
* `reset_starred()`
* `set_starred()`
Class `GistComment`
===================
Attributes
----------
* `body`
* `created_at`
* `id`
* `updated_at`
* `url`
* `user`: `NamedUser`
Deletion
--------
* `delete()`
Modification
------------
* `edit( body )`
* `body`
Class `GitBlob`
===============
Attributes
----------
* `content`
* `encoding`
* `sha`
* `size`
* `url`
Class `GitCommit`
=================
Attributes
----------
* `author`
* `committer`
* `message`
* `parents`
* `sha`
* `tree`: `GitTree`
* `url`
Class `GitRef`
==============
Attributes
----------
* `object`
* `ref`: string
* `url`
Deletion
--------
* `delete()`
Modification
------------
* `edit( sha, [force] )`
* `sha`
* `force`
Class `GitTag`
==============
Attributes
----------
* `message`
* `object`
* `sha`
* `tag`
* `tagger`
* `url`
Class `GitTree`
===============
Attributes
----------
* `recursive`
* `sha`
* `tree`
* `url`
Class `Hook`
============
Attributes
----------
* `active`
* `config`
* `created_at`
* `events`
* `id`
* `last_response`
* `name`
* `updated_at`
* `url`
Deletion
--------
* `delete()`
Modification
------------
* `edit( name, config, [events, add_events, remove_events, active] )`
* `name`
* `config`
* `events`
* `add_events`
* `remove_events`
* `active`
Testing
-------
* `test()`
Class `Issue`
=============
Attributes
----------
* `assignee`: `NamedUser`
* `body`
* `closed_at`
* `closed_by`
* `comments`
* `created_at`
* `html_url`
* `id`
* `labels`
* `milestone`: `Milestone`
* `number`
* `pull_request`
* `state`
* `title`
* `updated_at`
* `url`
* `user`: `NamedUser`
Comments
--------
* `create_comment( body )`: `IssueComment`
* `body`: string
* `get_comment( id )`: `IssueComment`
* `id`
* `get_comments()`: list of `IssueComment`
Events
------
* `get_events()`: list of `IssueEvent`
Labels
------
* `add_to_labels( label, ... )`
* `label`: `Label`
* `delete_labels()`
* `get_labels()`: list of `Label`
* `remove_from_labels( label )`
* `label`: `Label`
* `set_labels( label, ... )`
* `label`: `Label`
Modification
------------
* `edit( [title, body, assignee, state, milestone, labels] )`
* `title`
* `body`
* `assignee`
* `state`
* `milestone`
* `labels`
Class `IssueComment`
====================
Attributes
----------
* `body`
* `created_at`
* `id`
* `updated_at`
* `url`
* `user`: `NamedUser`
Deletion
--------
* `delete()`
Modification
------------
* `edit( body )`
* `body`
Class `IssueEvent`
==================
Attributes
----------
* `actor`: `NamedUser`
* `commit_id`
* `created_at`
* `event`
* `id`
* `issue`
* `url`
Class `Label`
=============
Attributes
----------
* `color`
* `name`
* `url`
Deletion
--------
* `delete()`
Modification
------------
* `edit( name, color )`
* `name`
* `color`
Class `Milestone`
=================
Attributes
----------
* `closed_issues`
* `created_at`
* `creator`: `NamedUser`
* `description`
* `due_on`
* `number`
* `open_issues`
* `state`
* `title`
* `url`
Deletion
--------
* `delete()`
Labels
------
* `get_labels()`: list of `Label`
Modification
------------
* `edit( title, [state, description, due_on] )`
* `title`
* `state`
* `description`
* `due_on`
Class `NamedUser`
=================
Attributes
----------
* `avatar_url`
* `bio`
* `blog`
* `collaborators`
* `company`
* `contributions`
* `created_at`
* `disk_usage`
* `email`
* `followers`: integer
* `following`
* `gravatar_id`
* `hireable`
* `html_url`
* `id`
* `location`: string
* `login`: string
* `name`: string
* `owned_private_repos`
* `plan`
* `private_gists`
* `public_gists`
* `public_repos`
* `total_private_repos`
* `type`
* `url`
Events
------
* `get_events()`: list of `Event`
* `get_public_events()`: list of `Event`
* `get_received_events()`: list of `Event`
* `get_public_received_events()`: list of `Event`
Followers
---------
* `get_followers()`: list of `NamedUser`
Following
---------
* `get_following()`: list of `NamedUser`
Gists
-----
* `create_gist( public, files, [description] )`: `Gist`
* `public`: bool
* `files`: `dict`
* `description`: string
* `get_gists()`: list of `Gist`
Orgs
----
* `get_orgs()`: list of `Organization`
Repos
-----
* `get_repo( name )`: `Repository`
* `name`: string
* `get_repos( [type] )`: list of `Repository`
* `type`
Watched
-------
* `get_watched()`: list of `Repository`
Class `Organization`
====================
Attributes
----------
* `avatar_url`
* `billing_email`
* `blog`
* `collaborators`
* `company`
* `created_at`
* `disk_usage`
* `email`
* `followers`
* `following`
* `gravatar_id`
* `html_url`
* `id`
* `location`: string
* `login`: string
* `name`: string
* `owned_private_repos`
* `plan`
* `private_gists`
* `public_gists`
* `public_repos`
* `total_private_repos`
* `type`
* `url`
Events
------
* `get_events()`: list of `Event`
Forking
-------
* `create_fork( repo )`: `Repository`
* `repo`: `Repository`
Members
-------
* `get_members()`: list of `NamedUser`
* `has_in_members( member )`: bool
* `member`: `NamedUser`
* `remove_from_members( member )`
* `member`: `NamedUser`
Modification
------------
* `edit( [billing_email, blog, company, email, location, name] )`
* `billing_email`
* `blog`
* `company`
* `email`
* `location`
* `name`
Public_members
--------------
* `add_to_public_members( public_member )`
* `public_member`: `NamedUser`
* `get_public_members()`: list of `NamedUser`
* `has_in_public_members( public_member )`: bool
* `public_member`: `NamedUser`
* `remove_from_public_members( public_member )`
* `public_member`: `NamedUser`
Repos
-----
* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] )`: `Repository`
* `name`: string
* `description`: string
* `homepage`: string
* `private`: bool
* `has_issues`: bool
* `has_wiki`: bool
* `has_downloads`: bool
* `team_id`: `int`
* `get_repo( name )`: `Repository`
* `name`: string
* `get_repos( [type] )`: list of `Repository`
* `type`
Teams
-----
* `create_team( name, [repo_names, permission] )`: `Team`
* `name`: string
* `repo_names`: `list`
* `permission`
* `get_teams()`: list of `Team`
Class `PullRequest`
===================
Attributes
----------
* `additions`
* `base`
* `body`
* `changed_files`
* `closed_at`
* `comments`
* `commits`
* `created_at`
* `deletions`
* `diff_url`
* `head`
* `html_url`
* `id`
* `issue_url`
* `mergeable`
* `merged`
* `merged_at`
* `merged_by`
* `number`
* `patch_url`
* `review_comments`
* `state`
* `title`
* `updated_at`
* `url`
* `user`: `NamedUser`
Comments
--------
* `create_comment( < body, commit_id, path, position > or < body, in_reply_to > )`: `PullRequestComment`
* `get_comment( id )`: `PullRequestComment`
* `id`
* `get_comments()`: list of `PullRequestComment`
Commits
-------
* `get_commits()`: list of `Commit`
Files
-----
* `get_files()`: list of `PullRequestFile`
Merging
-------
* `is_merged()`: bool
* `merge( [commit_message] )`
* `commit_message`: string
Modification
------------
* `edit( [title, body, state] )`
* `title`
* `body`
* `state`
Class `PullRequestComment`
==========================
Attributes
----------
* `body`
* `commit_id`
* `created_at`
* `html_url`
* `id`
* `line`
* `path`
* `position`
* `updated_at`
* `url`
* `user`: `NamedUser`
Deletion
--------
* `delete()`
Modification
------------
* `edit( body )`
* `body`
Class `PullRequestFile`
=======================
Attributes
----------
* `additions`
* `blob_url`
* `changes`
* `deletions`
* `filename`
* `patch`
* `raw_url`
* `sha`
* `status`
Class `Repository`
==================
Attributes
----------
* `clone_url`
* `created_at`
* `description`
* `fork`
* `forks`
* `git_url`
* `has_downloads`
* `has_issues`
* `has_wiki`
* `homepage`
* `html_url`
* `id`
* `language`
* `master_branch`
* `mirror_url`
* `name`: string
* `open_issues`
* `organization`
* `owner`: `NamedUser`
* `parent`: `Repository`
* `permissions`
* `private`
* `pushed_at`
* `size`
* `source`: `Repository`
* `ssh_url`
* `svn_url`
* `updated_at`
* `url`
* `watchers`
Comparison
----------
* `compare( base, head )`
* `base`
* `head`
Branches
--------
* `get_branches()`: list of `Branch`
Collaborators
-------------
* `add_to_collaborators( collaborator )`
* `collaborator`: `NamedUser`
* `get_collaborators()`: list of `NamedUser`
* `has_in_collaborators( collaborator )`: bool
* `collaborator`: `NamedUser`
* `remove_from_collaborators( collaborator )`
* `collaborator`: `NamedUser`
Comments
--------
* `get_comment( id )`: `CommitComment`
* `id`
* `get_comments()`: list of `CommitComment`
Commits
-------
* `get_commit( sha )`: `Commit`
* `sha`
* `get_commits( [sha, path] )`: list of `Commit`
* `sha`
* `path`
Contributors
------------
* `get_contributors()`: list of `NamedUser`
Downloads
---------
* `create_download( name, size, [description, content_type] )`: `Download`
* `name`
* `size`
* `description`
* `content_type`
* `get_download( id )`: `Download`
* `id`
* `get_downloads()`: list of `Download`
Events
------
* `get_events()`: list of `Event`
* `get_network_events()`: list of `Event`
Forks
-----
* `get_forks()`: list of `Repository`
Git_blobs
---------
* `create_git_blob( content, encoding )`: `GitBlob`
* `content`
* `encoding`
* `get_git_blob( sha )`: `GitBlob`
* `sha`
Git_commits
-----------
* `create_git_commit( message, tree, parents, [author, committer] )`: `GitCommit`
* `message`
* `tree`
* `parents`
* `author`
* `committer`
* `get_git_commit( sha )`: `GitCommit`
* `sha`
Git_refs
--------
* `create_git_ref( ref, sha )`: `GitRef`
* `ref`
* `sha`
* `get_git_ref( ref )`: `GitRef`
* `ref`
* `get_git_refs()`: list of `GitRef`
Git_tags
--------
* `create_git_tag( tag, message, object, type, [tagger] )`: `GitTag`
* `tag`
* `message`
* `object`
* `type`
* `tagger`
* `get_git_tag( sha )`: `GitTag`
* `sha`
Git_trees
---------
* `create_git_tree( tree, [base_tree] )`: `GitTree`
* `tree`
* `base_tree`
* `get_git_tree( sha, [recursive] )`: `GitTree`
* `sha`
* `recursive`: bool
Hooks
-----
* `create_hook( name, config, [events, active] )`: `Hook`
* `name`
* `config`
* `events`
* `active`
* `get_hook( id )`: `Hook`
* `id`
* `get_hooks()`: list of `Hook`
Issues
------
* `create_issue( title, [body, assignee, milestone, labels] )`: `Issue`
* `title`
* `body`
* `assignee`
* `milestone`
* `labels`
* `get_issue( number )`: `Issue`
* `number`
* `get_issues( [milestone, state, assignee, mentioned, labels, sort, direction, since] )`: list of `Issue`
* `milestone`
* `state`
* `assignee`
* `mentioned`
* `labels`
* `sort`
* `direction`
* `since`
Issues_events
-------------
* `get_issues_event( id )`: `IssueEvent`
* `id`
* `get_issues_events()`: list of `IssueEvent`
Keys
----
* `create_key( title, key )`: `RepositoryKey`
* `title`
* `key`
* `get_key( id )`: `RepositoryKey`
* `id`
* `get_keys()`: list of `RepositoryKey`
Labels
------
* `create_label( name, color )`: `Label`
* `name`
* `color`
* `get_label( name )`: `Label`
* `name`
* `get_labels()`: list of `Label`
Languages
---------
* `get_languages()`
Milestones
----------
* `create_milestone( title, [state, description, due_on] )`: `Milestone`
* `title`
* `state`
* `description`
* `due_on`
* `get_milestone( number )`: `Milestone`
* `number`
* `get_milestones( [state, sort, direction] )`: list of `Milestone`
* `state`
* `sort`
* `direction`
Modification
------------
* `edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads] )`
* `name`
* `description`
* `homepage`
* `public`
* `has_issues`
* `has_wiki`
* `has_downloads`
Pulls
-----
* `create_pull( < title, body, base, head > or < issue, base, head > )`: `PullRequest`
* `get_pull( number )`: `PullRequest`
* `number`
* `get_pulls( [state] )`: list of `PullRequest`
* `state`
Tags
----
* `get_tags()`: list of `Tag`
Teams
-----
* `get_teams()`: list of `Team`
Watchers
--------
* `get_watchers()`: list of `NamedUser`
Class `RepositoryKey`
=====================
Attributes
----------
* `id`
* `key`
* `title`
* `url`
Deletion
--------
* `delete()`
Modification
------------
* `edit( title, key )`
* `title`
* `key`
Class `Tag`
===========
Attributes
----------
* `commit`: `Commit`
* `name`
* `tarball_url`
* `zipball_url`
Class `Team`
============
Attributes
----------
* `id`
* `members_count`
* `name`
* `permission`
* `repos_count`
* `url`
Deletion
--------
* `delete()`
Members
-------
* `add_to_members( member )`
* `member`: `NamedUser`
* `get_members()`: list of `NamedUser`
* `has_in_members( member )`: bool
* `member`: `NamedUser`
* `remove_from_members( member )`
* `member`: `NamedUser`
Modification
------------
* `edit( name, [permission] )`
* `name`
* `permission`
Repos
-----
* `add_to_repos( repo )`
* `repo`: `Repository`
* `get_repos()`: list of `Repository`
* `has_in_repos( repo )`: bool
* `repo`: `Repository`
* `remove_from_repos( repo )`
* `repo`: `Repository`
Class `UserKey`
===============
Attributes
----------
* `id`
* `key`
* `title`
* `url`
Deletion
--------
* `delete()`
Modification
------------
* `edit( [title, key] )`
* `title`
* `key`