Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


jupyter notebook export nbconvert

22 Jan 2024 »
from IPython.display import HTML
import nbformat

filename = "01-first-attempt.ipynb"
nb = nbformat.reads(open(filename).read(), as_version=4)

from nbconvert import MarkdownExporter

md = MarkdownExporter(template_name="classic")
(b, r) = md.from_notebook_node(nb)
HTML(f"""
<textarea>{b}</textarea>
""")