Flatpages based on files with yaml syntax
Project description
Install
pip install yamlpage
Usage
>>> from yamlpage import YamlPage >>> p = YamlPage('./content')
Put page
>>> url = '/my/url' >>> p.put(url, ( ... ('title', 'foo'), ... ('body', 'foo\nbar'), ... ))>>> path = './content/^my^url.yaml' >>> print(open(path).read()) title: foo body: |- foo bar <BLANKLINE>
Get page
>>> p.get(url) == {'body': 'foo\nbar', 'url': '/my/url', ... 'filename': './content/^my^url.yaml', 'title': 'foo'} True>>> p.get('/not/found/') is None True
Check exists
>>> p.exists(url) True >>> p.exists('/not/found/') False
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
yamlpage-1.0.0.tar.gz
(2.9 kB
view hashes)