Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

nabetama/slacky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wercker status

slacky

A Python package for Slack's JSON REST API.

Installation

pip install slacky

Examples

from slacky import Slacky

slack = Slacky(token='<Your slack api token>')

# Send a message to #general channel.
slack.chat.post_message('#general', 'Hello from slacky')
# '#' is not necessary with channel name.
slack.chat.post_message('general', 'Hello from slacky')

# If you want a JSON result.
print slack.chat.post_message('general', 'Hello from slacky').json()
> => {u'ok': True,  u'ts': u'1234567890.000001',  u'channel': u'XXXXXXXXX'}

# Get timeline at 'general' channel.
for msg in slacky.timeline(channel_name='general', count=4):
    print(msg)

# Create a channel where name is "slackers".
slack.channels.create('slackers')

# Create a private group.
slack.groups.create('slackers')

# Get users list.
slack.users.list.json()['members']

# Get user info.
slack.users.get_info_by_name('nabetama')

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

About

A Python package for Slack's JSON REST API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages