A toolbelt for working with the various Slack APIs in python.
Install slacktools with PyPI
pip install slacktoolsThis library is tested against Python 3.4+. Open an issue if you need this library to work on an older version.
- Authorization utils to verify
X-Slack-Signature - Message text utils to do things like:
- Format slack control sequences like
<@USERIDXX>and<text|url>with proper escaping - Extract mentions and grab user ids from mentions
- Properly escape message text
- Format slack control sequences like
- Message sending functions with partial application to reduce boilerplate and improve testability
- Silly stuff
Check out the docs for more info and API documentation.
Running the tests is simple enough:
python setup.py testOr just pytest will do the trick. This will run the tests in the tests/
directory as well as as bunch of docstring tests in the src/ directory.
The Makefile also has some good test commands that will spin up a docker container:
make testwill run the tests in python 3.7.make test-allwill run a series of tests from python 3.7 down to 3.4.make test-{{PY_VERSION}}wherePY_VERSIONcan be any tagged version of the official python docker image will run tests under that python version. Ex:make test-3.5will run under Python 3.5.
- Wider python support? This lib only supports python 3 right now. However, if someone needs it, I can add python 2 compatibility.
- Friendly message builder API?
- Build deep links into clients
austinpray/kizuna is a silly chatbot that uses this library.