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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file boringmd-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: boringmd-1.1.1-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.0 importlib_metadata/3.7.3 packaging/20.9 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c09991a0176af36253d42758b714407d27b66722c9a2040ec5d9872eea7dfcc5 |
|
MD5 | f51a245cbc7e4e83480c172c4886d122 |
|
BLAKE2b-256 | d4e679c74cb1efb885eba5054a4c895231d5ecf1714cdb8725f3c940c7ce162f |