diff --git a/IPython/nbformat/convert.py b/IPython/nbformat/convert.py new file mode 100644 index 0000000..b4c5488 --- /dev/null +++ b/IPython/nbformat/convert.py @@ -0,0 +1,72 @@ +"""API for converting notebooks between versions. + +Authors: + +* Jonathan Frederic +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2013 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import re + +from .reader import get_version, versions + +#----------------------------------------------------------------------------- +# Functions +#----------------------------------------------------------------------------- + +def convert(nb, to_version): + """Convert a notebook node object to a specific version. Assumes that + all the versions starting from 1 to the latest major X are implemented. + In other words, there should never be a case where v1 v2 v3 v5 exist without + a v4. Also assumes that all conversions can be made in one step increments + between major versions and ignores minor revisions. + + PARAMETERS: + ----------- + nb : NotebookNode + to_version : int + Major revision to convert the notebook to. Can either be an upgrade or + a downgrade. + """ + + # Get input notebook version. + (version, version_minor) = get_version(nb) + + # Check if destination is current version, if so return contents + if version == to_version: + return nb + + # If the version exist, try to convert to it one step at a time. + elif to_version in versions: + + # Get the the version that this recursion will convert to as a step + # closer to the final revision. Make sure the newer of the conversion + # functions is used to perform the conversion. + if to_version > version: + step_version = version + 1 + convert_function = versions[step_version].upgrade + else: + step_version = version - 1 + convert_function = versions[version].downgrade + + # Convert and make sure version changed during conversion. + converted = convert_function(nb) + if converted.get('nbformat', 1) == version: + raise Exception("Cannot convert notebook from v%d to v%d. Operation" \ + "failed silently." % (major, step_version)) + + # Recursively convert until target version is reached. + return convert(converted, to_version) + else: + raise Exception("Cannot convert notebook to v%d because that " \ + "version doesn't exist" % (to_version)) diff --git a/IPython/nbformat/current.py b/IPython/nbformat/current.py index 41ebace..06b081a 100644 --- a/IPython/nbformat/current.py +++ b/IPython/nbformat/current.py @@ -3,6 +3,7 @@ Authors: * Brian Granger +* Jonathan Frederic """ #----------------------------------------------------------------------------- @@ -17,14 +18,10 @@ Authors: #----------------------------------------------------------------------------- from __future__ import print_function -import json + from xml.etree import ElementTree as ET import re -from IPython.nbformat import v3 -from IPython.nbformat import v2 -from IPython.nbformat import v1 - from IPython.nbformat.v3 import ( NotebookNode, new_code_cell, new_text_cell, new_notebook, new_output, new_worksheet, @@ -32,6 +29,10 @@ from IPython.nbformat.v3 import ( nbformat_minor, to_notebook_json ) +from .reader import reads as reader_reads +from .reader import versions +from .convert import convert + #----------------------------------------------------------------------------- # Code #----------------------------------------------------------------------------- @@ -43,20 +44,6 @@ current_nbformat_minor = nbformat_minor class NBFormatError(ValueError): pass -class NotJSONError(ValueError): - pass - - -def parse_json(s, **kwargs): - """Parse a string into a (nbformat, dict) tuple.""" - try: - d = json.loads(s, **kwargs) - except ValueError: - raise NotJSONError("Notebook does not appear to be JSON: %r" % s[:16]) - nbf = d.get('nbformat', 1) - nbm = d.get('nbformat_minor', 0) - return nbf, nbm, d - def parse_py(s, **kwargs): """Parse a string into a (nbformat, string) tuple.""" @@ -76,39 +63,26 @@ def parse_py(s, **kwargs): def reads_json(s, **kwargs): """Read a JSON notebook from a string and return the NotebookNode object.""" - nbf, minor, d = parse_json(s, **kwargs) - if nbf == 1: - nb = v1.to_notebook_json(d, **kwargs) - nb = v3.convert_to_this_nbformat(nb, orig_version=1) - elif nbf == 2: - nb = v2.to_notebook_json(d, **kwargs) - nb = v3.convert_to_this_nbformat(nb, orig_version=2) - elif nbf == 3: - nb = v3.to_notebook_json(d, **kwargs) - nb = v3.convert_to_this_nbformat(nb, orig_version=3, orig_minor=minor) - else: - raise NBFormatError('Unsupported JSON nbformat version %s (supported version: %i)' % (nbf, 3)) - return nb + return convert(reader_reads(s), current_nbformat) def writes_json(nb, **kwargs): - return v3.writes_json(nb, **kwargs) + return versions[current_nbformat].writes_json(nb, **kwargs) def reads_py(s, **kwargs): """Read a .py notebook from a string and return the NotebookNode object.""" nbf, nbm, s = parse_py(s, **kwargs) - if nbf == 2: - nb = v2.to_notebook_py(s, **kwargs) - elif nbf == 3: - nb = v3.to_notebook_py(s, **kwargs) + if nbf in (2, 3): + nb = versions[nbf].to_notebook_py(s, **kwargs) else: raise NBFormatError('Unsupported PY nbformat version: %i' % nbf) return nb def writes_py(nb, **kwargs): - return v3.writes_py(nb, **kwargs) + # nbformat 3 is the latest format that supports py + return versions[3].writes_py(nb, **kwargs) # High level API diff --git a/IPython/nbformat/reader.py b/IPython/nbformat/reader.py new file mode 100644 index 0000000..54ec896 --- /dev/null +++ b/IPython/nbformat/reader.py @@ -0,0 +1,107 @@ +"""API for reading notebooks. + +Authors: + +* Jonathan Frederic +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2013 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import json + +import v1 +import v2 +import v3 + +versions = { + 1: v1, + 2: v2, + 3: v3, + } + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +class NotJSONError(ValueError): + pass + +def parse_json(s, **kwargs): + """Parse a JSON string into a dict.""" + try: + nb_dict = json.loads(s, **kwargs) + except ValueError: + # Limit the error message to 80 characters. Display whatever JSON will fit. + raise NotJSONError(("Notebook does not appear to be JSON: %r" % s)[:77] + "...") + return nb_dict + +# High level API + +def get_version(nb): + """Get the version of a notebook. + + Parameters + ---------- + nb : dict + NotebookNode or dict containing notebook data. + + Returns + ------- + Tuple containing major (int) and minor (int) version numbers + """ + major = nb.get('nbformat', 1) + minor = nb.get('nbformat_minor', 0) + return (major, minor) + + +def reads(s, **kwargs): + """Read a notebook from a json string and return the + NotebookNode object. + + This function properly reads notebooks of any version. No version + conversion is performed. + + Parameters + ---------- + s : unicode + The raw unicode string to read the notebook from. + + Returns + ------- + nb : NotebookNode + The notebook that was read. + """ + nb_dict = parse_json(s, **kwargs) + (major, minor) = get_version(nb_dict) + if major in versions: + return versions[major].to_notebook_json(nb_dict, minor=minor) + else: + raise NBFormatError('Unsupported nbformat version %s' % major) + + +def read(fp, **kwargs): + """Read a notebook from a file and return the NotebookNode object. + + This function properly reads notebooks of any version. No version + conversion is performed. + + Parameters + ---------- + fp : file + Any file-like object with a read method. + + Returns + ------- + nb : NotebookNode + The notebook that was read. + """ + return reads(fp.read(), **kwargs) diff --git a/IPython/nbformat/tests/base.py b/IPython/nbformat/tests/base.py new file mode 100644 index 0000000..349006f --- /dev/null +++ b/IPython/nbformat/tests/base.py @@ -0,0 +1,42 @@ +""" +Contains base test class for nbformat +""" +#----------------------------------------------------------------------------- +#Copyright (c) 2013, the IPython Development Team. +# +#Distributed under the terms of the Modified BSD License. +# +#The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import unittest + +import IPython + +#----------------------------------------------------------------------------- +# Classes and functions +#----------------------------------------------------------------------------- + +class TestsBase(unittest.TestCase): + """Base tests class.""" + + def fopen(self, f, mode=u'r'): + return open(os.path.join(self._get_files_path(), f), mode) + + + def _get_files_path(self): + + #Get the relative path to this module in the IPython directory. + names = self.__module__.split(u'.')[1:-1] + + #Build a path using the IPython directory and the relative path we just + #found. + path = IPython.__path__[0] + for name in names: + path = os.path.join(path, name) + return path diff --git a/IPython/nbformat/tests/test2.ipynb b/IPython/nbformat/tests/test2.ipynb new file mode 100644 index 0000000..5a5d17c --- /dev/null +++ b/IPython/nbformat/tests/test2.ipynb @@ -0,0 +1,419 @@ +{ + "metadata": { + "name": "01_notebook_introduction" + }, + "nbformat": 2, + "worksheets": [ + { + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# An introduction to the IPython notebook", + "", + "The IPython web notebook is a frontend that allows for new modes", + "of interaction with IPython: this web-based interface allows you to execute Python and IPython", + "commands in each input cell just like you would at the IPython terminal or Qt console, but you can", + "also save an entire session as a document in a file with the `.ipynb` extension.", + "", + "The document you are reading now is precisely an example of one such notebook, and we will show you", + "here how to best use this new interface.", + "", + "The first thing to understand is that a notebook consists of a sequence of 'cells' that can contain ", + "either text (such as this one) or code meant for execution (such as the next one):", + "", + "* Text cells can be written using [Markdown syntax](http://daringfireball.net/projects/markdown/syntax) ", + "(in a future release we will also provide support for reStructuredText and Sphinx integration, and we ", + "welcome help from interested contributors to make that happen).", + "", + "* Code cells take IPython input (i.e. Python code, `%magics`, `!system calls`, etc) like IPython at", + "the terminal or at the Qt Console. The only difference is that in order to execute a cell, you *must*", + "use `Shift-Enter`, as pressing `Enter` will add a new line of text to the cell. When you type ", + "`Shift-Enter`, the cell content is executed, output displayed and a new cell is created below. Try", + "it now by putting your cursor on the next cell and typing `Shift-Enter`:" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\"This is the new IPython notebook\"" + ], + "language": "python", + "outputs": [ + { + "output_type": "pyout", + "prompt_number": 1, + "text": [ + "'This is the new IPython notebook'" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "markdown", + "source": [ + "You can re-execute the same cell over and over as many times as you want. Simply put your", + "cursor in the cell again, edit at will, and type `Shift-Enter` to execute. ", + "", + "**Tip:** A cell can also be executed", + "*in-place*, where IPython executes its content but leaves the cursor in the same cell. This is done by", + "typing `Ctrl-Enter` instead, and is useful if you want to quickly run a command to check something ", + "before tping the real content you want to leave in the cell. For example, in the next cell, try issuing", + "several system commands in-place with `Ctrl-Enter`, such as `pwd` and then `ls`:" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ls" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "00_notebook_tour.ipynb formatting.ipynb sympy_quantum_computing.ipynb", + "01_notebook_introduction.ipynb python-logo.svg trapezoid_rule.ipynb", + "display_protocol.ipynb sympy.ipynb" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "markdown", + "source": [ + "In a cell, you can type anything from a single python expression to an arbitrarily long amount of code ", + "(although for reasons of readability, you should probably limit this to a few dozen lines):" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def f(x):", + " \"\"\"My function", + " x : parameter\"\"\"", + " ", + " return x+1", + "", + "print \"f(3) = \", f(3)" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "f(3) = 4" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "markdown", + "source": [ + "## User interface", + "", + "When you start a new notebook server with `ipython notebook`, your", + "browser should open into the *Dashboard*, a page listing all notebooks", + "available in the current directory as well as letting you create new", + "notebooks. In this page, you can also drag and drop existing `.py` files", + "over the file list to import them as notebooks (see the manual for ", + "[further details on how these files are ", + "interpreted](http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html)).", + "", + "Once you open an existing notebook (like this one) or create a new one,", + "you are in the main notebook interface, which consists of a main editing", + "area (where these cells are contained) as well as a collapsible left panel, ", + "a permanent header area at the top, and a pager that rises from the", + "bottom when needed and can be collapsed again." + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Main editing area", + "", + "Here, you can move with the arrow keys or using the ", + "scroll bars. The cursor enters code cells immediately, but only selects", + "text (markdown) cells without entering in them; to enter a text cell,", + "use `Enter`, and `Shift-Enter` to exit it again (just like to execute a ", + "code cell)." + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Left panel", + "", + "This panel contains a number of panes that can be", + "collapsed vertically by clicking on their title bar, and the whole panel", + "can also be collapsed by clicking on the vertical divider (note that you", + "can not *drag* the divider, for now you can only click on it).", + "", + "The *Notebook* section contains actions that pertain to the whole notebook,", + "such as downloading the current notebook either in its original format", + "or as a `.py` script, and printing it. When you click the `Print` button,", + "a new HTML page opens with a static copy of the notebook; you can then", + "use your web browser's mechanisms to save or print this file.", + "", + "The *Cell* section lets you manipulate individual cells, and the names should ", + "be fairly self-explanatory.", + "", + "The *Kernel* section lets you signal the kernel executing your code. ", + "`Interrupt` does the equivalent of hitting `Ctrl-C` at a terminal, and", + "`Restart` fully kills the kernel process and starts a fresh one. Obviously", + "this means that all your previous variables are destroyed, but it also", + "makes it easy to get a fresh kernel in which to re-execute a notebook, perhaps", + "after changing an extension module for which Python's `reload` mechanism", + "does not work. If you check the 'Kill kernel upon exit' box, when you ", + "close the page IPython will automatically shut down the running kernel;", + "otherwise the kernels won't close until you stop the whole ", + "", + "The *Help* section contains links to the documentation of some projects", + "closely related to IPython as well as the minimal keybindings you need to", + "know. But you should use `Ctrl-m h` (or click the `QuickHelp` button at", + "the top) and learn some of the other keybindings, as it will make your ", + "workflow much more fluid and efficient.", + "", + "The *Configuration* section at the bottom lets you change some values", + "related to the display of tooltips and the behavior of the tab completer." + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Header bar", + "", + "The header area at the top allows you to rename an existing ", + "notebook and open up a short help tooltip. This area also indicates", + "with a red **Busy** mark on the right whenever the kernel is busy executing", + "code." + ] + }, + { + "cell_type": "markdown", + "source": [ + "### The pager at the bottom", + "", + "Whenever IPython needs to display additional ", + "information, such as when you type `somefunction?` in a cell, the notebook", + "opens a pane at the bottom where this information is shown. You can keep", + "this pager pane open for reference (it doesn't block input in the main area)", + "or dismiss it by clicking on its divider bar." + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Tab completion and tooltips", + "", + "The notebook uses the same underlying machinery for tab completion that ", + "IPython uses at the terminal, but displays the information differently.", + "Whey you complete with the `Tab` key, IPython shows a drop list with all", + "available completions. If you type more characters while this list is open,", + "IPython automatically eliminates from the list options that don't match the", + "new characters; once there is only one option left you can hit `Tab` once", + "more (or `Enter`) to complete. You can also select the completion you", + "want with the arrow keys or the mouse, and then hit `Enter`.", + "", + "In addition, if you hit `Tab` inside of open parentheses, IPython will ", + "search for the docstring of the last object left of the parens and will", + "display it on a tooltip. For example, type `list(` and you will", + "see the docstring for the builtin `list` constructor:" + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [ + "# Position your cursor after the ( and hit the Tab key:", + "list(" + ], + "language": "python", + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## The frontend/kernel model", + "", + "The IPython notebook works on a client/server model where an *IPython kernel*", + "starts in a separate process and acts as a server to executes the code you type,", + "while the web browser provides acts as a client, providing a front end environment", + "for you to type. But one kernel is capable of simultaneously talking to more than", + "one client, and they do not all need to be of the same kind. All IPython frontends", + "are capable of communicating with a kernel, and any number of them can be active", + "at the same time. In addition to allowing you to have, for example, more than one", + "browser session active, this lets you connect clients with different user interface features.", + "", + "For example, you may want to connect a Qt console to your kernel and use it as a help", + "browser, calling `??` on objects in the Qt console (whose pager is more flexible than the", + "one in the notebook). You can start a new Qt console connected to your current kernel by ", + "using the `%qtconsole` magic, this will automatically detect the necessary connection", + "information.", + "", + "If you want to open one manually, or want to open a text console from a terminal, you can ", + "get your kernel's connection information with the `%connect_info` magic:" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%connect_info" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "{", + " \"stdin_port\": 53970, ", + " \"ip\": \"127.0.0.1\", ", + " \"hb_port\": 53971, ", + " \"key\": \"30daac61-6b73-4bae-a7d9-9dca538794d5\", ", + " \"shell_port\": 53968, ", + " \"iopub_port\": 53969", + "}", + "", + "Paste the above JSON into a file, and connect with:", + " $> ipython --existing ", + "or, if you are local, you can connect with just:", + " $> ipython --existing kernel-dd85d1cc-c335-44f4-bed8-f1a2173a819a.json ", + "or even just:", + " $> ipython --existing ", + "if this is the most recent IPython session you have started." + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "markdown", + "source": [ + "## The kernel's `raw_input` and `%debug`", + "", + "The one feature the notebook currently doesn't support as a client is the ability to send data to the kernel's", + "standard input socket. That is, if the kernel requires information to be typed interactively by calling the", + "builtin `raw_input` function, the notebook will be blocked. This happens for example if you run a script", + "that queries interactively for parameters, and very importantly, is how the interactive IPython debugger that ", + "activates when you type `%debug` works.", + "", + "So, in order to be able to use `%debug` or anything else that requires `raw_input`, you can either use a Qt ", + "console or a terminal console:", + "", + "- From the notebook, typing `%qtconsole` finds all the necessary connection data for you.", + "- From the terminal, first type `%connect_info` while still in the notebook, and then copy and paste the ", + "resulting information, using `qtconsole` or `console` depending on which type of client you want." + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Display of complex objects", + "", + "As the 'tour' notebook shows, the IPython notebook has fairly sophisticated display capabilities. In addition", + "to the examples there, you can study the `display_protocol` notebook in this same examples folder, to ", + "learn how to customize arbitrary objects (in your own code or external libraries) to display in the notebook", + "in any way you want, including graphical forms or mathematical expressions." + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Plotting support", + "", + "As we've explained already, the notebook is just another frontend talking to the same IPython kernel that", + "you're already familiar with, so the same options for plotting support apply.", + "", + "If you start the notebook with `--pylab`, you will get matplotlib's floating, interactive windows and you", + "can call the `display` function to paste figures into the notebook document. If you start it with ", + "`--pylab inline`, all plots will appear inline automatically. In this regard, the notebook works identically", + "to the Qt console.", + "", + "Note that if you start the notebook server with pylab support, *all* kernels are automatically started in", + "pylab mode and with the same choice of backend (i.e. floating windows or inline figures). But you can also", + "start the notebook server simply by typing `ipython notebook`, and then selectively turn on pylab support ", + "only for the notebooks you want by using the `%pylab` magic (see its docstring for details)." + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%pylab inline", + "plot(rand(100))" + ], + "language": "python", + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "", + "Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].", + "For more information, type 'help(pylab)'." + ] + }, + { + "output_type": "pyout", + "prompt_number": 5, + "text": [ + "[]" + ] + }, + { + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD3CAYAAAAXDE8fAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztfXuUFdWd7nf63c2jG2hEEEGRNjQan0DjFaFvdJAsos6M\nmkhmnCw0czsmuWASTUImc5XMWomTuXfEMETbleDNqNHJmGRMfA7otO1dCS/Hid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FSvDz58/PKD7W1taGhQsXRnlI4zA0NISbb74Zt99+\nO2666SYA5LzQkg67du3C/Pnzk2xiLPjd736H3/zmNzj//POxYsUKvPrqq7j99tsL8lzMnj0bn/jE\nJ3DDDTegsrISK1aswEsvvVSQ52Lbtm1YuHAhZs+ejUmTJuHWW2/F66+/XpDngkL03emcI4rdu3f7\nnpdICV4mjz6f4TgO7rzzTlx88cW4++67z7ze0NCAjRs3oq+vDxs3biyIm973v/99HDx4EO+//z6e\nfvppfOpTn8Ljjz9ekOcCAOrq6rB161aMjo7i+eefx3XXXVeQ5+Kaa67Bjh070NHRgYGBAbz44otY\nunRpQZ4LCtF3X7BgAV5++WUcOHAALS0tKCoqwrhx47w/TGPGDxctLS3OnDlznAsuuMB56KGHoj6c\nUXj99dedVCrlXHrppc5ll13mXHbZZc6LL75YMClgIrS0tDg33HCD4ziFkw7nxh//+EenoaHBufTS\nS51vfOMbTnd3d8Gei8cee8xZvHixM2/ePOe73/2uMzIyUjDn4rbbbnOmTp3qlJWVOdOnT3c2btzo\n+d3XrVvnXHDBBU59fb3T2trq+/kpxylgs8vCwsIij2GDrBYWFhZ5CkvwFhYWFnkKS/AWFhYWeQpL\n8BYWFhZ5CkvwFhYWFnkKS/AWFhYWeYr/D/Y0b3ewfmEHAAAAAElFTkSuQmCC\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "markdown", + "source": [ + "## Security", + "", + "By default the notebook only listens on localhost, so it does not expose your computer to attacks coming from", + "the internet. By default the notebook does not require any authentication, but you can configure it to", + "ask for a password before allowing access to the files. ", + "", + "Furthermore, you can require the notebook to encrypt all communications by using SSL and making all connections", + "using the https protocol instead of plain http. This is a good idea if you decide to run your notebook on", + "addresses that are visible from the internet. For further details on how to configure this, see the", + "[security section](http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html#security) of the ", + "manual.", + "", + "Finally, note that you can also run a notebook with the `--read-only` flag, which lets you provide access", + "to your notebook documents to others without letting them execute code (which can be useful to broadcast", + "a computation to colleagues or students, for example). The read-only flag behaves differently depending", + "on whether the server has a password or not:", + "", + "- Passwordless server: users directly see all notebooks in read-only mode.", + "- Password-protected server: users can see all notebooks in read-only mode, but a login button is available", + "and once a user authenticates, he or she obtains write/execute privileges.", + "", + "The first case above makes it easy to broadcast on the fly an existing notebook by simply starting a *second* ", + "notebook server in the same directory as the first, but in read-only mode. This can be done without having", + "to configure a password first (which requires calling a hashing function and editing a configuration file)." + ] + }, + { + "cell_type": "code", + "collapsed": true, + "input": [], + "language": "python", + "outputs": [] + } + ] + } + ] +} \ No newline at end of file diff --git a/IPython/nbformat/tests/test3.ipynb b/IPython/nbformat/tests/test3.ipynb new file mode 100644 index 0000000..d63daa0 --- /dev/null +++ b/IPython/nbformat/tests/test3.ipynb @@ -0,0 +1,143 @@ +{ + "metadata": { + "cell_tags": [ + [ + "", + null + ] + ], + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "nbconvert latex test" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus bibendum felis dictum sodales. Ut suscipit, orci ut interdum imperdiet, purus ligula mollis *justo*, non malesuada nisl augue eget lorem. Donec bibendum, erat sit amet porttitor aliquam, urna lorem ornare libero, in vehicula diam diam ut ante. Nam non urna rhoncus, accumsan elit sit amet, mollis tellus. Vestibulum nec tellus metus. Vestibulum tempor, ligula et vehicula rhoncus, sapien turpis faucibus lorem, id dapibus turpis mauris ac orci. Sed volutpat vestibulum venenatis." + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Printed Using Python" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "next_paragraph = \"\"\"\n", + "Aenean vitae diam consectetur, tempus arcu quis, ultricies urna. Vivamus venenatis sem \n", + "quis orci condimentum, sed feugiat dui porta.\n", + "\"\"\"\n", + "\n", + "def nifty_print(text):\n", + " \"\"\"Used to test syntax highlighting\"\"\"\n", + " \n", + " print(text * 2)\n", + "\n", + "nifty_print(next_paragraph)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Aenean vitae diam consectetur, tempus arcu quis, ultricies urna. Vivamus venenatis sem \n", + "quis orci condimentum, sed feugiat dui porta.\n", + "\n", + "Aenean vitae diam consectetur, tempus arcu quis, ultricies urna. Vivamus venenatis sem \n", + "quis orci condimentum, sed feugiat dui porta.\n", + "\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Pyout" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "Text = \"\"\"\n", + "Aliquam blandit aliquet enim, eget scelerisque eros adipiscing quis. Nunc sed metus \n", + "ut lorem condimentum condimentum nec id enim. Sed malesuada cursus hendrerit. Praesent \n", + "et commodo justo. Interdum et malesuada fames ac ante ipsum primis in faucibus. \n", + "Curabitur et magna ante. Proin luctus tellus sit amet egestas laoreet. Sed dapibus \n", + "neque ac nulla mollis cursus. Fusce mollis egestas libero mattis facilisis.\n", + "\"\"\"\n", + "Text" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 2, + "text": [ + "'\\nAliquam blandit aliquet enim, eget scelerisque eros adipiscing quis. Nunc sed metus \\nut lorem condimentum condimentum nec id enim. Sed malesuada cursus hendrerit. Praesent \\net commodo justo. Interdum et malesuada fames ac ante ipsum primis in faucibus. \\nCurabitur et magna ante. Proin luctus tellus sit amet egestas laoreet. Sed dapibus \\nneque ac nulla mollis cursus. Fusce mollis egestas libero mattis facilisis.\\n'" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Image" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from IPython.core.display import Image\n", + "Image(data=\"http://ipython.org/_static/IPy_header.png\")" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "png": "iVBORw0KGgoAAAANSUhEUgAAAggAAABDCAYAAAD5/P3lAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAH3AAAB9wBYvxo6AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURB\nVHic7Z15uBxF1bjfugkJhCWBsCSAJGACNg4QCI3RT1lEAVE+UEBNOmwCDcjHT1wQgU+WD3dFxA1o\nCAikAZFFVlnCjizpsCUjHQjBIAkQlpCFJGS79fvjdGf69vTsc2fuza33eeaZmeqq6jM9vZw6dc4p\nBUwC+tE+fqW1fqmRDpRSHjCggS40sBxYDCxKvL8KzNBaL21EPoPB0DPIWVY/4NlE0ffzYfhgu+Qx\nGHoy/YFjaK+CcB3QkIIAHAWs3wRZsuhUSs0CXgQeBm7UWi/spn0Z+jA5yxpEfYruqnwYllRic5a1\nMaWv8U5gaT4M19Sx396IAnZLfB/SLkEMhp5O/3YL0AvoAHaKXl8HLlZK3QZcpbWe0lbJDOsaHuDU\n0e4u4JAy2wPk/C1JzrKWArOQ0fUtwH35MOysQxaDwbCO0NFuAXoh6wPjgQeUUvcqpUa0WyCDoQls\nCIwBjgfuAV7KWdY+7RWpmJxlXZezrEdylvXxdstiMKzrGAtCYxwI/EspdZbW+g/tFsbQ67kQuBHY\nFNgseh9FV6vCbUAeWBC9PgBeq2EfS6J2MQOBrRDTe5KdgAdzlvW1fBjeUUP/3UbOsoYBE6OvG7VT\nFoOhL9Af+BUwFLkZpV+DaY6V4UPkRpb1+ncT+m8nGwK/V0oN01qf025hDL2XfBi+DLycLMtZVo6u\nCsKfGnSq8/NheEpqHwOBEcDBwJnAsGhTP2ByzrJG5cPwnQb22Sy+0G4BDIa+RH+t9dmlNiqlFKIk\nJJWGi+jq5JPmq8BbJJQArfXqpkncczlbKbVQa/3rdgtiMNRCPgxXAK8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wkk+jztusP7o94Lna7eaoMZU0cVXIAped7eqGZfP2ZqmPFl+ptrVf3n19UpvVMYLRS\nagBywxuEjLwWAe9qrTMXV2mUzs7OP/Xrp+6qt33Hmn5Zue3XNeZTOVoky5nqKiQkrNT883Qk3WvJ\nsMLAc1bbrv9Z5AH6KWRkOB+5wRWlWo7a3Ga7/mOIomAho/GFyI30YeDREru7ELlOq07TG3jONbbr\nT0Nu9KOQm+i/gFsDz3nTdv2fI2FbpdpfHnlpH4LcnHdAlIz5yLErqXgFnvOR7fo28lDYE7lu3kKO\nTdZ9K52xrhTl7knnUVB6SqVeTsr4apQU6lDEbG4hCsFbROsRBE1ebjrwnNB2/XGIGf5gRBkYhPyv\n7yDpjR9MtVkOnGK7/vWIgrFrVPcF4O8ZKbaXIuduWkH6KfL/JbkEsWClfWK2CDzHt10/jzhXjkGO\nyzNIZEiRD00ga3ocaLv+kUh2xo8hSuVURKmIUyiXVGYCWVzKQlJD7xrJNg85b9LX8RLgF6X6SpFU\n9Cpe28gaJgORqEEAbNffDLlvHIQoAndR8NEYilwjExD/nwuUiTQ0GAwGw7qC7fqjEUvKqsBzmhWd\nt05gu/5pyNoifw48J9N5PForxQeeNFMMBoPBYDD0DWL/llvK1In9jt4zCoLBYDAYDH2DePo5MwrJ\ndv0hFPwTnjBRDAaDwWAw9A3+hPgOHRPl25iK+FhsiuR4OARx0Lwf+J1REAwGg8Fg6AMEnvNklL78\nHMRRca/E5hVINNIVwI2B56z6/3ExLRI31pXNAAAAAElFTkSuQmCC\n", + "prompt_number": 6, + "text": [ + "" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/IPython/nbformat/tests/test_convert.py b/IPython/nbformat/tests/test_convert.py new file mode 100644 index 0000000..9eb45ad --- /dev/null +++ b/IPython/nbformat/tests/test_convert.py @@ -0,0 +1,69 @@ +""" +Contains tests class for convert.py +""" +#----------------------------------------------------------------------------- +# Copyright (C) 2013 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +from .base import TestsBase + +from ..convert import convert +from ..reader import read, get_version +from ..current import current_nbformat + +#----------------------------------------------------------------------------- +# Classes and functions +#----------------------------------------------------------------------------- + +class TestConvert(TestsBase): + + def test_downgrade(self): + """Do notebook downgrades work?""" + + # Open a version 3 notebook and attempt to downgrade it to version 2. + with self.fopen(u'test3.ipynb', u'r') as f: + nb = read(f) + nb = convert(nb, 2) + + # Check if downgrade was successful. + (major, minor) = get_version(nb) + self.assertEqual(major, 2) + + + def test_upgrade(self): + """Do notebook upgrades work?""" + + # Open a version 2 notebook and attempt to upgrade it to version 3. + with self.fopen(u'test2.ipynb', u'r') as f: + nb = read(f) + nb = convert(nb, 3) + + # Check if upgrade was successful. + (major, minor) = get_version(nb) + self.assertEqual(major, 3) + + + def test_open_current(self): + """Can an old notebook be opened and converted to the current version + while remembering the original version of the notebook?""" + + # Open a version 2 notebook and attempt to upgrade it to the current version + # while remembering it's version information. + with self.fopen(u'test2.ipynb', u'r') as f: + nb = read(f) + (original_major, original_minor) = get_version(nb) + nb = convert(nb, current_nbformat) + + # Check if upgrade was successful. + (major, minor) = get_version(nb) + self.assertEqual(major, current_nbformat) + + # Check if the original major revision was remembered. + self.assertEqual(original_major, 2) diff --git a/IPython/nbformat/tests/test_current.py b/IPython/nbformat/tests/test_current.py new file mode 100644 index 0000000..8fc99ba --- /dev/null +++ b/IPython/nbformat/tests/test_current.py @@ -0,0 +1,36 @@ +""" +Contains tests class for current.py +""" +#----------------------------------------------------------------------------- +# Copyright (C) 2013 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +from .base import TestsBase + +from ..reader import get_version +from ..current import read, current_nbformat + +#----------------------------------------------------------------------------- +# Classes and functions +#----------------------------------------------------------------------------- + +class TestCurrent(TestsBase): + + def test_read(self): + """Can older notebooks be opened and automatically converted to the current + nbformat?""" + + # Open a version 2 notebook. + with self.fopen(u'test2.ipynb', u'r') as f: + nb = read(f, u'json') + + # Check that the notebook was upgraded to the latest version automatically. + (major, minor) = get_version(nb) + self.assertEqual(major, current_nbformat) diff --git a/IPython/nbformat/tests/test_reader.py b/IPython/nbformat/tests/test_reader.py new file mode 100644 index 0000000..9b5f9b8 --- /dev/null +++ b/IPython/nbformat/tests/test_reader.py @@ -0,0 +1,38 @@ +""" +Contains tests class for reader.py +""" +#----------------------------------------------------------------------------- +# Copyright (C) 2013 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +from .base import TestsBase + +from ..reader import read, get_version + +#----------------------------------------------------------------------------- +# Classes and functions +#----------------------------------------------------------------------------- + +class TestReader(TestsBase): + + def test_read(self): + """Can older notebooks be opened without modification?""" + + # Open a version 3 notebook. Make sure it is still version 3. + with self.fopen(u'test3.ipynb', u'r') as f: + nb = read(f) + (major, minor) = get_version(nb) + self.assertEqual(major, 3) + + # Open a version 2 notebook. Make sure it is still version 2. + with self.fopen(u'test2.ipynb', u'r') as f: + nb = read(f) + (major, minor) = get_version(nb) + self.assertEqual(major, 2) diff --git a/IPython/nbformat/v1/__init__.py b/IPython/nbformat/v1/__init__.py index fb11ea5..b3a51a6 100644 --- a/IPython/nbformat/v1/__init__.py +++ b/IPython/nbformat/v1/__init__.py @@ -20,5 +20,4 @@ from .nbjson import reads as reads_json, writes as writes_json from .nbjson import reads as read_json, writes as write_json from .nbjson import to_notebook as to_notebook_json -from .convert import convert_to_this_nbformat - +from .convert import upgrade diff --git a/IPython/nbformat/v1/convert.py b/IPython/nbformat/v1/convert.py index 6cc7556..303b604 100644 --- a/IPython/nbformat/v1/convert.py +++ b/IPython/nbformat/v1/convert.py @@ -11,6 +11,6 @@ # Code #----------------------------------------------------------------------------- -def convert_to_this_nbformat(nb, orig_version=None): +def upgrade(nb, orig_version=None): raise ValueError('Cannot convert to v1 notebook format') diff --git a/IPython/nbformat/v2/__init__.py b/IPython/nbformat/v2/__init__.py index 8e41b05..d675488 100644 --- a/IPython/nbformat/v2/__init__.py +++ b/IPython/nbformat/v2/__init__.py @@ -34,7 +34,7 @@ from .nbpy import reads as reads_py, writes as writes_py from .nbpy import reads as read_py, writes as write_py from .nbpy import to_notebook as to_notebook_py -from .convert import convert_to_this_nbformat +from .convert import downgrade, upgrade #----------------------------------------------------------------------------- # Code diff --git a/IPython/nbformat/v2/convert.py b/IPython/nbformat/v2/convert.py index f5532a4..bf23383 100644 --- a/IPython/nbformat/v2/convert.py +++ b/IPython/nbformat/v2/convert.py @@ -3,6 +3,7 @@ Authors: * Brian Granger +* Jonathan Frederic """ #----------------------------------------------------------------------------- @@ -24,7 +25,7 @@ from .nbbase import ( # Code #----------------------------------------------------------------------------- -def convert_to_this_nbformat(nb, orig_version=1): +def upgrade(nb, from_version=1): """Convert a notebook to the v2 format. Parameters @@ -48,3 +49,13 @@ def convert_to_this_nbformat(nb, orig_version=1): else: raise ValueError('Cannot convert a notebook from v%s to v2' % orig_version) + +def downgrade(nb): + """Convert a v2 notebook to v1. + + Parameters + ---------- + nb : NotebookNode + The Python representation of the notebook to convert. + """ + raise Exception("Downgrade from notebook v2 to v1 is not supported.") diff --git a/IPython/nbformat/v3/__init__.py b/IPython/nbformat/v3/__init__.py index d3838e3..2bcc4bc 100644 --- a/IPython/nbformat/v3/__init__.py +++ b/IPython/nbformat/v3/__init__.py @@ -30,7 +30,7 @@ from .nbpy import reads as reads_py, writes as writes_py from .nbpy import reads as read_py, writes as write_py from .nbpy import to_notebook as to_notebook_py -from .convert import convert_to_this_nbformat +from .convert import downgrade, upgrade #----------------------------------------------------------------------------- # Code diff --git a/IPython/nbformat/v3/convert.py b/IPython/nbformat/v3/convert.py index 6421b80..377a2e2 100644 --- a/IPython/nbformat/v3/convert.py +++ b/IPython/nbformat/v3/convert.py @@ -3,6 +3,8 @@ Authors: * Brian Granger +* Min RK +* Jonathan Frederic """ #----------------------------------------------------------------------------- @@ -27,33 +29,62 @@ from IPython.nbformat import v2 # Code #----------------------------------------------------------------------------- -def convert_to_this_nbformat(nb, orig_version=2, orig_minor=0): - """Convert a notebook to the v3 format. +def upgrade(nb, from_version=2, from_minor=0): + """Convert a notebook to v3. Parameters ---------- nb : NotebookNode The Python representation of the notebook to convert. - orig_version : int + from_version : int The original version of the notebook to convert. - orig_minor : int + from_minor : int The original minor version of the notebook to convert (only relevant for v >= 3). """ - if orig_version == 1: - nb = v2.convert_to_this_nbformat(nb) - orig_version = 2 - if orig_version == 2: + if from_version == 2: # Mark the original nbformat so consumers know it has been converted. nb.nbformat = nbformat nb.nbformat_minor = nbformat_minor nb.orig_nbformat = 2 return nb - elif orig_version == 3: - if orig_minor != nbformat_minor: - nb.orig_nbformat_minor = orig_minor + elif from_version == 3: + if from_minor != nbformat_minor: + nb.orig_nbformat_minor = from_minor nb.nbformat_minor = nbformat_minor return nb else: - raise ValueError('Cannot convert a notebook from v%s to v3' % orig_version) + raise ValueError('Cannot convert a notebook directly from v%s to v3. ' \ + 'Try using the IPython.nbformat.convert module.' % from_version) + +def heading_to_md(cell): + """turn heading cell into corresponding markdown""" + cell.cell_type = "markdown" + level = cell.pop('level', 1) + cell.source = '#'*level + ' ' + cell.source + + +def raw_to_md(cell): + """let raw passthrough as markdown""" + cell.cell_type = "markdown" + + +def downgrade(nb): + """Convert a v3 notebook to v2. + + Parameters + ---------- + nb : NotebookNode + The Python representation of the notebook to convert. + """ + if nb.nbformat != 3: + return nb + nb.nbformat = 2 + for ws in nb.worksheets: + for cell in ws.cells: + if cell.cell_type == 'heading': + heading_to_md(cell) + elif cell.cell_type == 'raw': + raw_to_md(cell) + return nb \ No newline at end of file diff --git a/setupbase.py b/setupbase.py index 9660d0a..7bfdf08 100644 --- a/setupbase.py +++ b/setupbase.py @@ -159,7 +159,8 @@ def find_package_data(): 'IPython.nbconvert' : ['templates/*.tpl', 'templates/latex/*.tplx', 'templates/latex/skeleton/*.tplx', 'templates/skeleton/*', 'templates/reveal_internals/*.tpl', 'tests/files/*.*', - 'exporters/tests/files/*.*'] + 'exporters/tests/files/*.*'], + 'IPython.nbformat' : ['tests/*.ipynb'] } return package_data