Skip to main content

pd2Slack

PyPI version

This python project will automatically sync on call PagerDuty services to Slack User Groups.

For example if you have an on call schedule such as:

It will automatically create a slack user group as follows

With "Sidhartha Premkumar" as the sole member of @backend-oncall.

The mapping is done via email matching, this assumes the pager duty email matches the slack email.

Running

To run, all you have to do is:

> pip3 install pd2slack
> pd2slack -slackApiKey {SLACK_API_KEY} -pdApiKey {PD_API_KEY} -config {PATH_TO_CONFIG}

We also support environment variable, for example:

> export SLACK_API_KEY=123
> export PD_API_KEY=123
> pd2Slack

Deploying

You can deploy this program by running the process pd2Slack on a schedule (based on how often you want to update). A cron might be the best way to deploy

Slack token permissions: You will need the following permissions on your slack token:

  • users:read.email
  • users:read
  • usergroups:write
  • usergroups:read

Custom Slack UserGroup Name

You can optionally pass -configPath to the command that points to a config (see exampleConfig.json). This mapping will be used to only sync PagerDuty schedules with the name as a key in serviceMapping with the slackGroup that is the corresponding value.

In the example config we will only attempt to sync pager duty schedules with the name Backend Pd Name with the slack alias @slackAliasToUse-oncall.

Metadata

Release files for pd2slack 0.66

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pd2slack 0.66
File Size Uploaded Provenance
pd2slack-0.66.tar.gz 256.1 kB Without provenance Details

Release files / pd2slack-0.66.tar.gz

Download URL pd2slack-0.66.tar.gz
Size 256.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e7a35f93b79c378c0f47ecfe0953e628f7e1b8e144f560280cf6b192986f42ef
BLAKE2b-256 checksum
How to use checksums
51fc01529d07e0a4cbd549fa5edf2a014084d42685aeaf0690e2e7628cafd725
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Security for pd2slack 0.66

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page