Alternatives and related projects¶
This document presents other projects that provide similar or complementary functionalities. It focuses on differences with diecutter.
This document reflects diecutter‘s authors point of view, which is, inherently, a partial one. Contact authors if you feel something is wrong.
diecutter is part of an ecosystem:
- piecutter  is the core Python API. It provides stuff like template engines or template loaders.
- diecutter implements a WSGI application and REST interface on top of piecutter.
- diecutter-index is a proof-of-concept project for an online template registry.
- http://diecutter.io is the SAAS platform running diecutter ecosystem.
- diecutter organization on Github has been created to manage every related projects in a single place.
diecutter‘s authors tried PasteScript, and found it too complicated for most use cases. They felt that the more they generated files with PasteScript, the more they spent time on PasteScript‘s specific stuff. With diecutter, they tried to focus on using templates to generate files.
Let’s highlight some differences between PasteScript and diecutter:
||Diecutter is a web service. You can use a shared diecutter server, but it is also easy to deploy on a local machine.|
You have to register templates:
|You PUT files just like in a filesystem.|
|You distribute templates in Python packages.||You carry templates (folders and files) as you like. No packaging.|
|Can collect input data via interactive shell prompts.||No builtin client (that’s part of the Vision). Listing variables isn’t implemented yet (that’s part of the plans).|
|You declare sets of templates. You can’t render only some part of it, you have to render the whole set.||You can render a directory as a set, but you can also render any single part of it, individually.|
|Templates are Python classes. That allows developers to implement various tasks in hooks.||Uses only templates. Even to dynamically generate folders.|
|Asks you whether to ovewrite files in output directory, and even shows you the diff!||That’s not a job for diecutter. You can do that (better) with Git, Mercurial and many other tools.|
|Uses Cheetah  template engine.||Supports several template engines, such as Jinja  and Django . Cheetah  is in the plans.|
|Not only about generating files. PasteScript is a big project that does several things.||Focuses on generating files.|
Collective.generic.webbuilder inspired diecutter.
Diecutter’s authors felt that collective.generic.webbuilder is a tool made by paster users, for paster users. Mostly developers. With diecutter, they tried to make things easy for most users, but flexible for users who have specific needs.
Here are some differences with diecutter:
|Provides command line interface.||Provides WSGI application and REST
API. Use things like
|You need it installed on your machine.||You just need a web client.|
|Easily develop templates on your machine.||To develop templates, you need to install and run a local diecutter.|
|Reads templates from Github.||Reads templates from Github, anywhere in the repository.|
|One template per repository. Repository is dedicated to templates||Unlimited number of templates per repository. Templates are just files and directories in a filesystem.|
|Supports Bitbucket too.||No support for Bitbucket at the moment. Help is welcome ;)|
|A “cookiecutter” is a set of templates. Renders everything.||Renders directories or any part of it (sub-directories, single files).|
|In templates, variables are like
||No prefix for variables. Works with templates not made for diecutter.|
|Python API.||Python API lives in piecutter .|
|Shell is the user interface.||HTML forms provide a nice, human-readable and highly customizable user interface.|
|Only Jinja2. No plans for other template engines.||Supports several template engines. Could support even non-Python engines.|
Puppet, Chef and other provisioners¶
Provisioning tools, such as Puppet, Chef or Salt (just to name a few), use templates to generate configuration. They also do many other things.
Diecutter only deals with templates and file generation.
Templates and file generation aren’t only a matter of provisioning. There are many situations where you need templates, and where provisioners would be overkill.
Diecutter also tries to make it easier to migrate from one provisioner to another. Provisioners are often tied to one template engine, one layout and one deployment process. Those items differ from one provisioner to another. With diecutter, which supports several template engines, you could easily use the same templates whatever the provisioner or deployment procedure.
|||(1, 2) https://pypi.python.org/pypi/piecutter/|
|||(1, 2) http://www.cheetahtemplate.org/|