Convert IPython notebooks to YAML and vice-versa
Project description
This simple project allows one to convert IPython notebooks to easily editable YAML files. This is very similar to the notedown and ipymd packages but supports all IPython outputs as well.
The advantage of using this package is that you get complete compatibility with IPython notebooks and the ability to edit the files in any text editor.
The format is YAML so it is not as pretty as Markdown but is a reasonable compromise.
An example IPython notebook with the corresponding YAML file both with the outputs and without the outputs is available in the examples directory.
Installation
Install the package as follows:
$ pip install ipyaml
Usage
Run the command ipyaml to convert between the two formats:
$ ipyaml notebook.ipynb notebook.ipyml # or notebook.ipyaml $ ipyaml notebook.ipyml notebook.ipynb
If you do not want to store the cell outputs in your YAML files you may also run the ipyaml script as follows:
$ ipyaml --no-output notebook.ipynb notebook.ipyml
This will not write any of the outputs. By default, all the outputs are also written to the output. Take a look at the output without output to see that it is very easy to manually remove the outputs if they are not desired. Using --no-output does not remove the IPython kernelspec and nbformat metadata at the end of the file but that may also be safely removed if one does not desire it.
If you want jupyter to automatically load and save the .ipyml files. Add the following to your jupyter_notebook_config.py:
c.NotebookApp.contents_manager_class = 'ipyaml.api.YAMLContentsManager'
The jupyter_notebook_config.py can be found by running:
$ jupyter --config-dir
If you don’t see a jupyter_notebook_config.py you can do this:
$ jupyter notebook --generate-config
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
File details
Details for the file ipyaml-0.2.tar.gz
.
File metadata
- Download URL: ipyaml-0.2.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5577ec6b0277ae64ae2cdd576fcf3fbe7a9012b81da2a9190afcf9d9201231d |
|
MD5 | 4b4006c9c6aa822076a68fb3155169a0 |
|
BLAKE2b-256 | 42eba8f7fd127c0931aea34e3d93eeebbc91457e5d556141b78012e16362ca22 |
File details
Details for the file ipyaml-0.2-py2-none-any.whl
.
File metadata
- Download URL: ipyaml-0.2-py2-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60f55ae6dee971c4e4c2b9d44048c7da6c1683b88333e1e55add080097edb04b |
|
MD5 | b484e994631a2158f6aea48bba3c90e3 |
|
BLAKE2b-256 | 762c61310017c5b753a7e88d0483691ef43e1b8f758f6fc92ce3cc690d8073f5 |