Jupytext source files

Jupytext is an excellent Python tool for two-way conversion between Jupyter Notebook .ipynb files and a variety of text-based files. Currently, Jupyter Book directly supports one Jupytext file format: notebooks with MyST Markdown).

Note

If you’d like to see support in Jupyter Book for other types of Jupytext source files, such as Python .py files, open an issue and let us know!

Convert a Jupytext file into a MyST notebook

If you’d like to convert your pre-existing Jupytext files into the MyST Notebook format, so that they may be read in with Jupyter Book, install Jupytext and then run the following command:

jupytext --to myst path/to/yourfile

Note that you may also pass a wildcard that will be used to convert multiple files. For example:

jupytext --to myst ./*.py

See the Jupytext CLI documentation for more information.