-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Followup from twitter #1
Comments
So the usecase here is the ability to render notebooks seamlessly within an existing site/framework, abstracting the fact a page has been developed as a notebook. Kind of like a scientific CMS where the IPython Notebook server is the WYSIWYG editor. So if a notebook is doing some analysis that draws data from a source that is continually updating i.e. stock data, then the rendered view should show the upto date analysis.
This would be excellent, especially if combined with the ability to only display markdown and output cells.
Not a case of doing better. The Once the preprocessor for executing notebooks is merged and a simple API for filtering notebooks (markdown, code, output) exists then it should be pretty easy to embed (up to date views of) notebooks as pages. Which is what this POC tries to achieve:
The @app.route("/notebook/<notebook>")
def notebook(notebook):
try:
notebook = nbf.read(open('notebooks/%s' % notebook, 'r'), 'ipynb')
except IOError:
abort(418)
html_notebook= convert_nb_html(notebook)
return render_template('notebook.html', content=html_notebook, notebooks=g.get('nbs')) What I mean by
The
I simply meant that to edit pages in the flask site is as easy as going to the If this approach works with Widgets this becomes very powerful. Although I don't see this being so straight forward. |
Oh, ok I better understand. If you use nbviewer you have a
There might be a lot of indirection but in final that whats nbviewer does, even if it does not look like it :-)
Widget will be complicated to render on nbviewer, but we are working on it.
You could write your own preprocessor for nbconvert, publish it on PyPi, and a simple configuration line can allow to insert it into nbconvert pipeline. You don't have to wait for IPython to integrate all imaginable preprocessors, and also we won't include all imaginable preprocessors. |
Awesome! I've been thinking lately about how you could pass in parameter values before running a notebook. For example a notebook that does some weather analysis for a given year, you would want to pass in the year of choice before the notebook code gets executed. I just pushed an example of one way this can be achieved, it's not safe in the slightest and a little brittle but allows some parameter to be injected. |
You should have a look at runipy that allow similar functionality and already merged with some other projects. |
Yep, I used flask at the beginning of nbviewer, but we definitively need something async
to handle many requests in parallel hence we moved to tornado.
Cool, using ipython/ipython#5639 and ipython/ipython#5720 nbconvert should get the ability to run the notebook on the fly which will then only be a config option on nbviewer.
your input on it would be great. It won't be enable by default for obvious performance reasons, and also because most of the time we won't get the library installed.
Yes, work great locally for me.
I'm not sure I get what you mean here. Can you develop ? Do you think we can do better in nbviewer itself ?
I do not get that either, do you mean that your app is serving files from the local filesystem ?
The text was updated successfully, but these errors were encountered: