Simple, unlicensed, frontmatter parser for Python 2.x.
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md Fleshed out README. Aug 3, 2016
UNLICENSE Rename LICENSE to UNLICENSE Aug 3, 2016
simple_frontmatter.py Added the two functions and tests from Phial. Aug 3, 2016
simple_frontmatter_test.py Added the two functions and tests from Phial. Aug 3, 2016

README.md

simple-frontmatter

This is a simple, unlicensed, frontmatter parser for Python 2.x.

# post.rst
title: The best post ever
author: John
...

This really is the best post ever
=================================

I assure you.
>>> import simple_frontmatter
>>> with open("post.rst") as f:
...     frontmatter, contents = simple_frontmatter.load(f)
...
>>> frontmatter
{'title': 'The best post ever', 'author': 'John'}
>>> contents
'\nThis really is the best post ever\n=================================\n\nI assure you.\n'

You can include the actual module, but I'd just copy and paste the code in simple_frontmatter.py into your project.