Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.0s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
markdownify
✓ from telegramify_markdown import markdownify
✗ from telegramify_markdown import telegramify_markdown
convert
✓ from telegramify_markdown import convert
✗ from telegramify_markdown import telegramify_markdown
mdv2
✓ from telegramify_markdown import mdv2
✗ from telegramify_markdown import telegramify_markdown
Converts a Markdown string into a tuple containing the plain text and a list of Telegram `MessageEntity` objects. These entities describe the formatting (bold, italic, code, etc.) and their positions in the plain text.
from telegramify_markdown import telegramify_markdown
markdown_text = "Hello, *world*! This is some _italic_ text and `inline code`."
plain_text, entities = telegramify_markdown(markdown_text)
print("Plain Text:", plain_text)
print("Entities:", entities)
# Example of how you might use it with a Telegram bot library (concept)
# bot.send_message(chat_id=12345, text=plain_text, entities=entities)
Debug
Known issues
gotchaThe `telegramify_markdown` function returns a tuple: `(plain_text_string, list_of_message_entities)`. Many users mistakenly expect only a string.fixAlways destructure the result: `text, entities = telegramify_markdown(...)`. Ensure your Telegram API call uses both `text` and `entities` parameters correctly.
affects: All versions
gotchaThis library aims for compatibility with Telegram's MarkdownV2, which is not identical to CommonMark or GitHub Flavored Markdown. Certain constructs (e.g., `_` for italic within words, complex nested formatting) may not render as expected or may require careful input escaping.fixRefer to Telegram's official MarkdownV2 documentation for exact syntax. Test complex Markdown inputs to ensure desired output. For problematic characters, consider escaping them in your input if they are not meant for formatting.
affects: All versions
breakingThe library explicitly requires Python 3.10 or newer. Installing or running on older Python versions will lead to `SyntaxError` or `ModuleNotFoundError` due to modern language features used.fixEnsure your environment is running Python 3.10 or a more recent version. You can check your Python version with `python --version`.
affects: < 1.0.0 (and all subsequent versions)
Upgrade
Version history
1.2.0latest on PyPI · released Jun 14, 2026
Audit
Dependencies
markdown-it-pyrequiredCore dependency for Markdown parsing.