{ "info": { "author": "David Wallace", "author_email": "david.wallace@goodeggs.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development" ], "description": "# tap-pagerduty\n[![PyPI version](https://badge.fury.io/py/tap-pagerduty.svg)](https://badge.fury.io/py/tap-pagerduty)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Python Versions](https://img.shields.io/badge/python-3.6%20%7C%203.7-blue.svg)](https://pypi.python.org/pypi/ansicolortags/)\n[![Build Status](https://travis-ci.com/goodeggs/tap-pagerduty.svg?branch=master)](https://travis-ci.com/goodeggs/tap-pagerduty)\n\nA [Singer](https://www.singer.io/) tap for extracting data from the [Pagerduty REST API v2](https://v2.developer.pagerduty.com/docs/rest-api).\n\n## Installation\n\nSince package dependencies tend to conflict between various taps and targets, Singer [recommends](https://github.com/singer-io/getting-started/blob/master/docs/RUNNING_AND_DEVELOPING.md#running-singer-with-python) installing taps and targets into their own isolated virtual environments:\n\n### Install Pagerduty Tap\n\n```bash\n$ cd tap-pagerduty\n$ python3 -m venv ~/.venvs/tap-pagerduty\n$ source ~/.venvs/tap-pagerduty/bin/activate\n$ pip3 install tap-pagerduty\n$ deactivate\n```\n\n### Install Singer Target\n\n```bash\n$ python3 -m venv ~/.venvs/target-stitch\n$ source ~/.venvs/target-stitch/bin/activate\n$ pip3 install target-stitch\n$ deactivate\n```\n\n## Configuration\n\nThe tap accepts a JSON-formatted configuration file as arguments. This configuration file has three required fields:\n\n1. `token`: A valid [Pagerduty REST API key](https://support.pagerduty.com/docs/generating-api-keys).\n2. `email`: A valid email address to be inserted into the `From` header of the [HTTP Request headers](https://v2.developer.pagerduty.com/docs/rest-api#http-request-headers)\n3. `since` A date to be used as the default `since` parameter for all API endpoints that support that parameter.\n\nAn bare-bones Pagerduty confirguration may file may look like the following:\n\n```json\n{\n \"token\": \"foobarfoobar\",\n \"email\": \"foo.bar@gmail.com\",\n \"since\": \"2019-01-01\"\n}\n```\n\nAdditionally, you may specify more granular configurations for individual streams. Each key under a stream should represent a valid API request parameter for that endpoint. A more fleshed-out configuration file may look similar to the following:\n\n```json\n{\n \"token\": \"foobarfoobar\",\n \"email\": \"foo.bar@gmail.com\",\n \"since\": \"2019-08-01\",\n \"streams\": {\n \"incidents\": {\n \"since\": \"last_status_change_at>=2019-08-01\",\n \"sort_by\": \"created_at:asc\"\n }\n }\n}\n```\n\n## Streams\n\nThe current version of the tap syncs three distinct [Streams](https://github.com/singer-io/getting-started/blob/master/docs/SYNC_MODE.md#streams):\n1. `Incidents`: ([Endpoint](https://api-reference.pagerduty.com/#!/Incidents/get_incidents), [Schema](https://github.com/goodeggs/tap-pagerduty/blob/master/tap_pagerduty/schemas/incidents.json))\n2. `Notifications`: ([Endpoint](https://api-reference.pagerduty.com/#!/Notifications/get_notifications), [Schema](https://github.com/goodeggs/tap-pagerduty/blob/master/tap_pagerduty/schemas/notifications.json))\n3. `Services`: ([Endpoint](https://api-reference.pagerduty.com/#!/Services/get_services), [Schema](https://github.com/goodeggs/tap-pagerduty/blob/master/tap_pagerduty/schemas/services.json))\n\n## Discovery\n\nSinger taps describe the data that a stream supports via a [Discovery](https://github.com/singer-io/getting-started/blob/master/docs/DISCOVERY_MODE.md#discovery-mode) process. You can run the Pagerduty tap in Discovery mode by passing the `--discover` flag at runtime:\n\n```bash\n$ ~/.venvs/tap-pagerduty/bin/tap-pagerduty --config=config/pagerduty.config.json --discover\n```\n\nThe tap will generate a [Catalog](https://github.com/singer-io/getting-started/blob/master/docs/DISCOVERY_MODE.md#the-catalog) to stdout. To pass the Catalog to a file instead, simply redirect it to a file:\n\n```bash\n$ ~/.venvs/tap-pagerduty/bin/tap-pagerduty --config=config/pagerduty.config.json --discover > catalog.json\n```\n\n## Sync Locally\n\nRunning a tap in [Sync mode](https://github.com/singer-io/getting-started/blob/master/docs/SYNC_MODE.md#sync-mode) will extract data from the various Streams. In order to run a tap in Sync mode, pass a configuration file and catalog file:\n\n```bash\n$ ~/.venvs/tap-pagerduty/bin/tap-pagerduty --config=config/pagerduty.config.json --catalog=catalog.json\n```\n\nThe tap will emit occasional [State messages](https://github.com/singer-io/getting-started/blob/master/docs/SPEC.md#state-message). You can persist State between runs by redirecting State to a file:\n\n```bash\n$ ~/.venvs/tap-pagerduty/bin/tap-pagerduty --config=config/pagerduty.config.json --catalog=catalog.json >> state.json\n$ tail -1 state.json > state.json.tmp\n$ mv state.json.tmp state.json\n```\n\nTo pick up from where the tap left off on subsequent runs, simply supply the [State file](https://github.com/singer-io/getting-started/blob/master/docs/CONFIG_AND_STATE.md#state-file) at runtime:\n\n```bash\n$ ~/.venvs/tap-pagerduty/bin/tap-pagerduty --config=config/pagerduty.config.json --catalog=catalog.json --state=state.json >> state.json\n$ tail -1 state.json > state.json.tmp\n$ mv state.json.tmp state.json\n```\n\n## Sync to Stitch\n\nYou can also send the output of the tap to [Stitch Data](https://www.stitchdata.com/) for loading into the data warehouse. To do this, first create a JSON-formatted configuration for Stitch. This configuration file has two required fields:\n1. `client_id`: The ID associated with the Stitch Data account you'll be sending data to.\n2. `token` The token associated with the specific [Import API integration](https://www.stitchdata.com/docs/integrations/import-api/) within the Stitch Data account.\n\nAn example configuration file will look as follows:\n\n```json\n{\n \"client_id\": 1234,\n \"token\": \"foobarfoobar\"\n}\n```\n\nOnce the configuration file is created, simply pipe the output of the tap to the Stitch Data target and supply the target with the newly created configuration file:\n\n```bash\n$ ~/.venvs/tap-pagerduty/bin/tap-pagerduty --config=config/pagerduty.config.json --catalog=catalog.json --state=state.json | ~/.venvs/target-stitch/bin/target-stitch --config=config/stitch.config.json >> state.json\n$ tail -1 state.json > state.json.tmp\n$ mv state.json.tmp state.json\n```\n\n## Contributing\n\nThe first step to contributing is getting a copy of the source code. First, [fork `tap-pagerduty` on GitHub](https://github.com/goodeggs/tap-pagerduty/fork). Then, `cd` into the directory where you want your copy of the source code to live and clone the source code:\n\n```bash\n$ git clone git@github.com:YourGitHubName/tap-pagerduty.git\n```\n\nNow that you have a copy of the source code on your local machine, you can leverage [Pipenv](https://docs.pipenv.org/en/latest/) and the corresponding `Pipfile` to install of the development dependencies within a virtual environment:\n\n```bash\n$ pipenv install --three --dev\n```\n\nThis command will create an isolated virtual environment for your `tap-pagerduty` project and install all the development dependencies defined within the `Pipfile` inside of the environment. You can then enter a shell within the environment:\n\n```bash\n$ pipenv shell\n```\n\nAlternatively, you can run individual commands within the environment without entering the shell:\n\n```bash\n$ pipenv run \n```\n\nFor example, to format your code using [isort](https://github.com/timothycrosley/isort) and [flake8](http://flake8.pycqa.org/en/latest/index.html) before commiting changes, run the following commands:\n\n```bash\n$ pipenv run make isort\n$ pipenv run make flake8\n```\n\nYou can also run the entire testing suite before committing using [tox](https://tox.readthedocs.io/en/latest/):\n\n```bash\n$ pipenv run tox\n```\n\nFinally, you can run your local version of the tap within the virtual environment using a command like the following:\n\n```bash\n$ pipenv run tap-pagerduty --config=config/pagerduty.config.json --catalog=catalog.json\n```\n\nOnce you've confirmed that your changes work and the testing suite passes, feel free to put out a PR!\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/goodeggs/tap-pagerduty", "keywords": "singer tap python pagerduty", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "tap-pagerduty", "package_url": "https://pypi.org/project/tap-pagerduty/", "platform": "", "project_url": "https://pypi.org/project/tap-pagerduty/", "project_urls": { "Homepage": "https://github.com/goodeggs/tap-pagerduty" }, "release_url": "https://pypi.org/project/tap-pagerduty/0.1.0rc2/", "requires_dist": [ "requests (==2.22.0)", "singer-python (==5.7.0)" ], "requires_python": ">=3.6", "summary": "Singer.io tap for extracting data from Pagerduty v2 API", "version": "0.1.0rc2" }, "last_serial": 5780990, "releases": { "0.1.0rc1": [ { "comment_text": "", "digests": { "md5": "a40eb298a32b16f6c08bfbcd6284a325", "sha256": "e099371742f5af408286a9328f9c35c1ea7d1bc9e147d16efb879a41db86decc" }, "downloads": -1, "filename": "tap_pagerduty-0.1.0rc1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a40eb298a32b16f6c08bfbcd6284a325", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 21745, "upload_time": "2019-08-30T18:04:24", "url": "https://files.pythonhosted.org/packages/48/21/85eefd451a2b537b027e10df79a2d59a7d303c4a6e5d1735fd4ab6424bfe/tap_pagerduty-0.1.0rc1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35e28e19408f01377578b9be54a0c9b4", "sha256": "67d8664db8832cef6d431e89c130190045b8af76cde760ffddbaff8d4f61163f" }, "downloads": -1, "filename": "tap_pagerduty-0.1.0rc1.tar.gz", "has_sig": false, "md5_digest": "35e28e19408f01377578b9be54a0c9b4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10757, "upload_time": "2019-08-30T18:04:26", "url": "https://files.pythonhosted.org/packages/40/40/59f544c2b17b6d73b2e5e0d1b83ec1871c544640dc7e10ee163d44692a39/tap_pagerduty-0.1.0rc1.tar.gz" } ], "0.1.0rc2": [ { "comment_text": "", "digests": { "md5": "7122ed5f4a9eb8c956e5ecba43b4ab5a", "sha256": "3ba193ec9df3391788ab8380fc20f119428b80d48a514b51c26ee8257741b3ac" }, "downloads": -1, "filename": "tap_pagerduty-0.1.0rc2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7122ed5f4a9eb8c956e5ecba43b4ab5a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 22337, "upload_time": "2019-09-04T12:38:11", "url": "https://files.pythonhosted.org/packages/91/9f/4cf5a54f83c400464fe9c20c6c3e00b8beb4b6f135c6ebbbaff6122cebe5/tap_pagerduty-0.1.0rc2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a6da0f462d99908df1eca5c5b4bb328", "sha256": "ea78775c99f8fa956ec3778c894bf6dc3808394423170079359780168c583d93" }, "downloads": -1, "filename": "tap_pagerduty-0.1.0rc2.tar.gz", "has_sig": false, "md5_digest": "0a6da0f462d99908df1eca5c5b4bb328", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11446, "upload_time": "2019-09-04T12:38:12", "url": "https://files.pythonhosted.org/packages/48/21/64eca6b9f8a6ce6b405a78dc0dc289fb1093943855a8a14d3f3ddb3108e4/tap_pagerduty-0.1.0rc2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7122ed5f4a9eb8c956e5ecba43b4ab5a", "sha256": "3ba193ec9df3391788ab8380fc20f119428b80d48a514b51c26ee8257741b3ac" }, "downloads": -1, "filename": "tap_pagerduty-0.1.0rc2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7122ed5f4a9eb8c956e5ecba43b4ab5a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 22337, "upload_time": "2019-09-04T12:38:11", "url": "https://files.pythonhosted.org/packages/91/9f/4cf5a54f83c400464fe9c20c6c3e00b8beb4b6f135c6ebbbaff6122cebe5/tap_pagerduty-0.1.0rc2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a6da0f462d99908df1eca5c5b4bb328", "sha256": "ea78775c99f8fa956ec3778c894bf6dc3808394423170079359780168c583d93" }, "downloads": -1, "filename": "tap_pagerduty-0.1.0rc2.tar.gz", "has_sig": false, "md5_digest": "0a6da0f462d99908df1eca5c5b4bb328", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11446, "upload_time": "2019-09-04T12:38:12", "url": "https://files.pythonhosted.org/packages/48/21/64eca6b9f8a6ce6b405a78dc0dc289fb1093943855a8a14d3f3ddb3108e4/tap_pagerduty-0.1.0rc2.tar.gz" } ] }