Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: nbconvert.exporters.export

Module containing single call export functions.

1 Class

class IPython.nbconvert.exporters.export.ExporterNameError

Bases: exceptions.NameError

3 Functions

IPython.nbconvert.exporters.export.export(*args, **kwargs)

Export a notebook object using specific exporter class.

Parameters:

exporter : class:~IPython.nbconvert.exporters.exporter.Exporter class or instance

Class type or instance of the exporter that should be used. If the method initializes it’s own instance of the class, it is ASSUMED that the class type provided exposes a constructor (__init__) with the same signature as the base Exporter class.

nb : NotebookNode

The notebook to export.

config : config (optional, keyword arg)

User configuration instance.

resources : dict (optional, keyword arg)

Resources used in the conversion process.

Returns:

tuple- output, resources, exporter_instance

output : str

Jinja 2 output. This is the resulting converted notebook.

resources : dictionary

Dictionary of resources used prior to and during the conversion process.

exporter_instance : Exporter

Instance of the Exporter class used to export the document. Useful to caller because it provides a ‘file_extension’ property which specifies what extension the output should be saved as.

Notes

WARNING: API WILL CHANGE IN FUTURE RELEASES OF NBCONVERT

IPython.nbconvert.exporters.export.export_by_name(*args, **kwargs)

Export a notebook object to a template type by its name. Reflection (Inspect) is used to find the template’s corresponding explicit export method defined in this module. That method is then called directly.

Parameters:

format_name : str

Name of the template style to export to.

nb : NotebookNode

The notebook to export.

config : config (optional, keyword arg)

User configuration instance.

resources : dict (optional, keyword arg)

Resources used in the conversion process.

Returns:

tuple- output, resources, exporter_instance

output : str

Jinja 2 output. This is the resulting converted notebook.

resources : dictionary

Dictionary of resources used prior to and during the conversion process.

exporter_instance : Exporter

Instance of the Exporter class used to export the document. Useful to caller because it provides a ‘file_extension’ property which specifies what extension the output should be saved as.

Notes

WARNING: API WILL CHANGE IN FUTURE RELEASES OF NBCONVERT

IPython.nbconvert.exporters.export.get_export_names()

Return a list of the currently supported export targets

WARNING: API WILL CHANGE IN FUTURE RELEASES OF NBCONVERT