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 Distributions

Pweave-0.22.2.zip (29.4 kB view details)

Uploaded Source

Pweave-0.22.2.tar.gz (20.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

Pweave-0.22.2-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

Pweave-0.22.2-py2.7.egg (51.7 kB view details)

Uploaded Egg

Pweave-0.22.2-py2-none-any.whl (26.2 kB view details)

Uploaded Python 2

File details

Details for the file Pweave-0.22.2.zip.

File metadata

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

File hashes

Hashes for Pweave-0.22.2.zip
Algorithm Hash digest
SHA256 5907c510b713bb90014ed34533f9b8e5d25074dfb22fd6f431dcfa3f83132e89
MD5 3dc3b5f675c8125532b249612f0e3842
BLAKE2b-256 b990103ec45c00bd8a1171c302a891f18d5f84ac4b7f0d82ec673d152d31def4

See more details on using hashes here.

File details

Details for the file Pweave-0.22.2.tar.gz.

File metadata

  • Download URL: Pweave-0.22.2.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Pweave-0.22.2.tar.gz
Algorithm Hash digest
SHA256 6723ffc8c34ea173886fc44112b76ccd7138af6c8e971fbb2d5d9cd3803cfb1f
MD5 21e512138045f6d8d2f54a9bd9c1b0a4
BLAKE2b-256 a7107700ee76b25ac273662c2635bca5280e5580114b09e172b3772d9bf33982

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Pweave-0.22.2-py3-none-any.whl
Algorithm Hash digest
SHA256 98a0fa1d1f8b31f3261841c7c614e794c8169d8c1323575a95d694825ebb3729
MD5 a6ec88f9247023ababba9aabdb7b1b44
BLAKE2b-256 0795d78c4d93216f47db28b8e42036d7ac4edde5a33d76f243c924f5b0fbc2b8

See more details on using hashes here.

File details

Details for the file Pweave-0.22.2-py2.7.egg.

File metadata

  • Download URL: Pweave-0.22.2-py2.7.egg
  • Upload date:
  • Size: 51.7 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Pweave-0.22.2-py2.7.egg
Algorithm Hash digest
SHA256 ef36e6bfd6ba97b85552f49b4a9cbd967d3de4aadb23288341fc40500efe8f77
MD5 3acc34f616cfebcd998507f98bf1a470
BLAKE2b-256 de8bd71b907d79423a43c2ae37119455979acbd9d76ded57b7e0da3d34d3c1da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Pweave-0.22.2-py2-none-any.whl
Algorithm Hash digest
SHA256 c6c46d40b3c6d8cd3c5bde39b8873210acfed6d78b71073147589ac17b55b5f6
MD5 4a056709ff114b8f080a82612ca0d7ce
BLAKE2b-256 044ad7736b1c20fb8646433cbd75a5ab1e13aeec5932ced602a1e8eafdec6d5e

See more details on using hashes here.

Supported by

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