md-to-text-lite
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
393b74d41b5f85b9296ee3f2b1589a070224bc1b3c62b6612ed19cb5eaaf0004
|
|
| MD5 |
d83329a3a6d7f82e9df0c44b21d799d9
|
|
| BLAKE2b-256 |
c81ffd2781f23c06b7ca5cd1c9f932242bbcbfe6e985fd21303264961f6594e8
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
md_to_text_lite-0.1.0.tar.gz -
Subject digest:
393b74d41b5f85b9296ee3f2b1589a070224bc1b3c62b6612ed19cb5eaaf0004 - Sigstore transparency entry: 2684462985
- Sigstore integration time:
-
Permalink:
Encephos/md-to-text-lite@924a4a0291bdefc8def6169f39cc03de9748846d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Encephos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@924a4a0291bdefc8def6169f39cc03de9748846d -
Trigger Event:
release
-
Statement type:
File details
Details for the file md_to_text_lite-0.1.0-py3-none-any.whl.
File metadata
- Download URL: md_to_text_lite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5226b972e9a410b8b4284f244db036e229d9fbe6718eb3145a3e72ba85547bc4
|
|
| MD5 |
e162d0e3615e54b4f82500659e42832a
|
|
| BLAKE2b-256 |
cdd521515053183f8367307f691dbab1e791fb9d28b4f2d5d1ad8a453d183abe
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
md_to_text_lite-0.1.0-py3-none-any.whl -
Subject digest:
5226b972e9a410b8b4284f244db036e229d9fbe6718eb3145a3e72ba85547bc4 - Sigstore transparency entry: 2684462995
- Sigstore integration time:
-
Permalink:
Encephos/md-to-text-lite@924a4a0291bdefc8def6169f39cc03de9748846d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Encephos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@924a4a0291bdefc8def6169f39cc03de9748846d -
Trigger Event:
release
-
Statement type: