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.
Pweave 0.22 has been released with a lot of new features including Python 3 compatibility (tested with 3.4). Related to this Pweave now imports the following:
from __future__ import print_function, division, unicode_literals, absolute_import
This also affects the weaved documents. If you don’t like this you can still use 0.21.2 or fork the code on Github
Post your questions and comments to Pweave google group.
pip install --upgrade Pweave
conda install -c https://conda.binstar.org/mpastell pweave
Or download the source package from PyPi and run:
python setup.py install
After the installation you get options with:
$ Pweave --help $ Ptangle
Thanks to following people for contributing patches and ideas: Tamas Nepusz, Nicky van Foreest, Mark Edgington, Thomas Unterthiner, Matthew McDonald, Grant Goodyear, Aaron O’Leary.