Skip to main content

md-to-text-lite

PyPI version License: MIT

A zero-dependency Python micro-tool to strip Markdown formatting and extract clean, readable plain text.

The Problem

When you scrape websites, process LLM outputs, or prepare documents for Text-to-Speech (TTS), you often end up with Markdown strings full of **bold**, [links](url), and # Headers. You just want the plain text, but importing heavy HTML/Markdown parsers like beautifulsoup4 or markdown just to strip text is overkill.

The Solution

md-to-text-lite uses pure standard library regex to intelligently strip markdown syntax while preserving the actual content. It runs in microseconds.

Installation

pip install md-to-text-lite

Usage

from md_to_text_lite import markdown_to_text

md_string = """
# Hello World
This is a **bold** statement with a [link](https://github.com).
* List item 1
* List item 2
"""

clean_text = markdown_to_text(md_string)
print(clean_text)

# Output:
# Hello World
# This is a bold statement with a link.
# List item 1
# List item 2

Features

  • Zero Dependencies: Pure Python standard library (re).
  • Intelligent Stripping: Keeps the alt-text of images and text of links, removes URLs.
  • Code Blocks: Removes multi-line code blocks entirely (since you usually don't want to read code aloud or count it in word metrics).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md_to_text_lite-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md_to_text_lite-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file md_to_text_lite-0.1.0.tar.gz.

File metadata

  • Download URL: md_to_text_lite-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for md_to_text_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 393b74d41b5f85b9296ee3f2b1589a070224bc1b3c62b6612ed19cb5eaaf0004
MD5 d83329a3a6d7f82e9df0c44b21d799d9
BLAKE2b-256 c81ffd2781f23c06b7ca5cd1c9f932242bbcbfe6e985fd21303264961f6594e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for md_to_text_lite-0.1.0.tar.gz:

Publisher: publish.yml on Encephos/md-to-text-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file md_to_text_lite-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for md_to_text_lite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5226b972e9a410b8b4284f244db036e229d9fbe6718eb3145a3e72ba85547bc4
MD5 e162d0e3615e54b4f82500659e42832a
BLAKE2b-256 cdd521515053183f8367307f691dbab1e791fb9d28b4f2d5d1ad8a453d183abe

See more details on using hashes here.

Provenance

The following attestation bundles were made for md_to_text_lite-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Encephos/md-to-text-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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