Skip to main content

Slack API client

Project description

build status pylint

About

Slackest is a full-featured Python interface for the Slack API.

Examples

from slackest import Slackest

slack = Slackest('<your-slack-api-token-goes-here>')

# Send a message to #general channel
slack.conversation.post_message('#general', 'Hello fellow slackers!')

# Get users list
response = slack.users.list()
users = response.body['members']

# Upload a file
slack.files.upload('hello.txt')

# If you need to proxy the requests
proxy_endpoint = 'http://myproxy:3128'
slack = Slackest('<your-slack-api-token-goes-here>',
                http_proxy=proxy_endpoint,
                https_proxy=proxy_endpoint)

# Advanced: Use `request.Session` for connection pooling (reuse)
from requests.sessions import Session
with Session() as session:
    slack = Slackest(token, session=session)
    slack.conversation.post_message('#general', 'All these requests')
    slack.conversation.post_message('#general', 'go through')
    slack.conversation.post_message('#general', 'a single https connection')

Installation

$ pip install slackest

CICD

This project uses AWS CodeBuild to build. CodeBuild uses a YAML-based file called builspec.yml that runs the appropriate commands.

A wheel and a source distribution is provided according to the buildspec.

Building Locally

For local build testing, use the local CodeBuild image. See this AWS blog post <https://aws.amazon.com/blogs/devops/announcing-local-build-support-for-aws-codebuild/> for more details.

$ git clone https://github.com/aws/aws-codebuild-docker-images.git
$ cd aws-codebuild-docker-images/ubuntu/python/3.7.1
$ docker build -t aws/codebuild/python:3.7.1 .
$ docker pull amazon/aws-codebuild-local:latest --disable-content-trust=false
$ wget https://raw.githubusercontent.com/aws/aws-codebuild-docker-images/master/local_builds/codebuild_build.sh && chmod +x codebuild_build.sh
$ ./codebuild_build.sh -i aws/codebuild/python:3.7.1 -a /tmp/codebuild/

Documentation

Slack API

https://api.slack.com/methods

Slackest

Coming soon!

TODO

  • Test completion, full coverage

  • Documentation on RTD

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

slackest-0.13.1.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

slackest-0.13.1-py2.py3-none-any.whl (16.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file slackest-0.13.1.tar.gz.

File metadata

  • Download URL: slackest-0.13.1.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for slackest-0.13.1.tar.gz
Algorithm Hash digest
SHA256 6d0002c2d7711f78a5030b0820fa94159aa841f2c28c687054830583165408b4
MD5 17b08f7f8ca3c2bb4f77f7872e8e6471
BLAKE2b-256 344affd3623f07ac6bf80ce2d60e345e397eefe62d40d793732925c8e650f13e

See more details on using hashes here.

File details

Details for the file slackest-0.13.1-py2.py3-none-any.whl.

File metadata

  • Download URL: slackest-0.13.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for slackest-0.13.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a686d4a6cff38f85d8b2b48d38966d2366ae7cd0344420fdea649291f6460ec4
MD5 426f7404353ea1276cf5f59fef060d9e
BLAKE2b-256 51bd452dafd53d2fdc7ac5c83c92f314cb9e5dd360703bb7da322f556beab7ba

See more details on using hashes here.

Supported by

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