What sort of architecture do we need to support integration of IPython Notebooks and Open Design Studio?
Users edit an IPython notebook in a HTML based environment. The HTML environment is published by an IPython server and delivered to the user via a web browser.
The IPython notebook allows users to enter text (using markdown, which can be thought of as a simplified form of HTML) and code.
The code is executed on the server and any output (such as the display of a data table or a the rendering of a chart as a graphic file) is returned to the HTML environment and displayed dynamically within the notebook page.
The raw IPython notebook (it's "source code") is saved as a .ipynb
file using a JSON data format. An HTML view of the notebook can also be exported.
from IPython.display import SVG
SVG(url='http://blockdiag.appspot.com/seqdiag/image?compression=deflate&encoding=base64&src=eJy9kD9PwzAQxfd-ipsaGPoHFlBLu1RURYIKUZhQhiY-tRaubdmXhgjx3TmLUJHiwIY9WO_k37t799YByJwpPTroTeHmvqKt0St0ey48q3WGapJsiexoMDg7v-gPwx1d8knS8Tf2qtfCLg1hZswLCOkwJ-MqUNKT1JumQWvzJZaga5MkhcA0PzI5lwpXlSfcHbCZwzXhgexLW-ksSX_QPHiEjmB_Jn1ALVg2UThZPN7dwl5iedqwac1bD94FV2jIjUDIUanI5Oxga-295IcC92Vz_Yp5wTo4xGP_Aj9ZwVKAD9V468jSPqnjBZiCbEFtIf53_e_wAW2dA1o')
An application known as nbviewer
can accept a .ipynb
file and render it as an HTML file. This does not involve the execution of any code in code cells - it is simple a conversion of the .ipynb
file to an HTML representation of it.
SVG(url='http://blockdiag.appspot.com/seqdiag/image?compression=deflate&encoding=base64&src=eJyr5lJQ0NdXKM7MLchJVcjLL0ksyczPAwomFeWXF6cWKejaKeQllWWmlgPZ0TmJSak5tkruriFwQb3UikSQXr3k_Fz90qIcfWR-XpJeZkFlXpJSrDXQSLg5QDOBRpehmUiERhtddI2oCmGOttHVxXC1ehiQCxTVyyjJzVGP5apVAABp71VT')
Open Design Studio (ODS) provides and environment for sharing resource files, such as an image file.
ODS can also accept a URL to a linked resource, such as a Youtube video ??or a web page?
When working with an uploaded resource such as an image file, the image file is uploaded and stored somewhere by ODS. The image is then displayed in ODS by taking a URL describing the location of the image file and inserting it into some template code that generates the HTML that will render the image.
ODS manages permissions that limit who can see an asset uploaded by a student to ODS. For example, the permissioning system may limit views of the asset to the student, to the student and their AL/tutor, to a student group, or to the whoe cohort associated with a particular course presentation.
ODS can be used to support individual portfolio development (it provides an environment within which the student may curate a collection of work they have produced). It also provides an environment that supports peer review activities in which students can comment and critique each other's work, subject to permission settings associated with uploaded assets.
For TM351, we would like to be able to use ODS to support both personal portfolio development, and peer to peer sharing and commenting, around IPython notebook .ipynb
JSON files.
The proposal is that:
.ipynb
file;.ipynb
file to ODS;.ipynb
file as such and uses and nbviewer
service to generate and HTML version of the notebook, associating this HTML file with the original .ipynb
file. Recall that nbviewer
does not* execute any code described in the .ipynb
file, it simply transforms the JSON data to an HTML rendering of the notebook.*.ipynb
file; (nbviewer
typically renders the HTML view of a notebook with a download link that points to the .ipynb
file used to generate the HTML view);.ipynb
file can now load it into their own interactive IPython notebook environment and work on it as a living notebook document.#In simplified form, the logic were after is something like this
SVG(url='http://blockdiag.appspot.com/seqdiag/image?compression=deflate&encoding=base64&src=eJyNzrEKwjAQxvG9T3FkyRT7ADZO7g5iF3FI6KGH6V1ookXEdzcqOlgE1w9-f75rBVDXkKiPAYElu0zCZfSDjAkHALOAVUReYqI9r_OpI4FtcB4DWFCbGMR1D4he5DijeGGvdvNSmKhSYn8mHEv2VbDqL9iYCdQfeMh90E_3vtwY8-uy1W3JwBeubnAHqbNbDQ')
#More specifically, we might architect it something like this:
SVG('http://blockdiag.appspot.com/seqdiag/image?compression=deflate&encoding=base64&src=eJyr5uJSUEgqyi8vTi1SUNC1U_AvSM1zSS3OTM8LLilNycxXiM5JTErNUbBVUArwDw5R0M9L0sssqMxLUoq1BmrFUA40wiWxJDEpsTgVoVXd0y_YNShEAaZXHbteG11selOgQvoEdANtzksqy0wtB_oEottW3d01BC6oX1qUo4_FMBwuwTALqCOjJDcHuwZC3oboJNPXCM2wmALqwR1RWPXWAgCmaKNr')
Why can't students just save an HTML version of their notebook and upload that to ODS? If students upload an HTML version of the notebook, they won't be able to download the notebook and work with it (edit it, change and execute code cells) in the context of the IPython notebook environment.
Will ODS or associated systems be exposed to executable notebook code?
No - nbviewer
does not execute any code included in notebook code cells - it simply renders the JSON .ipynb
file as an HTML file.