Skip to content
Asynchronous Slack API integration.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
aslack
docs
examples
tests
.checkignore
.gitignore
.pylintrc
.travis.yml
CONTRIBUTING.md
LICENSE
README.rst
manifest-halliwell.yml
requirements.txt
setup.py

README.rst

aSlack

/əˈslæk/

PyPI Version Travis Build Status Code Coverage Code Issues ISC License

aSlack is a lightweight, asynchronous wrapper for Slack's Web and Real-Time Messaging (RTM) APIs, designed to allow the easy development of Slack tools and bots in Python. It defines two principal components:

  • SlackApi - a wrapper around the Web API; and
  • SlackBot - a messaging bot built on top of the RTM API.

Compatibility

aSlack uses asyncio with the async and await syntax, so is only compatible with Python versions 3.5 and above.

Dependencies

Asynchronous HTTP and WebSocket functionality is provided by aiohttp (version 0.15 and above required for out-of-the-box WebSocket client support).

Documentation

aSlack's documentation is available on PythonHosted.

Installation

aSlack is available through the Python Package Index, PyPI, you can install it with:

pip install aslack

Alternatively, clone or fork the repository and use e.g.:

python setup.py develop

to install locally for development. In this case, you should also install the development dependencies (ideally in a virtualenv) using:

pip install -r requirements.txt

Testing

The test suite can be run using py.test directly or by running:

python setup.py test

in which case pylint will also be run to check the code quality.

Additionally, a demo test for the Halliwell example can be run by setting the environment variable TMDB_API_TOKEN.

Examples

See the /examples directory for examples of the kinds of bots that you can build with aSlack.

Halliwell

Based on both aSlack and aTMDb, Halliwell is a bot that can provide information on movies or actors and find overlaps. Two environment variables, SLACK_API_TOKEN and TMDB_API_TOKEN, are required to run this example, and configuration for easy deployment to Cloud Foundry is provided.

You can’t perform that action at this time.