mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
40 lines
606 B
ReStructuredText
40 lines
606 B
ReStructuredText
Main Class
|
|
==========
|
|
|
|
This is the main class.
|
|
|
|
Get current user
|
|
----------------
|
|
|
|
.. code-block:: python
|
|
|
|
>>> user = g.get_user()
|
|
>>> user.login
|
|
u'sfdye'
|
|
|
|
Get user by name
|
|
----------------
|
|
|
|
.. code-block:: python
|
|
|
|
>>> user = g.get_user("sfdye")
|
|
>>> user.name
|
|
u'Wan Liuyang'
|
|
|
|
Get repository by name
|
|
----------------------
|
|
|
|
.. code-block:: python
|
|
|
|
>>> repo = g.get_repo("PyGithub/PyGithub")
|
|
>>> repo.name
|
|
u'PyGithub'
|
|
|
|
Get organization by name
|
|
------------------------
|
|
|
|
.. code-block:: python
|
|
|
|
>>> org = g.get_organization("PyGithub")
|
|
>>> org.login
|
|
u'PyGithub' |