<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 1:06 PM, Wes Turner <span dir="ltr"><<a href="mailto:wes.turner@gmail.com" target="_blank">wes.turner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Dec 5, 2014 at 2:57 AM, Matthias BUSSONNIER <span dir="ltr"><<a href="mailto:bussonniermatthias@gmail.com" target="_blank">bussonniermatthias@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Andrew.<br>
<br>
Base on a Fernando example would the following python snippet suit you ?<br>
<br>
import IPython.nbformat as nbf<br>
nb = nbf.v4.new_notebook()<br>
text = "This is an auto-generated notebook"<br>
nb['cells'] = [ nbf.v4.new_markdown_cell(text)]<br>
nb['cells'].append(nbf.v4.new_code_cell('#'+text))<br>
fname = 'test.ipynb'<br>
<br>
with open(fname, 'w') as f:<br>
    nbf.write(nb, f, 4)</blockquote><div><br></div></span><div>1. This could be a useful commandline option.</div><div><br></div><div>2. You could accomplish the same with a <a href="https://github.com/audreyr/cookiecutter" target="_blank">https://github.com/audreyr/cookiecutter</a> jinja2 project template.</div><div><br></div><div>    * There could be variations on such a template e.g. with default headings for:</div><div>      * <a href="https://en.wikipedia.org/wiki/Scientific_method#Elements_of_the_scientific_method" target="_blank">https://en.wikipedia.org/wiki/Scientific_method#Elements_of_the_scientific_method</a></div><div>      * { Abstract, Question, Hypothesis, Experiment, Observations/Data, Analysis, Conclusion, ... }</div></div></div></div></blockquote><div><br></div>Really, a reproducible project template could have:<div><br></div><div>* folders for e.g. ./data , ./scripts , ./notebooks {./lib for vendored libraries)</div><div>* a setup.py supporting a necessary directory structure</div><div>* a Makefile (that generates an index with links to nbviewer)</div><div>  * <a href="https://github.com/westurner/notebooks/blob/gh-pages/Makefile">https://github.com/westurner/notebooks/blob/gh-pages/Makefile</a></div><div>  * <a href="https://github.com/westurner/notebooks/blob/gh-pages/makeindex.py">https://github.com/westurner/notebooks/blob/gh-pages/makeindex.py</a></div><div>* an install.sh script</div><div>  * (miniconda; conda create -n py27 python readline pip)</div><div>  * <a href="https://github.com/westurner/notebooks/blob/gh-pages/install.sh">https://github.com/westurner/notebooks/blob/gh-pages/install.sh</a></div><div>* an extension (that I still believe should be included with IPython) that lists the versions of all installed (on the import path) and utilized libraries and extensions</div><div>  * <a href="https://github.com/ipython/ipython/issues/2597">https://github.com/ipython/ipython/issues/2597</a></div><div>  * <a href="https://github.com/rasbt/watermark">https://github.com/rasbt/watermark</a></div><div>  * <a href="https://github.com/jrjohansson/version_information">https://github.com/jrjohansson/version_information</a> </div></div><br></div></div>