Jupyter bundler extension to export notebook as a docx file
Make sure you have Pandoc installed.
pip install jupyter_docx_bundler
jupyter bundlerextension enable --py jupyter_docx_bundler --sys-prefix
conda install -c mrossi jupyter_docx_bundler
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.
You can hide individual code cells or just their inputs by defining cell tags:
nbconvert-remove-cell
: Remove the entire cellnbconvert-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.
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.
The package is tested with pytest. Clone the repository and install the requirements for example with conda:
conda install --file requirements.txt --file requirements_test.txt
Test the package with
pytest .
To build the package with conda-build you need to call
conda-build conda.recipe
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。