Skip to main content

(a)sync Slack API library

Project description

Python (a)sync Slack API library

Documentation Status Travis-ci status PyPI status Coverage status

Installation

Slack-sansio is available on PyPI.

$ pip3 install slack-sansio  # No specific implementation requirements
$ pip3 install slack-sansio[requests]   # Requests implementation requirements
$ pip3 install slack-sansio[aiohttp]    # Aiohttp implementation requirements
$ pip3 install slack-sansio[curio]      # Curio implementation requirements
$ pip3 install slack-sansio[trio]       # Trio implementation requirements
$ pip3 install slack-sansio[treq]       # Treq implementation requirements
$ pip3 install slack-sansio[full]       # All implementations requirements

Quickstart

import slack
import pprint
import requests

from slack.io.sync import SlackAPI

session = requests.session()
slack_client = SlackAPI(token=TOKEN, session=session)
data = client.query(slack.methods.AUTH_TEST)
pprint.pprint(data)

For more examples see the examples folder.

I/O Implementations

Most people would want to use one of these implementations directly. For those that have an HTTP library which is not supported this library provide the base tools to ease the use of the Slack API.

The library also provide an abstract base class on which to built I/O implementation.

Changelog

0.5.0 ` * Support for new slack request signing (``sansio.validate_request_signature and exceptions.InvalidSlackSignature)

0.4.2

  • Support incoming action of type message_action

0.4.1

  • Support incoming action of type dialog_submission.

0.4.0

  • Support sending json for selected slack methods.

0.3.5

  • Add subtype argument to events.MessageRouter.register.

  • Fix routing bug for message with text=None.

0.3.4

  • Refactor tests

  • Create pytest plugin with useful fixtures.

0.3.3

  • Add minimum_time argument to SlackAPI.iter in order to force a minimum elapsed time between two call to the API

0.3.2

  • Add conversation & dialog methods in Enum.

  • Fix not_authed when using rate limit retry.

0.3.1

  • Bugfix for actions.Action and actions.Router.

  • Bugfix in data serialization for response urls https://hooks.slack.com/.

0.3.0

  • Bugfix for commands.Router.

  • New events.MessageRouter for events.Message routing based on regular expression.

  • Rename events.Router to events.EventRouter.

  • Change TypeError to ValueError in events.EventRouter.register.

  • Bugfix for threaded messages.

0.2.2

  • Fix routing bug in events.Router.

  • Inherit from Exception instead of BaseExecption in custom exceptions.

0.2.1

  • Curio support (query and iterate)

  • Trio support (query and iterate)

  • Twisted support (query only)

0.2.0

  • Enum of slack API methods

0.1.0

  • Initial beta release

  • RTM API

  • Pagination

0.0.1

  • Initial development release

Project details


Download files

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

Source Distribution

slack-sansio-0.5.0.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slack_sansio-0.5.0-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file slack-sansio-0.5.0.tar.gz.

File metadata

  • Download URL: slack-sansio-0.5.0.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for slack-sansio-0.5.0.tar.gz
Algorithm Hash digest
SHA256 58f398d338b1fd87486d08c2a0cf170951c96574ab6b03bf7b59b29c974da527
MD5 31ce8fe07507b088b7dfde38c8733066
BLAKE2b-256 b01c515e14ed1916d7e8ec35ca50f5957b0f530c2d946ad04b5464a05fc747d8

See more details on using hashes here.

File details

Details for the file slack_sansio-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: slack_sansio-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for slack_sansio-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1391184a27d618d63a0b542e507274731cf242701e288b574d4a249106a43ef8
MD5 c39d3b3b7e565da02366bcd0fc967bf1
BLAKE2b-256 a5cf87bbd4053cd8b6a6c6c9a3a3e0bb3c34abb28e43f971a419ab7ebde5e792

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page