[IPython-User] notebook cell URLs?

Matthias BUSSONNIER bussonniermatthias@gmail....
Fri Sep 28 07:15:10 CDT 2012

Le 28 sept. 2012 à 12:21, Darren Govoni a écrit :

> Thanks for the response Matthias.
> I guess the real need here is to be able to write ipython services and edit them easily like using the notebook.
> I understand what you mean in your response, though. You make good points.
> Perhaps I will use something like mod_python for apache and parse notebooks to generate functional services
> from notebooks or cells, but I agree the idea needs some thinking.

one way to edit stuff through the notebook would be to use 
%load filename 
In one cell, to get the content of a file in the next one

and then use 
%%file filename
To write it back to disk.

To write small python services, I would look at platform like heroku or dotcloud
It is pretty strait forward using flask (for python) for example to spawn a server that associate different services to url.

It basically look like :

@app.route('/< int : firstarg >/modulo/< int : secondarg >')
def do_modulo(firstarg, secondarg):
    return (firstarg % secondarg)

As long as request/response is less that 15s I think (with free plan).
You can spawn as many services as you wish, it's git backed, you can be owner or have collaborators (still free).

This is how nbviewer works in 170 lines, considering that you have to deal with 404, 500, Memcached, 
and special cased some url to recognize them as gists.

> Again, the basic notion is editable ipython services using notebooks to write them.

Well, I understood the term services as "an api way to access formatted data/small computation through a url". 

> Most server side services have to be compiled or written and installed by admins, so that is part of the problem we want to improve.

You might want to see what sage is doing as they are working on one-cell notebook with kernel immediately discarded.

Hope this help. 

More information about the IPython-User mailing list