Skip to main content

ZC Buildout recipe for creating text files out of templates.

Project description

This is a very simple recipe which generates a textfile from a template.

The template can be everything, and may contain python-style string formatters. The values will be replaced with the options you set inside the buildout.cfg section.


template-directory – the directory to fetch templates from

template – the template file
default: $(name)

location – the output file

${buildout:template-directory} is set to ${buildout:directory}/templates if not set in the buildout section.

If location is not set, no file is created. You can always access the generated content using the content key, though.


An example buildout.cfg:




Note that due to the default settings (see above), the template-directory and template settings are redundant.

An example text template:

This is just a test


This is just text %(avalue)s and %(anothervalue)s got
replaced. See?

The recipe will read the template and replace the strings yielding something like:

This is just a test


This is just text foo and bar got
replaced. See?


vim: set ft=rst ts=2 sw=2 tw=75 expandtab:

Project details

Download files

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

Files for inquant.recipe.textfile, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size inquant.recipe.textfile-0.2.3-py2.4.egg (6.2 kB) File type Egg Python version 2.4 Upload date Hashes View
Filename, size inquant.recipe.textfile-0.2.3.tar.gz (13.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page