{"id":13572300,"url":"https://github.com/dropbox/pygerduty","last_synced_at":"2025-04-04T09:32:15.725Z","repository":{"id":5919616,"uuid":"7139164","full_name":"dropbox/pygerduty","owner":"dropbox","description":"A Python library for PagerDuty.","archived":false,"fork":false,"pushed_at":"2023-05-09T21:42:22.000Z","size":180,"stargazers_count":163,"open_issues_count":9,"forks_count":72,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-12-17T01:03:38.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropbox.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-12-12T22:53:08.000Z","updated_at":"2024-09-10T15:01:19.000Z","dependencies_parsed_at":"2024-06-18T17:12:15.618Z","dependency_job_id":null,"html_url":"https://github.com/dropbox/pygerduty","commit_stats":{"total_commits":144,"total_committers":40,"mean_commits":3.6,"dds":0.7222222222222222,"last_synced_commit":"ef0f6c64737d38bbd1cb709d434595b1e2892d72"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fpygerduty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fpygerduty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fpygerduty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fpygerduty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropbox","download_url":"https://codeload.github.com/dropbox/pygerduty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247153939,"owners_count":20892762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:19.423Z","updated_at":"2025-04-04T09:32:10.713Z","avatar_url":"https://github.com/dropbox.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\n.. image:: https://travis-ci.org/dropbox/pygerduty.svg?branch=master\n    :target: https://travis-ci.org/dropbox/pygerduty\n\n=========\nPygerduty\n=========\n\nPython Library for PagerDuty's REST API and Events API. This library was originally written to support v1 and\nis currently being updated to be compatible with v2 of the API. See \"Migrating from v1 to v2\" for more details.\n\nThis library is currently evolving and backwards compatibility cannot always be guaranteed at this time.\n\n\nInstallation\n============\n\nYou can install with ``pip install pygerduty``.\n\nIf you want to install from source, then ``python setup.py install``.\n\n\nRequirements\n============\n\nTested on Python 2.7, or \u003e= 3.6.\n\nKnown to work on Python 2.6.\n\nDocumentation\n=============\n\nPygerduty is a thin wrapper around PagerDuty's APIs. You will need to refer\nto the the `PagerDuty Documentation \u003chttp://developer.pagerduty.com/\u003e`_ for\nall available parameters to pass and all available attributes on responses.\n\nThe main methods available to resources are list, show, create, update, and\ndelete. Not all resources have endpoints for all of the above methods. Again,\nrefer to the `PagerDuty Documentation \u003chttp://developer.pagerduty.com/\u003e`_ to\nsee all available endpoints.\n\nTop level resources will be accessible via the PagerDuty object and nested\nresources available on containers returned from their parent resource.\n\n\nMigrating from v1 to v2\n=======================\n\nIn order to allow for a smooth transition between versions 1 and 2 of the library,\nversion 1 library remains in the file called `__init__.py` inside of the pygerduty directory.\nAlso in that directory you will see four other files:\n\n- `v2.py` — This file contains all updated logic compatible with v2 of the API.\n- `events.py` — PygerDuty also provides an Events API which is separate from the REST API that has had the recent update. Since the logic is mostly disjoint, we have created a new module for logic related to the Events API.\n- `common.py` — This file contains all common functions used by both `v2.py` and `events.py`.\n- `version.py` — Contains version info.\n\nSee the examples below to see how this affects how you will instantiate a client in v2.\n\n\nExamples\n========\n\nInstantiating a client:\n\nVersion 1:\n\n::\n\n    import pygerduty\n    pager = pygerduty.PagerDuty(\"foobar\", \"SOMEAPIKEY123456\")\n\nVersion 2:\n\n::\n\n    import pygerduty.v2\n    pager = pygerduty.v2.PagerDuty(\"SOMEAPIKEY123456\")\n\nListing a resource:\n\n::\n\n    for schedule in pager.schedules.list():\n        print(schedule.id, schedule.name)\n\n    # PX7F8S3 Primary\n    # PJ48C0S Tertiary\n    # PCJ94SK Secondary\n\nGetting all schedules associated with a user:\n\n::\n\n    user = pager.users.show('PDSKF08')\n    for schedule in user.schedules.list():\n        print(schedule.id, schedule.name)\n\n    # PDSARUD Ops\n    # PTDSKJH Support\n\nGetting a resource by ID:\n\n::\n\n    schedule = pager.schedules.show(\"PX7F8S3\")\n\nCreating a resource:\n\n::\n\n    user = next(pager.users.list(query=\"gary\", limit=1))\n    override = schedule.overrides.create(\n        start=\"2012-12-16\", end=\"2012-12-17\", user_id=user.id)\n\nDelete a resource:\n\n::\n\n    schedule.overrides.delete(override.id)\n\n\nUpdating a resource:\n\n::\n\n    pagerduty.users.update(user.id, name=\"Gary Example\")\n\n\nAcknowledging a group by incidents:\n\n::\n\n    me = next(pager.users.list(query=\"me@you.com\", limit=1))\n    for incident in pagerduty.incidents.list(status='triggered'):\n        incident.acknowledge(requester_id=me.id)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Fpygerduty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropbox%2Fpygerduty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Fpygerduty/lists"}