Skip to main content

YAML Front Matter parser

Project description

A very simple Python package for parsing YAML Front Matter from a text file. Written for Python 3, but works for 2.


import frontmatter

# assuming '' exists
post = frontmatter.parse('')

print(post['metadata']) # Dictionary
print(post['content'])  # String

The output would be:

{'foo': 'bar', 'num': 3, 'list': ['first', 'second', 'third']}

This is the actual post content
This is a second line

In the above example, the contents of is:

foo: bar
num: 3
- first
- second
- third

This is the actual post content
This is a second line


This package is licensed under ISC.

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
frontmatter-1.0.0.tar.gz (4.6 kB) Copy SHA256 hash SHA256 Source None Dec 25, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page