Skip to main content

Extract plain text and front matter from Markdown

Project description

boringmd

boringmd is a Python package and command line tool for extracting plain text and front matter from Markdown.

Installation

boringmd requires Python 3.8 or later.

pip install boringmd

Command line

Pass the filename of a Markdown document to extract its plain text content:

boringmd input.md

To extract the front matter only, include the --front-matter flag:

boringmd input.md --front-matter

boringmd prints to stdout. To write the extraction to a file, redirect it:

boringmd input.md > output.txt

Package

from boringmd import front_matter_from_string, text_from_string
markdown = "---\nfoo: bar\n---\n**foo** and _bar_"
print(text_from_string(markdown))
# foo and bar
print(front_matter_from_string(markdown))
# foo: bar

from pathlib import Path
from boringmd import front_matter_from_file, text_from_file
print(text_from_file(Path("input.md")))
print(front_matter_from_file(Path("input.md")))

Related packages

boringmd uses cariad/lstr to manipulate strings.

Thank you! 🎉

My name is Cariad, and I'm an independent freelance DevOps engineer.

I'd love to spend more time working on projects like this, but--as a freelancer--my income is sporadic and I need to chase gigs that pay the rent.

If this project has value to you, please consider ☕️ sponsoring me. Sponsorships grant me time to work on your wants rather than someone else's.

Thank you! ❤️

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

boringmd-1.1.1-py3-none-any.whl (13.4 kB view hashes)

Uploaded Python 3

Supported by

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