Skip to main content

A simple markdown parsing package.

Project description

Markdown Worker

PyPI version

Markdown Worker is a versatile Python module for parsing, reading, and writing Markdown files. It simplifies the process of working with Markdown documents by providing a convenient interface for common tasks.

Installation

You can install Markdown Worker via pip:

pip install markdown-worker

or

pip3 install markdown-worker

Alternatively, you can clone the GitHub repository:

git clone https://github.com/mantreshkhurana/markdown-worker-python.git
cd markdown-worker-python

Features

  • Read and parse Markdown files.
  • Search for specific headers within a Markdown file.
  • Retrieve content associated with a particular header.
  • Convert Markdown to HTML.
  • Simple and intuitive API.

Usage

Reading and Parsing Markdown Files

from markdown_worker import MarkdownParser

# Initialize the parser with a Markdown file
parser = MarkdownParser("example.md")

# Read the entire file
markdown_content = parser.read_complete_file()

# Extract headers and paragraphs
headers, paragraphs, _ = parser.extract_headers_and_paragraphs()

# Print the extracted headers
print("Headers:", headers)

# Print the extracted paragraphs
print("Paragraphs:", paragraphs)

Searching for a Header

from markdown_worker import MarkdownParser

# Initialize the parser with a Markdown file
parser = MarkdownParser("example.md")

# Search for a specific header
heading_to_search = "Usage"
result = parser.search_heading(heading_to_search)

# Print the content under the searched header
print("Content under the heading:", result)

Convert Markdown to HTML

from markdown_worker import MarkdownParser

# Initialize the parser with a Markdown file
parser = MarkdownParser("example.md")

# Read the entire file
markdown_content = parser.read_complete_file()

# Convert Markdown to HTML
html_content = parser.markdown_to_html(markdown_content)

# Print the HTML content
print("HTML Content:", html_content)

Example

An example Markdown file (example.md) is provided in the repository, containing documentation for the program.

Author

Project details


Download files

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

Source Distribution

markdown_worker-0.0.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

markdown_worker-0.0.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file markdown_worker-0.0.4.tar.gz.

File metadata

  • Download URL: markdown_worker-0.0.4.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for markdown_worker-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1b53a82f0c6d68b021c1818a942175ed79794d25c80a265bfa8400f1ca3218d0
MD5 47cbc926480d02d08a05ae0a53320b86
BLAKE2b-256 178ab7aaa36f085342801d9ca4b8a1678e29b2728b9f0b9f501f74998fb5ea99

See more details on using hashes here.

File details

Details for the file markdown_worker-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for markdown_worker-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1c1bda458d3813cc3789329ae72f7fc45cd4d44313c87a985d3e40f7703289a3
MD5 06be9fed704fcf7a9bff741aad4a6d58
BLAKE2b-256 ed8823c39eda9dbb65f7891f0db7d5e73061afda6d1b4448d4b315ef19961c60

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page