Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Utility library for serverless Slack apps

PyPI

This is a (currently very simple) library that eases development of serverless Slack app and bots.

Currently, it targets Google Cloud Platform (but is easily generalised), and provides a decorator and some utility functions that make Slack signature verification automatic and help with building responses in a very lightweight fashion.

I will grow it with things I end up needing in my work, but if you have different needs and want to extend the library to support them, then PRs would be gratefully received!

MVP Example

This will accept any slash command you've configured for your bot, and just greet the user who calls it, tagging them in the reply.

from slack_serverless import slack_slash_command_gcp
from slack_messaging import slack_in_channel_text_response, slack_tags

@slack_slash_command_gcp(slack_signing_key=YOUR_SIGNING_KEY)
def command_handler(payload):
    return slack_in_channel_text_response(f"Hi there <@{slack_tags([payload['user_id']])}>")

Other Cloud Providers

Things will be a bit more manual here (but I'll happily add comfort wrappers if there's enough call and a PR that contributes them 😉).

The easiest thing to do is use the slack_slash_command decorator, which is similar to the gcp one above but needs you pass in a couple of Callables the code will use to get access to the data in a provider-specific way.

Take a look at the code in slack_serverless.py for examples to get you started.

Developing

Don't forget to set up pre-commit if you're developing things, especially if you plan to push a PR.

Legal Mumbo-Jumbo

Copyright (c)2023 Ross Bamford (and contributors)

License: MIT (see LICENSE.md for details).

Metadata

Release files for slack-serverless 2023.1005a0

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

Source distribution (sdist)

Source distribution for slack-serverless 2023.1005a0
File Size Uploaded Provenance
slack-serverless-2023.1005a0.tar.gz 6.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for slack-serverless 2023.1005a0
File Interpreter ABI Platform
slack_serverless-2023.1005a0-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / slack-serverless-2023.1005a0.tar.gz

Download URL slack-serverless-2023.1005a0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7ef27394ea2e2cf59f8d6de85d4ce89c13ed934c5c0fdb88e6feb946c3871778
BLAKE2b-256 checksum
How to use checksums
8e48e08ddb747046a55e3338f8c9470dac893e7a1dc59a08223f2d96da1de689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / slack_serverless-2023.1005a0-py3-none-any.whl

Download URL slack_serverless-2023.1005a0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ad936b034458a125a9d695502aa47a69a4c381b3c886041bb5add4acdaa25ac
BLAKE2b-256 checksum
How to use checksums
c61f9cd0f254e1af5789421f25e8d76853a5290e23a5425c5b07f9e446a063a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Security for slack-serverless 2023.1005a0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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