Skip to main content

Scientific reports with embedded python computations with reST, LaTeX or markdown

Project description

About Pweave

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 the 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 is good for creating reports and tutorials. It can also be used to make websites together with Sphinx or rest2web.

Features:

  • Supports Python 2 and Python 3. Tested with 2.7 and 3.4. as of release 0.22.

  • Execute python code in the chunks and capture input and output to a report.

  • Use hidden code chunks, i.e. code is executed, but not printed in the output file.

  • Capture matplotlib graphics.

  • Evaluate inline code in documentation chunks

  • Cache all code and results from previous runs for fast report generation when you are only working with documentation. Inline code will be hidden in documentation mode.

  • Supports reST, LaTeX or Pandoc markdown for document chunks

  • Run from command line or interpreter

Install:

pip install --upgrade Pweave

If you use conda::

conda install -c https://conda.binstar.org/mpastell pweave

Or download the source package and run::

python setup.py install

Documentation

Pweave documentation can be found from the website http://mpastell.com/pweave

Release Notes

Release 0.22.2

  • Figure and cache directory are now handled relative to weaved document

  • Fixed caching

  • Improved error reporting and exception handling

Release 0.22.1

  • Fixed a bug with inline code chunks.

Release 0.22

  • Package global options moved to pweave.rcParams. This is a breaking change if you have used Pweb class to modify Pweave options. Should not affect commandline usage.

  • Renamed pweave.pweave to pweave.weave, pweave.ptangle to pweave.tangle

  • Python 3 compatibilty, Thanks to Grant Goodyear https://github.com/g2boojum

  • Publishing of scripts from command line : pypublish script

  • Conversion between input formats and markups: Pweave-convert script

  • Possibility to run shell code from Pweave. See engine chunk option.

  • New input formats:

    • Script

    • IPython notebook

  • Bugfix: setting figure format from command line fixed.

  • Ipython terminal

  • Source option for chunks

    • Read from module

    • Read from file

  • Multichunk blocks: complete option

  • rst format uses .. codeblock:: python directive for code chunks.

  • Output formats:

    • Leanpub markdown

  • New options for figures

    • f_size ( (8,6) ) Saved figure size in inches a tuple (w, h)

    • f_env (None) Environment that goes around figure e.g. sidefigure

    • f_spines (True) removes spines from figure right and top if False.

    • complete (False)

    • source: Read chunk source from file or python module or file

    • engine: Choose engine running the code. “python” or “shell”

Release notes for previous versions are in: http://mpastell.com/pweave/release.html

License information

See the file “LICENSE” for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

Project details


Download files

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

Source Distribution

Pweave-0.22.3.zip (30.0 kB view details)

Uploaded Source

Built Distributions

Pweave-0.22.3-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

Pweave-0.22.3-py2-none-any.whl (26.8 kB view details)

Uploaded Python 2

File details

Details for the file Pweave-0.22.3.zip.

File metadata

  • Download URL: Pweave-0.22.3.zip
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Pweave-0.22.3.zip
Algorithm Hash digest
SHA256 3344cc6cd87bcff830392aca7980e53d361d5fde35fe28845559a2d9f2e41cec
MD5 4221a593b092b387d598ccdba17ca867
BLAKE2b-256 48ea1326553bd43fc44ec614ee797d200ee61545bd2515e36ecab8304c391804

See more details on using hashes here.

File details

Details for the file Pweave-0.22.3-py3-none-any.whl.

File metadata

File hashes

Hashes for Pweave-0.22.3-py3-none-any.whl
Algorithm Hash digest
SHA256 258663597038c5eb3c32fdf10542294d9f53e7abee1b50ad2628310b3f47bf62
MD5 ba89e0a28797df32bcd1d7b736701ae0
BLAKE2b-256 6ce0386670c90d1a92b1719cee0851254dc52e540789120440839823dbf95594

See more details on using hashes here.

File details

Details for the file Pweave-0.22.3-py2-none-any.whl.

File metadata

File hashes

Hashes for Pweave-0.22.3-py2-none-any.whl
Algorithm Hash digest
SHA256 ae0a7fca84b6de4b08c2c5e946fe01eed8be947368006251bc7060ec8274a8cc
MD5 d096ec60e4a7622a6ca52f59e3c0ca09
BLAKE2b-256 18d553439e7d91dd10bca0afd9d0096c94956be28ff010cb8d974608d9071ef2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page