JUPYTER-NBCONVERT(1)
π jupyter-nbconvert β the manual page, but make it cute π
okay bestie, so jupyter-nbconvert is a User Command, and here's the whole tea: it converts notebook files (*.ipynb) into basically any other format you could want. that's the whole vibe. π¦
β¨ DESCRIPTION β¨
β οΈ WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES. not me telling you to be careful, but likeβ¦ be careful. π«Ά
so here's the thing: all those arguments that take a value? they're actually just β¨convenience aliasesβ¨ for the full Configurables. the aliases are listed on the help line. if you wanna meet the real full configurables, run '--help-all'. it's giving behind-the-scenes lore. π
π the options, bestie π
-yβ answer yes to every question instead of getting prompted. no cap, it just says yes to everything. π--executeβ run the notebook before exporting it. (execution first, export second, main character energy.)--allow-errorsβ keep executing the notebook even if a cell throws an error, and shove that error message into the cell output. the default behaviour is to abort the conversion β so this flag is literally only relevant if'--execute'was specified too. π«Ά--stdoutβ write the notebook output to stdout instead of to files. stream it, don't file it.--debugβ set log level tologging.DEBUG(maximize logging output). it's giving verbose.--inplaceβ run nbconvert in place, overwriting the existing notebook. β οΈ only relevant when converting to notebook format β so don't be out here overwriting things for no reason. π--generate-configβ generate the default config file. so iconic of it.--reveal-prefix=<Unicode>(RevealHelpPreprocessor.url_prefix) β the URL prefix forreveal.js. this can be a relative URL pointing at a local copy ofreveal.js, or it can point at a CDN. heads up though: for speaker notes to work, a localreveal.jsprefix must be used. (default:'reveal.js')--nbformat=<Enum>(NotebookExporter.nbformat_version) β the nbformat version to write. use this to downgrade notebooks. Choices:[1, 2, 3, 4](with default4)--writer=<DottedObjectName>(NbConvertApp.writer_class) β the Writer class used to write the results of the conversion (default:'FilesWriter')--log-level=<Enum>(Application.log_level) β set the log level by value or by name. Choices:(0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')(default:30)--to=<CaselessStrEnum>(NbConvertApp.export_format) β the export format to be used. Choices:['custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides'](default:'html')--template=<Unicode>(TemplateExporter.template_file) β name of the template file to use (default:u'')--output=<Unicode>(NbConvertApp.output_base) β overwrite the base name used for output files. β οΈ can only be used when converting one notebook at a time (default:'').--post=<DottedOrNone>(NbConvertApp.postprocessor_class) β the PostProcessor class used to write the results of the conversion (defaultu'')--config=<Unicode>(JupyterApp.config_file) β full path of a config file (default:u'').
and to see all available configurables, just use --help-all. it's the whole extended universe, iykyk. π
πΈ EXAMPLES πΈ
the simplest way to use nbconvert is literally this:
jupyter nbconvert mynotebook.ipynb
which converts mynotebook.ipynb to the default format (probably HTML). easy, ate, no crumbs. β¨
you can specify the export format with --to. options include ['custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides']
jupyter nbconvert --to latex mynotebook.ipynb
both HTML and LaTeX support multiple output templates. LaTeX includes 'base', 'article' and 'report'. HTML includes 'basic' and 'full'. you can specify the flavor of the format used. π§
jupyter nbconvert --to html --template basic mynotebook.ipynb
you can also pipe the output to stdout, rather than a file:
jupyter nbconvert mynotebook.ipynb --stdout
PDF is generated via latex:
jupyter nbconvert mynotebook.ipynb --to pdf
you can get (and serve) a Reveal.js-powered slideshow:
jupyter nbconvert myslides.ipynb --to slides --post serve
multiple notebooks can be given at the command line in a couple of different ways:
jupyter nbconvert notebook*.ipynb
jupyter nbconvert notebook1.ipynb notebook2.ipynb
or you can specify the notebooks list in a config file, containing::
c.NbConvertApp.notebooks = ["my_notebook.ipynb"]
jupyter nbconvert --config mycfg.py
okay that's the whole page, bestie π this was jupyter-nbconvert, version 4.0.0, dated October 2015 β yeah, she's a vintage queen πβ¨ go convert something cute, mwah! ππ
π¦ where this page comes from
- debian bookworm: jupyter-nbconvert 6.5.3-3 Β· BSD-3-Clause
- debian trixie: jupyter-nbconvert 7.16.6-1+deb13u1 Β· BSD-3-Clause
- ubuntu jammy: jupyter-nbconvert 6.4.0-1 Β· BSD-3-Clause
- ubuntu noble: jupyter-nbconvert 6.5.3-5 Β· BSD-3-Clause
- ubuntu questing: jupyter-nbconvert 7.16.6-1
- ubuntu resolute: jupyter-nbconvert 7.17.0-1 Β· BSD-3-Clause
- ubuntu stonking: jupyter-nbconvert 7.17.1-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms