Pweave is a scientific report generator and a literate programming tool for Python. Pweave can capture the results and plots from data analysis and works well with numpy, scipy and matplotlib. Pweave is inspired by Sweave, an excellent tool for R programmers, and the syntax is mostly compatible with it. Pweave supports reST, Sphinx, Latex, and Pandoc markdown markups.
Pweave uses noweb syntax for separating code from documentation, but it also supports ERB style evaluation of inline code. Pweave is able to weave a python code between <<>>= and @ blocks and include the results and capture matplotlib plots in the document. Inline code in documentation chunks is marked using <% %> (code will be evaluated in place) and <%= %> (result of expression will be printed) tags. Pweave supports reST, Sphinx, Latex, and Pandoc markdown markups. . Pweave is good for creating reports and tutorials. It can also be used to make websites together with e.g. Sphinx or rest2web.
Note
I’ve started Pweave google group so you can ask for help and discuss new features. It will also be used to announce new releases.
With easy_install::
easy_install -U Pweave
Or download the source package from PyPi and run::
python setup.py install
Or run the binary exe installer on Windows.
After the installation you get options with:
$ Pweave --help
$ Ptangle
Note
Windows users: Check that the Python scripts directory is in your path (e.g. for me this c:\python27\scripts).
Browse documentation or go straight to an example document
Thanks to following people for contributing patches and ideas: Tamas Nepusz, Nicky van Foreest, Mark Edgington, Thomas Unterthiner, Matthew McDonald.