Markdown Worker: A Simple Python Library for Working with Markdown
Mantresh Khurana is the Founder & CEO of Spyxpo, a visionary entrepreneur, and a full-stack developer with a passion for pushing the boundaries of technology. With expertise in web, mobile, desktop, and embedded systems, he excels at mastering emerging technologies that drive innovation. His work is defined by a commitment to developing cutting-edge solutions that transform industries and shape the future.
Markdown Worker: A Simple Python Library for Working with Markdown
If you work with Markdown files in Python, you’ve probably had to write custom code just to read, parse, or extract content. I built Markdown Worker to make those common tasks much easier.
Markdown Worker is a lightweight Python library that lets you read, parse, search, and convert Markdown files through a simple API.
Features
Read complete Markdown files
Extract headings and paragraphs
Search for content under a specific heading
Convert Markdown to HTML
Simple API that’s easy to use in any Python project
Installation
Install it with pip:
pip install markdown-worker
Or clone the repository:
git clone https://github.com/mantreshkhurana/markdown-worker-python.git cd markdown-worker-python
Usage
Read and Parse a Markdown File
from markdown_worker import MarkdownParser parser = MarkdownParser("example.md") markdown_content = parser.read_complete_file() headers, paragraphs, _ = parser.extract_headers_and_paragraphs() print(headers) print(paragraphs)
Search for a Heading
from markdown_worker import MarkdownParser parser = MarkdownParser("example.md") result = parser.search_heading("Usage") print(result)
Convert Markdown to HTML
from markdown_worker import MarkdownParser parser = MarkdownParser("example.md") markdown_content = parser.read_complete_file() html = parser.markdown_to_html(markdown_content) print(html)
Why I Built It
Markdown is used everywhere, from documentation and blogs to project notes. While there are great Markdown libraries available, I wanted something focused on common file operations like reading, extracting sections, searching headings, and converting content without adding unnecessary complexity.
Contributing
Markdown Worker is open source, and contributions are always welcome. If you find a bug or have an idea for a new feature, feel free to open an issue or submit a pull request.
You can find the project here:
GitHub: https://github.com/mantreshkhurana/markdown-worker-python


