Skip to main content

Execute and Render notebooks as HTML reports.

Project description

Generate reproducible reports from Rmarkdown or jupyter notebooks

Build Status Documentation Status The uncompromising python formatter

Reportsrender allows to create reproducible, consistently looking HTML reports from both jupyter notebooks and Rmarkdown files. It makes use of papermill and Rmarkdown to execute notebooks and uses Pandoc to convert them to HTML.

Features:
  • two execution engines: papermill and Rmarkdown.

  • support any format supported by jupytext.

  • create self-contained HTML that can be shared easily.

  • hide inputs and/or outputs of cells.

  • parametrized reports

See the documentation for more details!

Getting started

  • Execute an rmarkdown document to HTML using the Rmarkdown engine

reportsrender rmd my_notebook.Rmd report.html
  • Execute a parametrized jupyter notebook with papermill

reportsrender papermill jupyter_notebook.ipynb report.html --params="data_file=table.tsv"

TODO add example notebooks.

Usage from command line

reportsrender

Execute and render a jupyter/Rmarkdown notebook.
The `index` subcommand generates an index html
or markdown file that links to html documents.

Usage:
  reportsrender <notebook> <out_file> [--cpus=<cpus>] [--params=<params>] [--engine=<engine>]
  reportsrender index [--index=<index_file>] [--title=<title>] [--] <html_files>...
  reportsrender --help

Arguments and options:
  <notebook>            Input notebook to be executed. Can be any format supported by jupytext.
  <out_file>            Output HTML file.
  -h --help             Show this screen.
  --cpus=<cpus>         Number of CPUs to use for Numba/Numpy/OpenBLAS/MKL [default: 1]
  --params=<params>     space-separated list of key-value pairs that will be passed
                        to papermill/Rmarkdown.
                        E.g. "input_file=dir/foo.txt output_file=dir2/bar.html"
  --engine=<engine>     Engine to execute the notebook. [default: auto]

Arguments and options of the `index` subcommand:
  <html_files>          List of HTML files that will be included in the index. The tool
                        will generate relative links from the index file to these files.
  --index=<index_file>  Path to the index file that will be generated. Will be
                        overwritten if exists. Will auto-detect markdown (.md) and
                        HTML (.html) format based on the extension. [default: index.html]
  --title=<title>       Headline of the index. [default: Index]

Possible engines are:
  auto                  Use `rmd` engine for `*.Rmd` files, papermill otherwise.
  rmd                   Use `rmarkdown` to execute the notebook. Supports R and
                        python (through reticulate)
  papermill             Use `papermill` to execute the notebook. Works for every
                        kernel available in the jupyter installation.

Installation

Manual install:

Get dependencies:

For the Rmarkdown render engine additionally:

  • R and the following packages:

rmarkdown
reticulate

Install from github:

pip install flit
flit installfrom github:grst/reportsrender

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

reportsrender-0.3.0.tar.gz (818.0 kB view details)

Uploaded Source

Built Distribution

reportsrender-0.3.0-py3-none-any.whl (365.1 kB view details)

Uploaded Python 3

File details

Details for the file reportsrender-0.3.0.tar.gz.

File metadata

  • Download URL: reportsrender-0.3.0.tar.gz
  • Upload date:
  • Size: 818.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for reportsrender-0.3.0.tar.gz
Algorithm Hash digest
SHA256 77f9fb7f0258415138f344fcfa393fe29a9f40db3617c073bcf429a27e899de5
MD5 13b7153d8644b914887c156f01c67434
BLAKE2b-256 6eb30da7a0663397a91224d2f8e423278716432cd4a17e2005d6330215fc5329

See more details on using hashes here.

File details

Details for the file reportsrender-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reportsrender-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bcfddba409161351f1c1e07b3d568c38732c51033b2bf2b15e8fb34d2b17731
MD5 16ba85065646b7cc294edfac754833a8
BLAKE2b-256 325eec7f8978fa5637b9f3c32e9cdfae9ccbd93f5706138234ef88e7bb3c588f

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