Jorge Monforte’s heracles¶
heracles is a project by Jorge Monforte which can parse and render configuration files. It is based on augeas.
Links to heracles¶
- heracles is documented on Read The Docs.
- The source of the project is stored on github.
- It is available in the Cheeseshop.
The code is licensed under the LGPL, and so can be copied for investigation
Summary¶
heracles is designed to work with Python2, having been specifically tested with Python2.6 and 2.7.
Like augeas, heracles uses “lenses” which allow parsing and rendering of a variety of common Linux configuration files. Augeas is a c-based library which also provides Python bindings, whereas heracles goes further in allowing straight access to the parser functions from Python
The idea of a “lens parser” is derived from Boomerang, and is a “well-behaved bidirectional transformation” beween text and tree, which allows re-writing parts of a file while leaving the rest of the file untouched. As such a lens parser normally has two siginificant methods: get and put.