nbconvert

Jupyter Notebooks: nbconvert configurations being picked up in jupyter_notebook_config.py file?

限于喜欢 提交于 2019-12-11 01:17:52
问题 I have a question, the following two lines, from a config file, are configuration options for nbconvert (http://nbconvert.readthedocs.io/en/latest/config_options.html) Note that they are note listed under notebook configuration options (http://jupyter-notebook.readthedocs.io/en/latest/config.html) c.TemplateExporter.template_path = ['.', "/Users/williamhenry/Library/Jupyter/templates"] c.TemplateExporter.template_file = 'printviewlatex' However, the only way I can actually get these

Run Jupyter Notebook (.ipynb) from command line as if it were a .py file

…衆ロ難τιáo~ 提交于 2019-12-06 08:54:35
问题 I am authoring a Jupyter notebook on my local machine that will eventually be run on a remote server (which is running Ubuntu). Every time I need to make a change I must export the notebook as a .py file and then call it from the command line of the server. I'd like to be able to run this on the fly, calling one command that takes the current .ipynb file and executes it on the command line as if it were a .py , showing all the print statements and output you'd expect if the .py were run. I

Remove cells from Jupyter Notebook with nbconvert

孤街浪徒 提交于 2019-12-06 01:24:13
问题 Recommendations mentioned in How to hide one specific cell (input or output) in IPython Notebook? don't work. On Windows I do the following jupyter nbconvert a.ipynb --TagRemovePreprocessor.remove_cell_tags="{'remove_cell'}" but get an error traitlets.traitlets.TraitError: The 'remove_cell_tags' trait of a TagRemovePreprocessor instance must be a set, but a value of type 'unicode' (i.e. u"{'remove_cell'}") was specified. I also tried '{"remove_cell"}' I am using nbconvert 5.4.0 Any ideas how

Run Jupyter Notebook (.ipynb) from command line as if it were a .py file

随声附和 提交于 2019-12-04 12:36:56
I am authoring a Jupyter notebook on my local machine that will eventually be run on a remote server (which is running Ubuntu). Every time I need to make a change I must export the notebook as a .py file and then call it from the command line of the server. I'd like to be able to run this on the fly, calling one command that takes the current .ipynb file and executes it on the command line as if it were a .py , showing all the print statements and output you'd expect if the .py were run. I thought nbconverter might do the trick using something like the following command: jupyter nbconvert --to

Remove cells from Jupyter Notebook with nbconvert

两盒软妹~` 提交于 2019-12-04 06:04:47
Recommendations mentioned in How to hide one specific cell (input or output) in IPython Notebook? don't work. On Windows I do the following jupyter nbconvert a.ipynb --TagRemovePreprocessor.remove_cell_tags="{'remove_cell'}" but get an error traitlets.traitlets.TraitError: The 'remove_cell_tags' trait of a TagRemovePreprocessor instance must be a set, but a value of type 'unicode' (i.e. u"{'remove_cell'}") was specified. I also tried '{"remove_cell"}' I am using nbconvert 5.4.0 Any ideas how to do this? You need to enable the TagRemovePreprocessor before you call it. The code below shows how

How to remove heading numbers in Jupyter during pdf conversion?

为君一笑 提交于 2019-12-03 06:53:55
问题 When I use the heading tags (# ##, etc) using markdown, they are always converted to numbered sections during pdf-latex conversion. How to indicate unnumbered headings in markdown in Jupyter Notebook (IPython)? I realize this can be done by adding a '*' right next to each section directly in the latex document, but is there any other way to do this? 回答1: You can write an unnumbered heading by appending {-} or {.unnumbered} to the Markdown cell, e.g.: Heading {-} The output is a heading

Right place to put custom nbconvert templates

瘦欲@ 提交于 2019-12-02 01:02:03
问题 I've made a custom nbconvert template and want it to be accessible from any folder where I launch nbconvert utility. Where should I put my template? I couldn't find anything in official docs. I have already tried usual places for jupyter configs, like /usr/share/jupyter , ~/.local/share/jupyter , ~/.jupyter , to no avail. The only place I've found so far is the folder where python package lives: $ pip show nbconvert | grep Location | cut -d" " -f2 /usr/lib/python3.6/site-packages If I create

Best way to print Jupyter notebook slides? How to put a page break?

佐手、 提交于 2019-11-30 15:57:41
I want to print my jupyter notebook and share the hardcopy with non-programmer coworkers. What I have done so far: I've figured out the way to hide the code : How to hide code from cells in ipython notebook visualized with nbviewer? I've figre out the way to convert the notebook to slides(html) Is there a way to print a jupyter/ipython notebook slide presentation? This post also suggests how to convert the html to pdf. My question: How to put a page break to specify the contents on each pdf page? Once I convert the slides(html) to pdf, the text and graph is not at the expected location in pdf.

convert json ipython notebook(.ipynb) to .py file

拜拜、爱过 提交于 2019-11-27 11:48:18
How do you convert an IPython notebook file (json with .ipynb extension) into a regular .py module? From the notebook menu you can save the file directly as a python script. Go to the 'File' option of the menu, then select 'Download as' and there you would see a 'Python (.py)' option. Another option would be to use nbconvert from the command line: jupyter nbconvert --to script 'my-notebook.ipynb' Have a look here . According to https://ipython.org/ipython-doc/3/notebook/nbconvert.html you are looking for the nbconvert command with the --to script option. ipython nbconvert notebook.ipynb --to

IPython notebook: Convert an HTML notebook to ipynb

 ̄綄美尐妖づ 提交于 2019-11-27 11:13:34
问题 I have converted an IPython notebook to HTML format and subsequently lost the original ipynb file. Is there a simple way to generate the original notebook file from the converted HTML file? 回答1: I recently used BeautifulSoup and JSON to convert html notebook to ipynb. the trick is to look at the JSON schema of a notebook and emulate that. The code selects only input code cells and markdown cells here is my code from bs4 import BeautifulSoup import json import urllib.request url = 'http:/