YAML Front Matter parser
Project description
frontmatter
A very simple Python package for parsing YAML Front Matter from a text file. Written for Python 3, but works for 2.
Usage
import frontmatter
# assuming 'testfile.md' exists
post = frontmatter.parse('testfile.md')
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 testfile.md is:
---
foo: bar
num: 3
list:
- first
- second
- third
---
This is the actual post content
This is a second line
LICENSE
ISC (see LICENSE file).
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 Distribution
frontmatter-2.1.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for frontmatter-2.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a8709fe94c4d986a57e9c9a639dc21059565ae2036c2a4aea87286b3f2c19dc |
|
MD5 | 25d9a80fb1887e952dcea189ba2173df |
|
BLAKE2b-256 | d7a0e90729936390d24c26922e16b403578d0109f0751266b903a50a53bff124 |