Skip to main content

A full featured python Slack API SDK

Project description

Slackly - A Slack Toolkit

gitter travis pypi docs

Use Cases:

  • Use the slackly.SlackClient to make calls to the Web API
  • Use the slackly.SlackRTMClient to listen to the Real Time Messaging API (via a websocket connection)
  • Use the and slackly.schema.types in this library to build higher level abstractions on the Slack API


This library is very much in alpha and under very active development to flesh out the API. I’ll do my best to not make breaking changes, and hide most of these changes behind feature toggles that can become default in future versions. I want users and feedback, so I will do my utmost to make usage of this library as safe as can be.


$ pip install slackly

Simple Examples

Creating a Client and Making an API Call

from slackly import SlackClient
import os

client = SlackClient(token=os.environ['SLACK_TOKEN'])

# Call the api.test endpoint

Creating the API object and preparing a call

from slackly import SlackAPI, SlackClient
import os
slack = SlackAPI()

# Prepare an api call. Pass "api_call" a client to get actually make the call
api_call = slack.api.test()

client = SlackClient(token=os.environ['SLACK_TOKEN'])
result = api_call(client)

Printing Events off of the Real Time Messaging API

import os
from slackly import SlackRTMClient

rtm_client = SlackRTMClient.from_token(token=os.environ['SLACK_TOKEN'])
for event in rtm_client.get_events_forever():

Using Event Types

import os
from slackly import SlackRTMClient, SlackEventParsed
from import Message, UserTyping
rtm_client = SlackRTMClient.from_token(token=os.environ['SLACK_TOKEN'])
rtm_client.event_factory = SlackEventParsed  # Tell the RTM client to make events using this class

for event in rtm_client.get_events_forever():
    if isinstance(event, Message):
        print("We're dealing with a message")

    elif isinstance(event, UserTyping):
        print("Someone's typing")

        print("I don't care about this event")


$ git clone
$ cd slackly
$ tox    # Runs test suites against all python versions, pypy, does style and test coverage analysis
  1. All pull requests must pass the travis-ci builds
  2. All pull requests should include inline (docstring) documentation, updates to built documentation if applicable, and test coverage. This project aspires to be a 100% test coverage library.
  3. If integration or regression test coverage is needed, let the project maintainer know and we can work out the best way to do so.



  • Documentation Updates and Release stability


  • Initial Release


Hunter Senft-Grupp

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for slackly, version 1.0.7
Filename, size File type Python version Upload date Hashes
Filename, size slackly-1.0.7-py2.py3-none-any.whl (115.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size slackly-1.0.7.tar.gz (69.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page