Papermill: Execute notebook to HTML

Created on 22 Feb 2019  路  4Comments  路  Source: nteract/papermill

Correct me if I'm wrong, but it's currently not possible to execute a notebook with papermill to get an HTML output.

I find this feature very handy in jupyter nbconvert:

--to=<Unicode> (NbConvertApp.export_format)
    Default: 'html'
    The export format to be used, either one of the built-in formats, or a
    dotted object name that represents the import path for an `Exporter` class

What do you think ?

question

Most helpful comment

Papermill is specialized for helping with with execute notebook to notebook. Usually this is using nbconvert under the covers, but it's possible to use other engines which don't support other formats. If you want the parameterization aspect of papermill but the ability to convert to html you can do:

papermill --prepare-only input.ipynb report.ipynb -y '{"foo":"bar"}' && jupyter nbconvert --to html report.ipynb 

in this case the papermill call will just prepare the notebook for execution rather than actually executing it.

All 4 comments

Papermill is specialized for helping with with execute notebook to notebook. Usually this is using nbconvert under the covers, but it's possible to use other engines which don't support other formats. If you want the parameterization aspect of papermill but the ability to convert to html you can do:

papermill --prepare-only input.ipynb report.ipynb -y '{"foo":"bar"}' && jupyter nbconvert --to html report.ipynb 

in this case the papermill call will just prepare the notebook for execution rather than actually executing it.

Thanks for the reply, this is what I needed.

@MSeal I apologize if this is a stupid / misplaced question, but is there a tool to output HTML with the nteract UI style? If not, what would be a good way to achieve this?

Not a stupid question, but probably better in nbconvert, but the short answer is you'd need to make a new jinja template for nteract UI style. I don't believe anyone has made one yet, so if you took a stab at it or get partway there posting an issue / PR in nbconvert would be the next step. You could also try posting to the nteract slack group to see if anyone else also has interest to make an HTML exporter for that UI style.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MSeal picture MSeal  路  7Comments

hoangthienan95 picture hoangthienan95  路  7Comments

otterotter408 picture otterotter408  路  7Comments

germayneng picture germayneng  路  4Comments

vinaykumar80 picture vinaykumar80  路  8Comments