--- id: python-frontmatter version: "1.3.0" license: MIT license_treatment: permissive maintenance: active --- # python-frontmatter — Parse and manage posts with YAML (or other) frontmatter License: permissive · Maintenance: active · Downloads: 19.6M/mo ## What it is and what it does Python Frontmatter is a lightweight parser for documents that combine structured metadata (front matter) with body content, separated by delimiters. It reads files or text containing YAML (or other format) metadata blocks followed by content, and exposes them as separate, easily accessible objects—metadata as a dictionary and content as a string. The package handles common workflows: loading from files or file-like objects, parsing raw text, accessing metadata fields as dictionary keys, modifying metadata, and writing the combined document back to text or file format. It's built for static site generators, documentation systems, and any workflow where you need to attach structured metadata to plain-text documents. The single runtime dependency is pyyaml, and it supports Python 3.10 and later. The package is actively maintained and has been stable since its early releases. Use it for: - Parse Jekyll or Hugo blog posts that use YAML front matter for metadata like title, date, and tags - Extract and modify document metadata in static site generators or documentation pipelines - Build content management workflows where metadata and body are stored together in plain text - Process Markdown files with structured headers for automation or indexing - Strip and rewrite front matter in batch document transformations ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and manages text files with YAML (or JSON, TOML) front matter, separating structured metadata from document content for easy access and manipulation. Yes. Low install friction, no security vulnerabilities, MIT license, active maintenance, and a single stable dependency make this a safe choice. Install it if you work with front-matter-delimited documents (Jekyll posts, static site content, or similar). Skip it only if your workflow doesn't involve parsing metadata-prefixed text files. ## Install pip install python-frontmatter uv add python-frontmatter poetry add python-frontmatter ## Installing python-frontmatter Before you install: Low friction: pure Python wheel with a single runtime dependency (pyyaml). Active maintenance with a recent release (86 days ago) and 427 repository stars. License in practice: MIT license permits unrestricted use, modification, and distribution with only attribution required—no restrictions on commercial or proprietary use. Quickstart: import frontmatter post = frontmatter.load('document.txt') print(post['title']) # access metadata print(post.content) # access body content # Or parse from text: metadata, content = frontmatter.parse(text) Verify before relying: - Whether JSON, TOML, and other front matter formats are equally well-supported or if YAML is the primary use case - Performance characteristics when processing large files or batch operations ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 19.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags yaml frontmatter parser, parse front matter metadata, yaml document metadata extraction, frontmatter file parsing, structured metadata in text files, jekyll-style front matter, document metadata separator, metadata-extraction, static-site-generation, yaml-parsing [View on SkillFed](https://skillfed.io/packages/python-frontmatter) · [View on PyPI](https://pypi.org/project/python-frontmatter/)