Slackly - A Slack Toolkit
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 slackly.events and slackly.schema.types in this library to build higher level abstractions on the Slack API
Installing
$ 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 client.api_call('api.test')
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(): print(event)
Using Event Types
import os from slackly import SlackRTMClient, SlackEventParsed from slackly.events 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") else: print("I don't care about this event")
Development
$ git clone https://github.com/huntcsg/slackly.git $ cd slackly $ tox # Runs test suites against all python versions, pypy, does style and test coverage analysis
All pull requests must pass the travis-ci builds
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.
If integration or regression test coverage is needed, let the project maintainer know and we can work out the best way to do so.
Changes
1.0.4
Documentation Updates and Release stability
1.0.0
Initial Release
Metadata
Release files for slackly 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| slackly-1.0.7.tar.gz | 69.0 kB | Without provenance | Details for slackly-1.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| slackly-1.0.7-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for slackly-1.0.7-py2.py3-none-any.whl |
Total release size: 184.4 kB
Release files / slackly-1.0.7.tar.gz
| Download URL | slackly-1.0.7.tar.gz |
|---|---|
| Size | 69.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40818bd847be4e4f42548321bcaa29ff89f1b716a075a6aa86b1e1bb84fbd97b
|
|
BLAKE2b-256 checksum How to use checksums |
9f643ec05915e7e95ed50962e5f189f9ebd4a1f8a73c5e7e443c19b9b75bc4ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / slackly-1.0.7-py2.py3-none-any.whl
| Download URL | slackly-1.0.7-py2.py3-none-any.whl |
|---|---|
| Size | 115.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6694c063b09381b7cc2fa8e31fcc89a2edf6ab2bc015d82905b0e9d1d199cc7f
|
|
BLAKE2b-256 checksum How to use checksums |
61b823a404e8974f7bfdec75ca037bec1f0427a85451750b20337f96d39dfba2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for slackly 1.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.