跳转到主要内容

执行并渲染笔记本为HTML报告。

项目描述

从Rmarkdown或jupyter笔记本生成可重复的报告

Build Status Documentation Status The uncompromising python formatter

Reportsrender允许从jupyter笔记本和Rmarkdown文件创建可重复、外观一致的HTML报告。它使用papermillRmarkdown来执行笔记本,并使用Pandoc将它们转换为HTML。

功能:
  • 两个执行引擎:papermill和Rmarkdown。

  • 支持jupytext支持的任何格式。

  • 创建可轻松共享的自包含HTML。

  • 隐藏单元格的输入和/或输出。

  • 参数化报告

有关更多详细信息,请参阅文档

入门指南

  • 使用Rmarkdown引擎将rmarkdown文档执行为HTML

reportsrender --engine=rmd my_notebook.Rmd report.html
  • 使用papermill执行参数化的jupyter笔记本

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

命令行使用

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.

安装

手动安装

获取依赖项

对于Rmarkdown渲染引擎(如果您不打算使用Rmarkdown渲染引擎,则无需安装它们)

  • R和以下包

rmarkdown
reticulate

然后,

从pip安装

pip install reportsrender

从GitHub安装

pip install flit
flit installfrom github:grst/reportsrender

项目详情


下载文件

下载适合您平台的文件。如果您不确定该选择哪个,请了解有关安装包的更多信息。

源代码分发

reportsrender-0.3.2.tar.gz (818.8 kB 查看哈希值)

上传时间 源代码

构建分发

reportsrender-0.3.2-py3-none-any.whl (117.6 kB 查看哈希值)

上传时间 Python 3

由以下支持