Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Jupyter bundler extension to export notebook as a docx file

Project description

Jupyter docx bundler extension

PyPi Version Conda Version Build Status Coverage

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 mrossi 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 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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jupyter-docx-bundler, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size jupyter_docx_bundler-0.2.1-py3-none-any.whl (10.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size jupyter-docx-bundler-0.2.1.tar.gz (11.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page