Skip to main content

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.yml'
>>> print open(path).read()
title: foo
body: |-
  foo
  bar
<BLANKLINE>

Get page

>>> p.get(url)
{'body': 'foo\nbar', 'title': 'foo'}
>>> p.get('/not/found/') is None
True

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yamlpage-0.0.4.tar.gz (2.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page