Metadata-Version: 2.1
Name: py-frontmatter
Version: 0.2.0
Summary: Manipulate YAML front matter.
License: Apache-2.0
Author: YEUNG King On
Author-email: koyeung@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: ruamel.yaml (>=0.17.21,<0.18.0)
Description-Content-Type: text/markdown

# py-frontmatter
To manipulate front matter in document file.

## Installation

```shell
pip install py-frontmatter
```

## Usage

```
% cat note.md 
---
title: Hacker's note
tags: [a, b]
---
# header
text
```

To retrieve front matter as JSON:
```
% frontmatter get note.md | jq
{
  "title": "Hacker's note",
  "tags": [
    "a",
    "b"
  ]
}
```

To replace the front matter:
```
% echo '{"title": "My note", "tags": ["a", "b", "c"]}' | frontmatter set note.md 
% cat ~/today/note.md 
---
title: My note
tags:
- a
- b
- c
---
# header
text
```

