Markdown Worker
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
Metadata
Release files for markdown-worker 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| markdown_worker-0.0.4.tar.gz | 4.3 kB | Without provenance | Details for markdown_worker-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| markdown_worker-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for markdown_worker-0.0.4-py3-none-any.whl |
Total release size: 9.0 kB
Release files / markdown_worker-0.0.4.tar.gz
| Download URL | markdown_worker-0.0.4.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b53a82f0c6d68b021c1818a942175ed79794d25c80a265bfa8400f1ca3218d0
|
|
BLAKE2b-256 checksum How to use checksums |
178ab7aaa36f085342801d9ca4b8a1678e29b2728b9f0b9f501f74998fb5ea99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / markdown_worker-0.0.4-py3-none-any.whl
| Download URL | markdown_worker-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c1bda458d3813cc3789329ae72f7fc45cd4d44313c87a985d3e40f7703289a3
|
|
BLAKE2b-256 checksum How to use checksums |
ed8823c39eda9dbb65f7891f0db7d5e73061afda6d1b4448d4b315ef19961c60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Security for markdown-worker 0.0.4
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.