• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

m-rossi/jupyter-docx-bundler: Jupyter bundler extension to export notebook as a ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

m-rossi/jupyter-docx-bundler

开源软件地址:

https://github.com/m-rossi/jupyter-docx-bundler

开源编程语言:

Python 98.8%

开源软件介绍:

Jupyter docx bundler extension

PyPi Version Conda Version Conda Version CI codecov

Jupyter bundler extension to export notebook as a docx file

Installation

Using conda

conda install -c conda-forge jupyter-docx-bundler

Using pip

Make sure you have Pandoc installed, see installing-pandoc for instructions.

pip install jupyter-docx-bundler
jupyter bundlerextension enable --py jupyter_docx_bundler --sys-prefix

Usage

Adding Metadata

The bundle extension uses metadata of the notebook, if you you provide it.

  • "title": "Notebook title"
  • "authors": [{"name": "author1"}, {"name": "author2"}]
  • "subtitle": "Notebook subtitle"
  • "date": "Notebook date"

The notebook metadata can be edited under Edit -> Edit Notebook Metadata.

Hiding inputs or complete code cells

You can hide individual code cells or just their inputs by defining cell tags:

  • nbconvert-remove-cell: Remove the entire cell
  • nbconvert-remove-input: Remove the input code of the cell

(Currently there are no default values configured for these tags, the ones listed above are defined in my code and not in nbconvert. This may will change in the future.)

Cell tags can be shown by activating the cell toolbar under View -> Cell Toolbar -> Tags.

Hiding all inputs

It is also possible to hide all inputs. To achive this you need to add the following lines to your notebook metadata:

{
    "jupyter-docx-bundler": {
        "exclude_input": "True"
    }
}

The notebook metadata can be edited under Edit -> Edit Notebook Metadata.

Direct call from console (nbconvert)

To use the bundler direct from console the nbconvert utility can be used with target format docx:

  • jupyter nbconvert --execute --to=docx <source notebook>.ipynb --output <target document>.docx

The --execute option should be used to ensure that the notebook is run before generation.

Development

See CONTRIBUTING




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap