Jupyter bundler extension to export notebook as a docx file
Project description
Jupyter docx bundler extension
Jupyter bundler extension to export notebook as a docx file
Install
Installing with 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
Installing with conda
conda install -c conda-forge jupyter-docx-bundler
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 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.
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
Testing
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 .
Building
To build the package with conda-build you need to call
conda-build conda.recipe
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jupyter-docx-bundler-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dbb52c1670d9acaf0d06effc5b10fecc76257a47ab080953976ab3d65731378 |
|
MD5 | 6e14933456dac4f57868025d666e1423 |
|
BLAKE2b-256 | eaed2fddc260d853457b54fd67a4a7bd5c04b285e7ad9904885e90cff49194fc |
Hashes for jupyter_docx_bundler-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db21e55ecdeaa0d53d3e65dfcdaae86f47d688beb3dbb37d0da1742d164c5e54 |
|
MD5 | e2d4885afcdaaec5727977cee463e59f |
|
BLAKE2b-256 | 067e4b15c3e27082ed8edf9a13d3b6146d40eecf2dc86c93195e2d001148500e |