Skip to main content

A Simple and Human Friendly Slack Client for Logging.

Project description


A Simple and Human Friendly Slack Client for Logging.

Use Case


pip install slackpy


  • requests

Sample Code

import slackpy

INCOMING_WEB_HOOK = 'your_web_hook_url'
CHANNEL = '#general'
USER_NAME = 'Logger'

# Create a new instance.
logging = slackpy.SlackLogger(INCOMING_WEB_HOOK, CHANNEL, USER_NAME, ICON_URL)

# You can set a log level. The default level is INFO.
logging.set_log_level(slackpy.LogLv.DEBUG) # Or logging.set_log_level(10)

## Minimum Parameter
## logging = slackpy.SlackLogger(INCOMING_WEB_HOOK)

# Simple Usage'INFO Message')

# LogLevel's only required parameter is "message", all others are optional.

# LogLevel: DEBUG
logging.debug(message='DEBUG Message', title='DEBUG Title', fields='')

# LogLevel: INFO'INFO Message', title='INFO Title', fields='')

# LogLevel: WARN
logging.warn(message='WARN Message', title='WARN Title', fields='')

# LogLevel: ERROR
logging.error(message='ERROR Message', title='ERROR Title', fields='')

# LogLevel: CUSTOM
logging.message(message='CUSTOM Message', title='CUSTOM Title', color='good',
                fields=[{"title": "CUSTOM", "value": "test", "short": True}],

# Title Link (New v2.1.0)'INFO Message', title='slackpy Repository here',
Method LogLevel Color
debug() DEBUG (10) #03A9F4 (Light Blue)
info() INFO (20) good (green)
warn() WARNING (30) warning (orange)
error() ERROR (40) danger (red)

The definition of the log level is based on the standard library. (

Command line

export SLACK_INCOMING_WEB_HOOK='your_web_hook_url'

# LogLevel: DEBUG
slackpy -c '#your_channel' -m 'DEBUG Message' -l 10

# LogLevel: INFO
slackpy -c '#your_channel' -m 'INFO Message' -l 20

# LogLevel: WARN
slackpy -c '#your_channel' -m 'WARN Message' -l 30

# LogLevel: ERROR
slackpy -c '#your_channel' -m 'ERROR Message' -l 40

# LogLevel: DEBUG (without specifying #channel)
slackpy -m 'DEBUG Message' -l 10

# LogLevel: INFO (with Message Title)
slackpy -c '#your_channel' -t 'INFO Message Title' -m 'INFO Message' -l 20

For AWS Lamdba

# First, pip install to top of project directory.
pip install slackpy -t .

# Second, archive your source code and dependency packages.
zip -r slackpy enum requests

# Finally, upload

About Versioning

slackpy is following Semantic Versioning 2.0.0.

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 slackpy, version 2.2.2
Filename, size File type Python version Upload date Hashes
Filename, size slackpy-2.2.2.tar.gz (4.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page