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](./LICENSE) file).
============
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](./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.0.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for frontmatter-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2786095aaecf49e1e5eacd2b12916d78b1999004a4693f7a325bfee6f1e40afd |
|
MD5 | d5066270cd7e278692e449fe87f27d88 |
|
BLAKE2b-256 | 02d148ae740ef1056e2594bb83d089336157e8107ec8778fb82536d1fbb2ea2d |