{"id":10281,"library":"telegramify-markdown","title":"Telegramify Markdown","description":"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.","status":"active","version":"1.1.2","language":"en","source_language":"en","source_url":"https://github.com/vlad-lazar/telegramify-markdown","tags":["markdown","telegram","converter","bot-api","text-processing"],"install":[{"cmd":"pip install telegramify-markdown","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core dependency for Markdown parsing.","package":"markdown-it-py","optional":false}],"imports":[{"symbol":"telegramify_markdown","correct":"from telegramify_markdown import telegramify_markdown"}],"quickstart":{"code":"from telegramify_markdown import telegramify_markdown\n\nmarkdown_text = \"Hello, *world*! This is some _italic_ text and `inline code`.\"\nplain_text, entities = telegramify_markdown(markdown_text)\n\nprint(\"Plain Text:\", plain_text)\nprint(\"Entities:\", entities)\n\n# Example of how you might use it with a Telegram bot library (concept)\n# bot.send_message(chat_id=12345, text=plain_text, entities=entities)","lang":"python","description":"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."},"warnings":[{"fix":"Always destructure the result: `text, entities = telegramify_markdown(...)`. Ensure your Telegram API call uses both `text` and `entities` parameters correctly.","message":"The `telegramify_markdown` function returns a tuple: `(plain_text_string, list_of_message_entities)`. Many users mistakenly expect only a string.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"This 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your environment is running Python 3.10 or a more recent version. You can check your Python version with `python --version`.","message":"The 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.","severity":"breaking","affected_versions":"< 1.0.0 (and all subsequent versions)"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Remember `telegramify_markdown` returns a tuple `(text, entities)`. You need to destructure it before using the components. Example: `text, entities = telegramify_markdown(your_md_string)`.","cause":"Attempting to call the result of `telegramify_markdown` as if it were a function, or misinterpreting its return type.","error":"TypeError: 'tuple' object is not callable"},{"fix":"Install the package using `pip install telegramify-markdown`. Verify your import statement: `from telegramify_markdown import telegramify_markdown`.","cause":"The package is not installed in the current Python environment, or the import statement is incorrect.","error":"ModuleNotFoundError: No module named 'telegramify_markdown'"},{"fix":"Upgrade your Python interpreter to version 3.10 or newer. This library explicitly states `requires_python='>=3.10'`.","cause":"Running the library on a Python version older than 3.10, which does not support the required type hint syntax.","error":"SyntaxError: 'annotations' must be a from __future__ import, not a statement"}]}