No working examples for NbConvertApp

20 views
Skip to first unread message

Rick Gerkin

unread,
Sep 28, 2017, 5:00:54 PM9/28/17
to Project Jupyter
I am trying to use the Python API to convert notebooks from within a program.  I have no problem using the command line nbconvert, but can't find any examples anywhere of NbConvertApp used (rather than documented).  Does someone know what the Python equivalent of this command line statement would be:  

jupyter nbconvert --to python my_notebook.ipynb

I am trying things like:  

from nbconvert import nbconvertapp
x.convert_single_notebook('my_notebook.ipynb')

but am getting errors that do not occur on the command line.  It would be useful if the documentation had a few or even one example(s) of this API in use.  

Thanks,  
Rick  

Thomas Kluyver

unread,
Sep 28, 2017, 5:11:11 PM9/28/17
to Project Jupyter
In short: don't use NbConvertApp. The application machinery is there to support the command line interface. If you're using it from Python code, use an exporter object instead, as described here:

http://nbconvert.readthedocs.io/en/latest/nbconvert_library.html

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/ea407c58-af56-499c-92ff-5b10957270db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages