Skip to main content

Extract plain text and front matter from Markdown documents

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.9 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.

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

boringmd-1.2.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

boringmd-1.2.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file boringmd-1.2.0.tar.gz.

File metadata

  • Download URL: boringmd-1.2.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for boringmd-1.2.0.tar.gz
Algorithm Hash digest
SHA256 73fd7e42dafad042df9dc2e11ced37e579db6e60e06d524e885690bfde860ad7
MD5 1a1a4bc7236b2b1c5b0d82171344d98f
BLAKE2b-256 fb12bb091f366d87077f3658f69396d2e588176514f6bc45a21085eae033bd77

See more details on using hashes here.

Provenance

The following attestation bundles were made for boringmd-1.2.0.tar.gz:

Publisher: release.yml on cariad/boringmd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file boringmd-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: boringmd-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for boringmd-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df7e141439922add64cb8bd6eaee410f7936fc7f429c5348f1861cf43f172316
MD5 b35e3a9720b14c9ad766d34a627badc9
BLAKE2b-256 756076697b6e1a129b7e39df4cb9077ce51622708a0ac21af4abc56f6524141b

See more details on using hashes here.

Provenance

The following attestation bundles were made for boringmd-1.2.0-py3-none-any.whl:

Publisher: release.yml on cariad/boringmd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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