GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-github3/docs/repos.rst at master · JeremyMarshall/python-github3

Expand file tree

/

repos.rst

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
146 lines (90 loc) · 3.03 KB
/

repos.rst

Copy path

File metadata and controls

146 lines (90 loc) · 3.03 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Repos services

Fast sample:

from pygithub3 import Github

gh = Github()

django_compressor = gh.repos.get(user='jezdez', repo='django_compressor')
requests_collaborators = gh.repos.collaborators(user='kennethreitz',
    repo='requests')

Config precedence

Some request always need user and repo parameters, both, to identify a repository. Because there are a lot of requests which need that parameters, you can :ref:`config each service` with user and repo globally.

So several requests follow a simple precedence user_in_arg > user_in_config | repo_in_arg > repo_in_config

You can see it better with an example:

from pygithub3 import Github

gh = Github(user='octocat', repo='oct_repo')
oct_repo = gh.repos.get()
another_repo_from_octocat = gh.repos.get(repo='another_repo')

django_compressor = gh.repos.get(user='jezdez', repo='django_compressor')

Note

Remember that each service is isolated from the rest

# continue example...
gh.repos.commits.set_user('copitux')
oct_repo = gh.repos.get()
oct_repo_collaborators = gh.repos.collaborators.list().all()

# Fail because copitux/oct_repo doesn't exist
gh.repos.commits.list_comments()

Repo

.. autoclass:: pygithub3.services.repos.Repo
    :members:

    .. attribute:: collaborators

        :ref:`Collaborators service`

    .. attribute:: commits

        :ref:`Commits service`

    .. attribute:: downloads

        :ref:`Downloads service`

    .. attribute:: forks

        :ref:`Forks service`

    .. attribute:: keys

        :ref:`RepoKeys service`

    .. attribute:: watchers

        :ref:`Watchers service`

Collaborators

.. autoclass:: pygithub3.services.repos.Collaborators
    :members:

Commits

.. autoclass:: pygithub3.services.repos.Commits
    :members:

Downloads

.. autoclass:: pygithub3.services.repos.Downloads
    :members:


Forks

.. autoclass:: pygithub3.services.repos.Forks
    :members:


Keys

.. autoclass:: pygithub3.services.repos.Keys
    :members:


Watchers

.. autoclass:: pygithub3.services.repos.Watchers
    :members:

Hooks

.. autoclass:: pygithub3.services.repos.Hooks
    :members:

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.