Skip to main content

text2markdown-formatter

PyPI version License: MIT Downloads LinkedIn

text2markdown-formatter is a lightweight Python package that converts unstructured raw text into clean, well‑structured Markdown documents. By leveraging the llmatch-messages utility and a default ChatLLM7 model, the package ensures the output follows a consistent Markdown format, making it ideal for bloggers, writers, developers, and anyone who works with Markdown for documentation or content creation.

Features

  • Automatic transformation of notes, ideas, or drafts into polished Markdown.
  • Built‑in support for the ChatLLM7 model (no extra configuration required).
  • Ability to plug in any LangChain‑compatible LLM (OpenAI, Anthropic, Google Gemini, etc.).
  • Simple, single‑function API.

Installation

pip install text2markdown_formatter

Quick Start

from text2markdown_formatter import text2markdown_formatter

raw_text = """
My project ideas:
- Build a web scraper.
- Write a blog post about AI.
- Create a small game.
"""

markdown = text2markdown_formatter(user_input=raw_text)
print("\n".join(markdown))

API Reference

text2markdown_formatter(user_input: str, api_key: Optional[str] = None, llm: Optional[BaseChatModel] = None) -> List[str]

Parameter Type Description
user_input str The raw text you want to convert to Markdown.
api_key Optional[str] API key for the LLM7 service. If omitted, the function reads LLM7_API_KEY from the environment or defaults to "None" (which uses the free tier).
llm Optional[BaseChatModel] A LangChain LLM instance to use instead of the default ChatLLM7. You can pass any LangChain‑compatible chat model.

The function returns a list of Markdown strings extracted from the LLM response.

Using a Custom LLM

You can replace the default ChatLLM7 with any LangChain chat model.

OpenAI

from langchain_openai import ChatOpenAI
from text2markdown_formatter import text2markdown_formatter

my_llm = ChatOpenAI()
markdown = text2markdown_formatter(user_input="My notes...", llm=my_llm)

Anthropic

from langchain_anthropic import ChatAnthropic
from text2markdown_formatter import text2markdown_formatter

my_llm = ChatAnthropic()
markdown = text2markdown_formatter(user_input="My notes...", llm=my_llm)

Google Gemini

from langchain_google_genai import ChatGoogleGenerativeAI
from text2markdown_formatter import text2markdown_formatter

my_llm = ChatGoogleGenerativeAI()
markdown = text2markdown_formatter(user_input="My notes...", llm=my_llm)

Environment Variables

  • LLM7_API_KEY – Your API key for the LLM7 service. Obtain a free key by registering at https://token.llm7.io/.

If you don’t set this variable, the package will fall back to the free tier limits of LLM7.

Rate Limits

The free tier of LLM7 provides sufficient quota for typical usage of this package. If you need higher limits, supply your own API key via api_key argument or the LLM7_API_KEY environment variable.

Contributing & Support

Author

Eugene Evstafev – hi@euegne.plus
GitHub: chigwell


Enjoy turning raw text into beautiful Markdown with text2markdown-formatter!

Metadata

Release files for text2markdown-formatter 2025.12.21173214

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

Source distribution (sdist)

Source distribution for text2markdown-formatter 2025.12.21173214
File Size Uploaded Provenance Actions
text2markdown_formatter-2025.12.21173214.tar.gz 6.5 kB Without provenance Details for text2markdown_formatter-2025.12.21173214.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for text2markdown-formatter 2025.12.21173214
File Interpreter ABI Platform Actions
text2markdown_formatter-2025.12.21173214-py3-none-any.whl Python 3 none any Details for text2markdown_formatter-2025.12.21173214-py3-none-any.whl

Total release size: 13.7 kB

Release files / text2markdown_formatter-2025.12.21173214.tar.gz

Download URL text2markdown_formatter-2025.12.21173214.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
33393a92d9cb58f375f852d002384ada4b9d37eadd7a88f8bbd549c89221b0ac
BLAKE2b-256 checksum
How to use checksums
c17d9bcd2e0d11473d084c399492354d183ff2ef21ba5eef148e3ce40339568c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / text2markdown_formatter-2025.12.21173214-py3-none-any.whl

Download URL text2markdown_formatter-2025.12.21173214-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6a496cf1f3743119a15459814dfb81f2f9b21e5d12c2c76a0b358037e029beb
BLAKE2b-256 checksum
How to use checksums
dee123b4bdd6286afdf937956204926cd5bcfc11471864a4f9c4b75209c49f13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Security for text2markdown-formatter 2025.12.21173214

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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