Skip to content

Commit

Permalink
Add examples for searching repositories (PyGithub#874) (PyGithub#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalsodani authored and candrikos committed Sep 25, 2020
1 parent 8eff8fb commit 6691059
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion doc/examples/MainClass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,35 @@ Get organization by name
>>> org = g.get_organization("PyGithub")
>>> org.login
u'PyGithub'
u'PyGithub'
Search repositories by language
-------------------------------

.. code-block:: python
>>> repositories = g.search_repositories(query='language:python')
>>> for repo in repositories:
... print(repo)
...
Repository(full_name="vinta/awesome-python")
Repository(full_name="donnemartin/system-design-primer")
Repository(full_name="toddmotto/public-apis")
Repository(full_name="rg3/youtube-dl")
Repository(full_name="tensorflow/models")
Repository(full_name="django/django")
Search repositories based on number of issues with good-first-issue
-------------------------------------------------------------------

.. code-block:: python
>>> repositories = g.search_repositories(query='good-first-issues:>3')
>>> for repo in repositories:
... print(repo)
...
Repository(full_name="vuejs/vue")
Repository(full_name="facebook/react")
Repository(full_name="facebook/react-native")
Repository(full_name="electron/electron")
Repository(full_name="Microsoft/vscode")

0 comments on commit 6691059

Please sign in to comment.