Skip to main content

Slackify Markdown

PyPI Downloads

A Python library for converting Markdown to slack specific markdown. This is inspired from existing npm package slackify-markdown

Overview

This library converts regular Markdown to Slack-specific markdown, making it easy to use and display correctly in Slack messages.

Installation

pip install slackify-markdown

Usage

from slackify_markdown import slackify_markdown

markdown = """
# Title

This is **bold text** and this is *italic text*.

## Subtitle
1. **Item 1**
2. *Item 2*

## Another Subtitle
* **Element 1** - *Description 1*
* **Element 2** - *Description 2*

[Link](https://example.com)

"""

slack_output = slackify_markdown(markdown)
"""
*Title*

This is *bold text* and this is _italic text_.

*Subtitle*
1.  *Item 1*
2.  _Item 2_

*Another Subtitle*
•   *Element 1* - _Description 1_
•   *Element 2* - _Description 2_

<https://example.com|Link>
"""

Features

  • Converts headers to Slack-compatible bold text
  • Preserves bold and italic formatting
  • Handles code blocks and inline code
  • Converts links to Slack's expected format
  • Processes lists (ordered and unordered)
  • Handles blockquotes

Example Conversions

Markdown Slack mrkdwn
# Heading *Heading*
**Bold** *Bold*
*Italic* _Italic_
`code` `code`
[Link](https://example.com) <https://example.com|Link>

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Shoutout to jsarafaj, his JS library has inspired the code and tests for this package.

Metadata

Release files for slackify-markdown 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slackify-markdown 0.2.4
File Size Uploaded
slackify_markdown-0.2.4.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for slackify-markdown 0.2.4
File Interpreter ABI Platform
slackify_markdown-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / slackify_markdown-0.2.4.tar.gz

Download URL slackify_markdown-0.2.4.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
90b57c0a4ef81306c2208573ab4d3afc945797eed0dd04c4876b4a0ca7222619
BLAKE2b-256 checksum
How to use checksums
8d07e6f7fe419b21e7bc198f62c9074f7d5ab398b67dc455ccb3190dc31f91f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / slackify_markdown-0.2.4-py3-none-any.whl

Download URL slackify_markdown-0.2.4-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5dd7539facafb6c0add7d895bf3501ba25cd7539ee8e06fc0a3adfef237d647c
BLAKE2b-256 checksum
How to use checksums
b936b4f9788907b95b5f217fa9602c94f97ceb2af902aaa2396f37ee7b1c74a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page