slackstyler is a Python package that converts strings written in Markdown into Slack message formatting. It provides a simple and convenient conversion of Markdown styles into Slack styles and can be effectively used when creating or integrating with Slack bots.
Project description
slackstyler
slackstyler is a Python package that converts Markdown text into Slack message formatting. The motivation for creating this package is to allow Python developers to prepare and send richly-formatted messages to Slack in a way that's familiar and easy to use.
slackstyler was inspired by JavaScript's slackify-markdown library and also based on mistune, a markdown parser in pure Python.
Features
- Converts Markdown text into Slack message formatting.
- Supports various Markdown syntaxes:
- Bold text
- Italic text
- Link
- and more...
Installation
Install slackstyler with pip:
pip install slackstyler
Usage
Here is a quick example of how to use slackstyler:
from slackstyler import SlackStyler
# Create a styler instance
styler = SlackStyler()
# Convert markdown text to slack message text
markdown_text = "Hello, **Slack**!"
slack_message = styler.convert(markdown_text)
print(slack_message)
When you run this code, you will see:
Hello, *Slack*!
Acknowledgments
This project was inspired by slackify-markdown, a similar library written in JavaScript.
License
slackstyler is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slackstyler-0.0.3.tar.gz.
File metadata
- Download URL: slackstyler-0.0.3.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e7b76f0857b43664e02a8fb6e06458bd56e14c10fa3d0a7461fab1106b2b24c
|
|
| MD5 |
90eef45967d2d34d8f1a94f44cf3b11d
|
|
| BLAKE2b-256 |
0e0b2fbb995b6b41ba8e548594823d3b8b0f3439910e1dd4b3591ce4693c13bd
|
File details
Details for the file slackstyler-0.0.3-py3-none-any.whl.
File metadata
- Download URL: slackstyler-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7090fe720b9e3aa75cefe7c32ed0fb97f957a699dd45925b8d50f6324a03d8e1
|
|
| MD5 |
f5ee9e8d31521900113f273d30c892a3
|
|
| BLAKE2b-256 |
17af3e8c78c0c7dbb40a9fbf279548712e2a4d58bed745fb7a09d5fcc0887ce6
|