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/events.rst at master · Kagami/python-github3

Expand file tree

/

events.rst

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
150 lines (92 loc) · 3.16 KB
/

events.rst

Copy path

File metadata and controls

150 lines (92 loc) · 3.16 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Events service

This service exposes the `Events API`_. Much of this API is read-only, and while pagination is supported, there is a fixed page size of 30 with a limit of 10 page requests.

Many events have an actor which denotes the user that performed an event. Additionally, there may be org or repo attributes for events related to Organizations and Repos. Finally, each event object contains a payload attribute containing more detailed information about the event.

Public Events

Yields the most recent public events from Github.

from pygithub3 import Github

gh = Github()

events = gh.events.list().all()
print events[0].payload

Event

.. autoclass:: pygithub3.services.events.Event
    :members:

    .. attribute:: issues

        :ref:`Issues events <Issues events service>`

    .. attribute:: networks

        :ref:`Events network service`

    .. attribute:: orgs

        :ref:`Events org service`

    .. attribute:: repos

        :ref:`Events repo service`

    .. attribute:: users

        :ref:`Events user service`

Repo Events

These are events for a specific repo, including issue and network events. The Issues events are proxied to the :ref:`Issues service`.

events = gh.events.repos.list(user="copitux", repo="python-github3")
for e in events.next():
    print("{t}".format(t=e.type))

# Get the issue Events
events = gh.events.issues.list_by_repo(user="copitux",
                                       repo="python-github3")

# Get the Public Events for a Repo's Network
events = gh.events.networks.list(user="copitux", repo="python-github3")

Network

.. autoclass:: pygithub3.services.events.networks.Network
    :members:


Repo

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


Organization Events

These are the public events for an Organization

events = gh.events.orgs.list(org="Acme")

You may also get a user's feed of events for an Organization, but you must be authenticated as the provided user, and you must be a member of the given organization.

events = gh.events.users.orgs(user="copitux", org="acme")

Org

.. autoclass:: pygithub3.services.events.orgs.Org
    :members:

User Events

You can retrieve the public events performed by a user and the public events that a user receives. If you're authenticated, you may also receive private events.

received_events = gh.events.users.list_received_public(user="copitux")
performed_events = gh.events.users.list_performed_public(user="copitux")

If authenticated as copitux, you could get private events with the following, otherwise you'll just get the public events as above:

received_events = gh.events.users.list_received(user="copitux")
performed_events = gh.events.users.list_performed(user="copitux")

User

.. autoclass:: pygithub3.services.events.users.User
    :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.