Files
PyGithub/doc/examples/PullRequest.rst
T
Aaron L. Levine cc9636af3f Add Pull Request Examples (#875)
Per @sfdye request, here is an example to acquire Pull Requests.
2018-08-23 09:06:02 +08:00

28 lines
566 B
ReStructuredText

PullRequest
===========
Get Pull Request by Number
---------------------------
.. code-block:: python
>>> repo = g.get_repo("PyGithub/PyGithub")
>>> pr = repo.get_pull(664)
>>> pr
PullRequest(title="Use 'requests' instead of 'httplib'", number=664)
Get Pull Requests by Query
--------------------------
.. code-block:: python
>>> repo = g.get_repo("PyGithub/PyGithub")
>>> pulls = repo.get_pulls(state='open', sort='created', base='master')
>>> for pr in pulls:
... print(pr.number)
...
400
861
875
876