Registry / communication / telegramify-markdown

telegramify-markdown

JSON →
library1.2.0pypypi✓ verified 87d ago

telegramify-markdown is a Python library designed to convert standard Markdown text into a format compatible with Telegram's MessageEntity system. It processes Markdown syntax and outputs a plain text string along with a list of `MessageEntity` objects, suitable for sending via the Telegram Bot API. The current version is 1.1.2, and it maintains a moderate release cadence based on feature additions and bug fixes.

pip install telegramify-markdown
INSTALL
IMPORT
SIG · TELEGRAMIFY-MARKDO
T
telegramify-markdown
communicationpythonv1.2.0
Install
2.0s avg
Import
—
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
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
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20MB
glibc
py 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.
fix
Always 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.
fix
Refer 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.
fix
Ensure 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.
Agent activity
37 hits · last 30 days
node
34
OpenAI (training)
2
Resources
telegramify-markdown — pip install telegramify-markdown · libregistry