diff --git a/docs/source/index.rst b/docs/source/index.rst index 4e3f07b..45c3d8f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -25,7 +25,6 @@ Contents whatsnew/index install/index interactive/index - notebook/index config/index development/index api/index diff --git a/docs/source/notebook/index.rst b/docs/source/notebook/index.rst deleted file mode 100644 index 19de406..0000000 --- a/docs/source/notebook/index.rst +++ /dev/null @@ -1,13 +0,0 @@ -==================== -The IPython notebook -==================== - -.. toctree:: - :maxdepth: 2 - - notebook - nbformat - nbconvert - public_server - security - diff --git a/docs/source/notebook/ipython_security.asc b/docs/source/notebook/ipython_security.asc deleted file mode 100644 index 9543681..0000000 --- a/docs/source/notebook/ipython_security.asc +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v2.0.22 (GNU/Linux) - -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 -5vmLc+Ibz+eT+rM= -=XVDe ------END PGP PUBLIC KEY BLOCK----- diff --git a/docs/source/notebook/nbconvert.rst b/docs/source/notebook/nbconvert.rst deleted file mode 100644 index fdd79be..0000000 --- a/docs/source/notebook/nbconvert.rst +++ /dev/null @@ -1,168 +0,0 @@ -.. _nbconvert: - -Converting notebooks to other formats -===================================== - -Newly added in the 1.0 release of IPython is the ``nbconvert`` tool, which -allows you to convert an ``.ipynb`` notebook document file into various static -formats. - -Currently, ``nbconvert`` is provided as a command line tool, run as a script -using IPython. A direct export capability from within the -IPython Notebook web app is planned. - -The command-line syntax to run the ``nbconvert`` script is:: - - $ ipython nbconvert --to FORMAT notebook.ipynb - -This will convert the IPython document file ``notebook.ipynb`` into the output -format given by the ``FORMAT`` string. - -The default output format is html, for which the ``--to`` argument may be -omitted:: - - $ ipython nbconvert notebook.ipynb - -IPython provides a few templates for some output formats, and these can be -specified via an additional ``--template`` argument. - -The currently supported export formats are: - -* ``--to html`` - - - ``--template full`` (default) - - A full static HTML render of the notebook. - This looks very similar to the interactive view. - - - ``--template basic`` - - Simplified HTML, useful for embedding in webpages, blogs, etc. - This excludes HTML headers. - -* ``--to latex`` - - Latex export. This generates ``NOTEBOOK_NAME.tex`` file, - ready for export. - - - ``--template article`` (default) - - Latex article, derived from Sphinx's howto template. - - - ``--template report`` - - Latex report, providing a table of contents and chapters. - - - ``--template basic`` - - Very basic latex output - mainly meant as a starting point for custom templates. - -* ``--to pdf`` - - Generates a PDF via latex. Supports the same templates as ``--to latex``. - -* ``--to slides`` - - This generates a Reveal.js HTML slideshow. - It must be served by an HTTP server. The easiest way to do this is adding - ``--post serve`` on the command-line. The ``serve`` post-processor proxies - Reveal.js requests to a CDN if no local Reveal.js library is present. - To make slides that don't require an internet connection, just place the - Reveal.js library in the same directory where your_talk.slides.html is located, - or point to another directory using the ``--reveal-prefix`` alias. - -* ``--to markdown`` - - Simple markdown output. Markdown cells are unaffected, - and code cells indented 4 spaces. - -* ``--to rst`` - - Basic reStructuredText output. Useful as a starting point for embedding notebooks - in Sphinx docs. - -* ``--to script`` - - Convert a notebook to an executable script. - This is the simplest way to get a Python (or other language, depending on the kernel) script out of a notebook. - If there were any magics in an IPython notebook, this may only be executable from - an IPython session. - -* ``--to notebook`` - - .. versionadded:: 3.0 - - This doesn't convert a notebook to a different format *per se*, - instead it allows the running of nbconvert preprocessors on a notebook, - and/or conversion to other notebook formats. For example:: - - ipython nbconvert --to notebook --execute mynotebook.ipynb - - will open the notebook, execute it, capture new output, and save the result in - :file:`mynotebook.nbconvert.ipynb`. - - :: - - ipython nbconvert --to notebook --nbformat 3 mynotebook - - will create a copy of :file:`mynotebook.ipynb` in :file:`mynotebook.v3.ipynb` - in version 3 of the :ref:`notebook format `. - - If you want to convert a notebook in-place, - you can specify the ouptut file to be the same as the input file:: - - ipython nbconvert --to notebook mynb --output mynb - - Be careful with that, since it will replace the input file. - -.. note:: - - nbconvert uses pandoc_ to convert between various markup languages, - so pandoc is a dependency when converting to latex or reStructuredText. - -.. _pandoc: http://johnmacfarlane.net/pandoc/ - -The output file created by ``nbconvert`` will have the same base name as -the notebook and will be placed in the current working directory. Any -supporting files (graphics, etc) will be placed in a new directory with the -same base name as the notebook, suffixed with ``_files``:: - - $ ipython nbconvert notebook.ipynb - $ ls - notebook.ipynb notebook.html notebook_files/ - -For simple single-file output, such as html, markdown, etc., -the output may be sent to standard output with:: - - $ ipython nbconvert --to markdown notebook.ipynb --stdout - -Multiple notebooks can be specified from the command line:: - - $ ipython nbconvert notebook*.ipynb - $ ipython nbconvert notebook1.ipynb notebook2.ipynb - -or via a list in a configuration file, say ``mycfg.py``, containing the text:: - - c = get_config() - c.NbConvertApp.notebooks = ["notebook1.ipynb", "notebook2.ipynb"] - -and using the command:: - - $ ipython nbconvert --config mycfg.py - - -LaTeX citations ---------------- - -``nbconvert`` now has support for LaTeX citations. With this capability you -can: - -* Manage citations using BibTeX. -* Cite those citations in Markdown cells using HTML data attributes. -* Have ``nbconvert`` generate proper LaTeX citations and run BibTeX. - -For an example of how this works, please see the citations example in -the nbconvert-examples_ repository. - -.. _nbconvert-examples: https://github.com/ipython/nbconvert-examples - diff --git a/docs/source/notebook/nbformat.rst b/docs/source/notebook/nbformat.rst deleted file mode 100644 index 115e772..0000000 --- a/docs/source/notebook/nbformat.rst +++ /dev/null @@ -1,358 +0,0 @@ -.. _nbformat: - -=========================== -The Jupyter Notebook Format -=========================== - -Introduction -============ - -Jupyter (né IPython) notebook files are simple JSON documents, -containing text, source code, rich media output, and metadata. -each segment of the document is stored in a cell. - -Some general points about the notebook format: - -.. note:: - - *All* metadata fields are optional. - While the type and values of some metadata are defined, - no metadata values are required to be defined. - - -Top-level structure -=================== - -At the highest level, a Jupyter notebook is a dictionary with a few keys: - -- metadata (dict) -- nbformat (int) -- nbformat_minor (int) -- cells (list) - -.. sourcecode:: python - - { - "metadata" : { - "signature": "hex-digest", # used for authenticating unsafe outputs on load - "kernel_info": { - # if kernel_info is defined, its name field is required. - "name" : "the name of the kernel" - }, - "language_info": { - # if language_info is defined, its name field is required. - "name" : "the programming language of the kernel", - "version": "the version of the language", - "codemirror_mode": "The name of the codemirror mode to use [optional]" - } - }, - "nbformat": 4, - "nbformat_minor": 0, - "cells" : [ - # list of cell dictionaries, see below - ], - } - -Some fields, such as code input and text output, are characteristically multi-line strings. -When these fields are written to disk, they **may** be written as a list of strings, -which should be joined with ``''`` when reading back into memory. -In programmatic APIs for working with notebooks (Python, Javascript), -these are always re-joined into the original multi-line string. -If you intend to work with notebook files directly, -you must allow multi-line string fields to be either a string or list of strings. - - -Cell Types -========== - -There are a few basic cell types for encapsulating code and text. -All cells have the following basic structure: - -.. sourcecode:: python - - { - "cell_type" : "name", - "metadata" : {}, - "source" : "single string or [list, of, strings]", - } - - -Markdown cells --------------- - -Markdown cells are used for body-text, and contain markdown, -as defined in `GitHub-flavored markdown`_, and implemented in marked_. - -.. _GitHub-flavored markdown: https://help.github.com/articles/github-flavored-markdown -.. _marked: https://github.com/chjj/marked - -.. sourcecode:: python - - { - "cell_type" : "markdown", - "metadata" : {}, - "source" : ["some *markdown*"], - } - -.. versionchanged:: nbformat 4.0 - - Heading cells have been removed, in favor of simple headings in markdown. - - -Code cells ----------- - -Code cells are the primary content of Jupyter notebooks. -They contain source code in the language of the document's associated kernel, -and a list of outputs associated with executing that code. -They also have an execution_count, which must be an integer or ``null``. - -.. sourcecode:: python - - { - "cell_type" : "code", - "execution_count": 1, # integer or null - "metadata" : { - "collapsed" : True, # whether the output of the cell is collapsed - "autoscroll": False, # any of true, false or "auto" - }, - "source" : ["some code"], - "outputs": [{ - # list of output dicts (described below) - "output_type": "stream", - ... - }], - } - -.. versionchanged:: nbformat 4.0 - - ``input`` was renamed to ``source``, for consistency among cell types. - -.. versionchanged:: nbformat 4.0 - - ``prompt_number`` renamed to ``execution_count`` - -Code cell outputs ------------------ - -A code cell can have a variety of outputs (stream data or rich mime-type output). -These correspond to :ref:`messages ` produced as a result of executing the cell. - -All outputs have an ``output_type`` field, -which is a string defining what type of output it is. - - -stream output -************* - -.. sourcecode:: python - - { - "output_type" : "stream", - "name" : "stdout", # or stderr - "text" : ["multiline stream text"], - } - -.. versionchanged:: nbformat 4.0 - - The keys ``stream`` key was changed to ``name`` to match - the stream message. - - -display_data -************ - -Rich display outputs, as created by ``display_data`` messages, -contain data keyed by mime-type. This is often called a mime-bundle, -and shows up in various locations in the notebook format and message spec. -The metadata of these messages may be keyed by mime-type as well. - - - -.. sourcecode:: python - - { - "output_type" : "display_data", - "data" : { - "text/plain" : ["multiline text data"], - "image/png": ["base64-encoded-png-data"], - "application/json": { - # JSON data is included as-is - "json": "data", - }, - }, - "metadata" : { - "image/png": { - "width": 640, - "height": 480, - }, - }, - } - - -.. versionchanged:: nbformat 4.0 - - ``application/json`` output is no longer double-serialized into a string. - -.. versionchanged:: nbformat 4.0 - - mime-types are used for keys, instead of a combination of short names (``text``) - and mime-types, and are stored in a ``data`` key, rather than the top-level. - i.e. ``output.data['image/png']`` instead of ``output.png``. - - -execute_result -************** - -Results of executing a cell (as created by ``displayhook`` in Python) -are stored in ``execute_result`` outputs. -`execute_result` outputs are identical to ``display_data``, -adding only a ``execution_count`` field, which must be an integer. - -.. sourcecode:: python - - { - "output_type" : "execute_result", - "execution_count": 42, - "data" : { - "text/plain" : ["multiline text data"], - "image/png": ["base64-encoded-png-data"], - "application/json": { - # JSON data is included as-is - "json": "data", - }, - }, - "metadata" : { - "image/png": { - "width": 640, - "height": 480, - }, - }, - } - -.. versionchanged:: nbformat 4.0 - - ``pyout`` renamed to ``execute_result`` - -.. versionchanged:: nbformat 4.0 - - ``prompt_number`` renamed to ``execution_count`` - - -error -***** - -Failed execution may show a traceback - -.. sourcecode:: python - - { - 'ename' : str, # Exception name, as a string - 'evalue' : str, # Exception value, as a string - - # The traceback will contain a list of frames, - # represented each as a string. - 'traceback' : list, - } - -.. versionchanged:: nbformat 4.0 - - ``pyerr`` renamed to ``error`` - - -.. _raw nbconvert cells: - -Raw NBConvert cells -------------------- - -A raw cell is defined as content that should be included *unmodified* in :ref:`nbconvert ` output. -For example, this cell could include raw LaTeX for nbconvert to pdf via latex, -or restructured text for use in Sphinx documentation. - -The notebook authoring environment does not render raw cells. - -The only logic in a raw cell is the `format` metadata field. -If defined, it specifies which nbconvert output format is the intended target -for the raw cell. When outputting to any other format, -the raw cell's contents will be excluded. -In the default case when this value is undefined, -a raw cell's contents will be included in any nbconvert output, -regardless of format. - -.. sourcecode:: python - - { - "cell_type" : "raw", - "metadata" : { - # the mime-type of the target nbconvert format. - # nbconvert to formats other than this will exclude this cell. - "format" : "mime/type" - }, - "source" : ["some nbformat mime-type data"] - } - -Backward-compatible changes -=========================== - -The notebook format is an evolving format. When backward-compatible changes are made, -the notebook format minor version is incremented. When backward-incompatible changes are made, -the major version is incremented. - -As of nbformat 4.x, backward-compatible changes include: - -- new fields in any dictionary (notebook, cell, output, metadata, etc.) -- new cell types -- new output types - -New cell or output types will not be rendered in versions that do not recognize them, -but they will be preserved. - -Metadata -======== - -Metadata is a place that you can put arbitrary JSONable information about -your notebook, cell, or output. Because it is a shared namespace, -any custom metadata should use a sufficiently unique namespace, -such as `metadata.kaylees_md.foo = "bar"`. - -Metadata fields officially defined for Jupyter notebooks are listed here: - -Notebook metadata ------------------ - -The following metadata keys are defined at the notebook level: - -=========== =============== ============== -Key Value Interpretation -=========== =============== ============== -kernelspec dict A :ref:`kernel specification ` -signature str A hashed :ref:`signature ` of the notebook -=========== =============== ============== - - -Cell metadata -------------- - -The following metadata keys are defined at the cell level: - -=========== =============== ============== -Key Value Interpretation -=========== =============== ============== -collapsed bool Whether the cell's output container should be collapsed -autoscroll bool or 'auto' Whether the cell's output is scrolled, unscrolled, or autoscrolled -deletable bool If False, prevent deletion of the cell -format 'mime/type' The mime-type of a :ref:`Raw NBConvert Cell ` -name str A name for the cell. Should be unique -tags list of str A list of string tags on the cell. Commas are not allowed in a tag -=========== =============== ============== - -Output metadata ---------------- - -The following metadata keys are defined for code cell outputs: - -=========== =============== ============== -Key Value Interpretation -=========== =============== ============== -isolated bool Whether the output should be isolated into an IFrame -=========== =============== ============== diff --git a/docs/source/notebook/notebook.rst b/docs/source/notebook/notebook.rst deleted file mode 100644 index 2e0893d..0000000 --- a/docs/source/notebook/notebook.rst +++ /dev/null @@ -1,502 +0,0 @@ -.. _htmlnotebook: - -The IPython Notebook -==================== - -Introduction ------------- - -The notebook extends the console-based approach to interactive computing in -a qualitatively new direction, providing a web-based application suitable for -capturing the whole computation process: developing, documenting, and -executing code, as well as communicating the results. The IPython notebook -combines two components: - -**A web application**: a browser-based tool for interactive authoring of -documents which combine explanatory text, mathematics, computations and their -rich media output. - -**Notebook documents**: a representation of all content visible in the web -application, including inputs and outputs of the computations, explanatory -text, mathematics, images, and rich media representations of objects. - -.. seealso:: - - See the :ref:`installation documentation ` for directions - on how to install the notebook and its dependencies. - - -Main features of the web application -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -* In-browser editing for code, with automatic syntax highlighting, - indentation, and tab completion/introspection. - -* The ability to execute code from the browser, with the results of - computations attached to the code which generated them. - -* Displaying the result of computation using rich media representations, such - as HTML, LaTeX, PNG, SVG, etc. For example, publication-quality figures - rendered by the matplotlib_ library, can be included inline. - -* In-browser editing for rich text using the Markdown_ markup language, which - can provide commentary for the code, is not limited to plain text. - -* The ability to easily include mathematical notation within markdown cells - using LaTeX, and rendered natively by MathJax_. - - - -.. _MathJax: http://www.mathjax.org/ - - -Notebook documents -~~~~~~~~~~~~~~~~~~ -Notebook documents contains the inputs and outputs of a interactive session as -well as additional text that accompanies the code but is not meant for -execution. In this way, notebook files can serve as a complete computational -record of a session, interleaving executable code with explanatory text, -mathematics, and rich representations of resulting objects. These documents -are internally JSON_ files and are saved with the ``.ipynb`` extension. Since -JSON is a plain text format, they can be version-controlled and shared with -colleagues. - -.. _JSON: http://en.wikipedia.org/wiki/JSON - -Notebooks may be exported to a range of static formats, including HTML (for -example, for blog posts), reStructuredText, LaTeX, PDF, and slide shows, via -the new :ref:`nbconvert ` command. - -Furthermore, any ``.ipynb`` notebook document available from a public -URL can be shared via the `IPython Notebook Viewer `_ (nbviewer_). -This service loads the notebook document from the URL and renders it as a -static web page. The results may thus be shared with a colleague, or as a -public blog post, without other users needing to install IPython themselves. -In effect, nbviewer_ is simply :ref:`nbconvert ` as a web service, -so you can do your own static conversions with nbconvert, without relying on -nbviewer. - - - -.. seealso:: - - :ref:`Details on the notebook JSON file format ` - - -Starting the notebook server ----------------------------- - -You can start running a notebook server from the command line using the -following command:: - - ipython notebook - -This will print some information about the notebook server in your console, -and open a web browser to the URL of the web application (by default, -``http://127.0.0.1:8888``). - -The landing page of the IPython notebook web application, the **dashboard**, -shows the notebooks currently available in the notebook directory (by default, -the directory from which the notebook server was started). - -You can create new notebooks from the dashboard with the ``New Notebook`` -button, or open existing ones by clicking on their name. You can also drag -and drop ``.ipynb`` notebooks and standard ``.py`` Python source code files -into the notebook list area. - -When starting a notebook server from the command line, you can also open a -particular notebook directly, bypassing the dashboard, with ``ipython notebook -my_notebook.ipynb``. The ``.ipynb`` extension is assumed if no extension is -given. - -When you are inside an open notebook, the `File | Open...` menu option will -open the dashboard in a new browser tab, to allow you to open another notebook -from the notebook directory or to create a new notebook. - - -.. note:: - - You can start more than one notebook server at the same time, if you want - to work on notebooks in different directories. By default the first - notebook server starts on port 8888, and later notebook servers search for - ports near that one. You can also manually specify the port with the - ``--port`` option. - -Creating a new notebook document -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A new notebook may be created at any time, either from the dashboard, or using -the `File | New` menu option from within an active notebook. The new notebook -is created within the same directory and will open in a new browser tab. It -will also be reflected as a new entry in the notebook list on the dashboard. - - -Opening notebooks -~~~~~~~~~~~~~~~~~ -An open notebook has **exactly one** interactive session connected to an -:ref:`IPython kernel `, which will execute code sent by the user -and communicate back results. This kernel remains active if the web browser -window is closed, and reopening the same notebook from the dashboard will -reconnect the web application to the same kernel. In the dashboard, notebooks -with an active kernel have a ``Shutdown`` button next to them, whereas -notebooks without an active kernel have a ``Delete`` button in its place. - -Other clients may connect to the same underlying IPython kernel. -The notebook server always prints to the terminal the full details of -how to connect to each kernel, with messages such as the following:: - - [NotebookApp] Kernel started: 87f7d2c0-13e3-43df-8bb8-1bd37aaf3373 - -This long string is the kernel's ID which is sufficient for getting the -information necessary to connect to the kernel. You can also request this -connection data by running the ``%connect_info`` :ref:`magic -`. This will print the same ID information as well as the -content of the JSON data structure it contains. - -You can then, for example, manually start a Qt console connected to the *same* -kernel from the command line, by passing a portion of the ID:: - - $ ipython qtconsole --existing 87f7d2c0 - -Without an ID, ``--existing`` will connect to the most recently -started kernel. This can also be done by running the ``%qtconsole`` -:ref:`magic ` in the notebook. - -.. seealso:: - - :ref:`ipythonzmq` - -Notebook user interface ------------------------ - -When you create a new notebook document, you will be presented with the -**notebook name**, a **menu bar**, a **toolbar** and an empty **code -cell**. - -**notebook name**: The name of the notebook document is displayed at the top -of the page, next to the ``IP[y]: Notebook`` logo. This name reflects the name -of the ``.ipynb`` notebook document file. Clicking on the notebook name -brings up a dialog which allows you to rename it. Thus, renaming a notebook -from "Untitled0" to "My first notebook" in the browser, renames the -``Untitled0.ipynb`` file to ``My first notebook.ipynb``. - -**menu bar**: The menu bar presents different options that may be used to -manipulate the way the notebook functions. - -**toolbar**: The tool bar gives a quick way of performing the most-used -operations within the notebook, by clicking on an icon. - -**code cell**: the default type of cell, read on for an explanation of cells - - -Structure of a notebook document --------------------------------- - -The notebook consists of a sequence of cells. A cell is a multi-line -text input field, and its contents can be executed by using -:kbd:`Shift-Enter`, or by clicking either the "Play" button the toolbar, or -`Cell | Run` in the menu bar. The execution behavior of a cell is determined -the cell's type. There are four types of cells: **code cells**, **markdown -cells**, **raw cells** and **heading cells**. Every cell starts off -being a **code cell**, but its type can be changed by using a dropdown on the -toolbar (which will be "Code", initially), or via :ref:`keyboard shortcuts -`. - -For more information on the different things you can do in a notebook, -see the `collection of examples -`_. - -Code cells -~~~~~~~~~~ -A *code cell* allows you to edit and write new code, with full syntax -highlighting and tab completion. By default, the language associated to a code -cell is Python, but other languages, such as ``Julia`` and ``R``, can be -handled using :ref:`cell magic commands `. - -When a code cell is executed, code that it contains is sent to the kernel -associated with the notebook. The results that are returned from this -computation are then displayed in the notebook as the cell's *output*. The -output is not limited to text, with many other possible forms of output are -also possible, including ``matplotlib`` figures and HTML tables (as used, for -example, in the ``pandas`` data analysis package). This is known as IPython's -*rich display* capability. - -.. seealso:: - - `Basic Output`_ example notebook - - `Rich Display System`_ example notebook - -Markdown cells -~~~~~~~~~~~~~~ -You can document the computational process in a literate way, alternating -descriptive text with code, using *rich text*. In IPython this is accomplished -by marking up text with the Markdown language. The corresponding cells are -called *Markdown cells*. The Markdown language provides a simple way to -perform this text markup, that is, to specify which parts of the text should -be emphasized (italics), bold, form lists, etc. - - -When a Markdown cell is executed, the Markdown code is converted into -the corresponding formatted rich text. Markdown allows arbitrary HTML code for -formatting. - -Within Markdown cells, you can also include *mathematics* in a straightforward -way, using standard LaTeX notation: ``$...$`` for inline mathematics and -``$$...$$`` for displayed mathematics. When the Markdown cell is executed, -the LaTeX portions are automatically rendered in the HTML output as equations -with high quality typography. This is made possible by MathJax_, which -supports a `large subset `_ of LaTeX functionality - -.. _mathjax_tex: http://docs.mathjax.org/en/latest/tex.html - -Standard mathematics environments defined by LaTeX and AMS-LaTeX (the -`amsmath` package) also work, such as -``\begin{equation}...\end{equation}``, and ``\begin{align}...\end{align}``. -New LaTeX macros may be defined using standard methods, -such as ``\newcommand``, by placing them anywhere *between math delimiters* in -a Markdown cell. These definitions are then available throughout the rest of -the IPython session. - -.. seealso:: - - `Markdown Cells`_ example notebook - -Raw cells -~~~~~~~~~ - -*Raw* cells provide a place in which you can write *output* directly. -Raw cells are not evaluated by the notebook. -When passed through :ref:`nbconvert `, raw cells arrive in the -destination format unmodified. For example, this allows you to type full LaTeX -into a raw cell, which will only be rendered by LaTeX after conversion by -nbconvert. - -Heading cells -~~~~~~~~~~~~~ - -You can provide a conceptual structure for your computational document as a -whole using different levels of headings; there are 6 levels available, from -level 1 (top level) down to level 6 (paragraph). These can be used later for -constructing tables of contents, etc. As with Markdown cells, a heading -cell is replaced by a rich text rendering of the heading when the cell is -executed. - - -Basic workflow --------------- - -The normal workflow in a notebook is, then, quite similar to a standard -IPython session, with the difference that you can edit cells in-place multiple -times until you obtain the desired results, rather than having to -rerun separate scripts with the ``%run`` magic command. - - -Typically, you will work on a computational problem in pieces, organizing -related ideas into cells and moving forward once previous parts work -correctly. This is much more convenient for interactive exploration than -breaking up a computation into scripts that must be executed together, as was -previously necessary, especially if parts of them take a long time to run. - -At certain moments, it may be necessary to interrupt a calculation which is -taking too long to complete. This may be done with the `Kernel | Interrupt` -menu option, or the :kbd:`Ctrl-m i` keyboard shortcut. -Similarly, it may be necessary or desirable to restart the whole computational -process, with the `Kernel | Restart` menu option or :kbd:`Ctrl-m .` -shortcut. - -A notebook may be downloaded in either a ``.ipynb`` or ``.py`` file from the -menu option `File | Download as`. Choosing the ``.py`` option downloads a -Python ``.py`` script, in which all rich output has been removed and the -content of markdown cells have been inserted as comments. - -.. seealso:: - - `Running Code in the IPython Notebook`_ example notebook - - `Basic Output`_ example notebook - - :ref:`a warning about doing "roundtrip" conversions `. - -.. _keyboard-shortcuts: - -Keyboard shortcuts -~~~~~~~~~~~~~~~~~~ -All actions in the notebook can be performed with the mouse, but keyboard -shortcuts are also available for the most common ones. The essential shortcuts -to remember are the following: - -* :kbd:`Shift-Enter`: run cell - Execute the current cell, show output (if any), and jump to the next cell - below. If :kbd:`Shift-Enter` is invoked on the last cell, a new code - cell will also be created. Note that in the notebook, typing :kbd:`Enter` - on its own *never* forces execution, but rather just inserts a new line in - the current cell. :kbd:`Shift-Enter` is equivalent to clicking the - ``Cell | Run`` menu item. - -* :kbd:`Ctrl-Enter`: run cell in-place - Execute the current cell as if it were in "terminal mode", where any - output is shown, but the cursor *remains* in the current cell. The cell's - entire contents are selected after execution, so you can just start typing - and only the new input will be in the cell. This is convenient for doing - quick experiments in place, or for querying things like filesystem - content, without needing to create additional cells that you may not want - to be saved in the notebook. - -* :kbd:`Alt-Enter`: run cell, insert below - Executes the current cell, shows the output, and inserts a *new* - cell between the current cell and the cell below (if one exists). This - is thus a shortcut for the sequence :kbd:`Shift-Enter`, :kbd:`Ctrl-m a`. - (:kbd:`Ctrl-m a` adds a new cell above the current one.) - -* :kbd:`Esc` and :kbd:`Enter`: Command mode and edit mode - In command mode, you can easily navigate around the notebook using keyboard - shortcuts. In edit mode, you can edit text in cells. - -For the full list of available shortcuts, click :guilabel:`Help`, -:guilabel:`Keyboard Shortcuts` in the notebook menus. - -Plotting --------- -One major feature of the notebook is the ability to display plots that are the -output of running code cells. IPython is designed to work seamlessly with the -matplotlib_ plotting library to provide this functionality. - -To set this up, before any plotting is performed you must execute the -``%matplotlib`` :ref:`magic command `. This performs the -necessary behind-the-scenes setup for IPython to work correctly hand in hand -with ``matplotlib``; it does *not*, however, actually execute any Python -``import`` commands, that is, no names are added to the namespace. - -If the ``%matplotlib`` magic is called without an argument, the -output of a plotting command is displayed using the default ``matplotlib`` -backend in a separate window. Alternatively, the backend can be explicitly -requested using, for example:: - - %matplotlib gtk - -A particularly interesting backend, provided by IPython, is the ``inline`` -backend. This is available only for the IPython Notebook and the -:ref:`IPython QtConsole `. It can be invoked as follows:: - - %matplotlib inline - -With this backend, the output of plotting commands is displayed *inline* -within the notebook, directly below the code cell that produced it. The -resulting plots will then also be stored in the notebook document. - -.. seealso:: - - `Plotting with Matplotlib`_ example notebook - - -Configuring the IPython Notebook --------------------------------- -The notebook server can be run with a variety of command line arguments. -To see a list of available options enter:: - - $ ipython notebook --help - -Defaults for these options can also be set by creating a file named -``ipython_notebook_config.py`` in your IPython *profile folder*. The profile -folder is a subfolder of your IPython directory; to find out where it is -located, run:: - - $ ipython locate - -To create a new set of default configuration files, with lots of information -on available options, use:: - - $ ipython profile create - -.. seealso:: - - :ref:`config_overview`, in particular :ref:`Profiles`. - - :ref:`notebook_server_security` - - :ref:`notebook_public_server` - -Installing new kernels ----------------------- - -Running the notebook makes the current python installation available as a kernel. Other -python installations (different python versions, virtualenv or conda environments) can -be installed as kernels by following these steps: - -* make sure that the desired python installation is active (e.g. activate the environment) - and ipython is installed -* run once ``ipython kernelspec install-self --user`` (or ``ipython2 ...`` or ``ipython3 ...`` - if you want to install specific python versions) - -The last command installs a kernel spec file for the current python installation in -``~/.ipython/kernels/``. Kernel spec files are JSON files, which can be viewed and changed with a -normal text editor. - -Kernels for other languages can be found in the `IPython wiki -`_. -They usually come with instruction what to run to make the kernel available in the notebook. - - -.. _signing_notebooks: - -Signing Notebooks ------------------ - -To prevent untrusted code from executing on users' behalf when notebooks open, -we have added a signature to the notebook, stored in metadata. -The notebook server verifies this signature when a notebook is opened. -If the signature stored in the notebook metadata does not match, -javascript and HTML output will not be displayed on load, -and must be regenerated by re-executing the cells. - -Any notebook that you have executed yourself *in its entirety* will be considered trusted, -and its HTML and javascript output will be displayed on load. - -If you need to see HTML or Javascript output without re-executing, -you can explicitly trust notebooks, such as those shared with you, -or those that you have written yourself prior to IPython 2.0, -at the command-line with:: - - $ ipython trust mynotebook.ipynb [other notebooks.ipynb] - -This just generates a new signature stored in each notebook. - -You can generate a new notebook signing key with:: - - $ ipython trust --reset - - -Importing ``.py`` files ------------------------ - -``.py`` files will be imported as a notebook with -the same basename, but an ``.ipynb`` extension, located in the notebook -directory. The notebook created will have just one cell, which will contain -all the code in the ``.py`` file. You can later manually partition this into -individual cells using the ``Edit | Split Cell`` menu option, or the -:kbd:`Ctrl-m -` keyboard shortcut. - -Note that ``.py`` scripts obtained from a notebook document using :doc:`nbconvert ` -maintain the structure of the notebook in comments. Reimporting such a -script back into a notebook will preserve this structure. - -.. _note_about_roundtrip: - -.. warning:: - - While in simple cases you can "roundtrip" a notebook to Python, edit the - Python file, and then import it back without loss of main content, this is - in general *not guaranteed to work*. First, there is extra metadata - saved in the notebook that may not be saved to the ``.py`` format. And as - the notebook format evolves in complexity, there will be attributes of the - notebook that will not survive a roundtrip through the Python form. You - should think of the Python format as a way to output a script version of a - notebook and the import capabilities as a way to load existing code to get - a notebook started. But the Python version is *not* an alternate notebook - format. - -.. seealso:: - :ref:`nbformat` - -.. include:: ../links.txt diff --git a/docs/source/notebook/public_server.rst b/docs/source/notebook/public_server.rst deleted file mode 100644 index e8b9a32..0000000 --- a/docs/source/notebook/public_server.rst +++ /dev/null @@ -1,168 +0,0 @@ -.. _working_remotely: - -Running a notebook server -========================= - - -The :ref:`IPython notebook ` web-application is based on a -server-client structure. This server uses a :ref:`two-process kernel -architecture ` based on ZeroMQ_, as well as Tornado_ for serving -HTTP requests. By default, a notebook server runs on http://127.0.0.1:8888/ -and is accessible only from `localhost`. This document describes how you can -:ref:`secure a notebook server ` and how to :ref:`run it on -a public interface `. - -.. _ZeroMQ: http://zeromq.org - -.. _Tornado: http://www.tornadoweb.org - - -.. _notebook_server_security: - -Securing a notebook server --------------------------- - -You can protect your notebook server with a simple single password by -setting the :attr:`NotebookApp.password` configurable. You can prepare a -hashed password using the function :func:`IPython.lib.security.passwd`: - -.. sourcecode:: ipython - - In [1]: from IPython.lib import passwd - In [2]: passwd() - Enter password: - Verify password: - Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed' - -.. note:: - - :func:`~IPython.lib.security.passwd` can also take the password as a string - argument. **Do not** pass it as an argument inside an IPython session, as it - will be saved in your input history. - -You can then add this to your :file:`ipython_notebook_config.py`, e.g.:: - - # Password to use for web authentication - c = get_config() - c.NotebookApp.password = - u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed' - -When using a password, it is a good idea to also use SSL, so that your -password is not sent unencrypted by your browser. You can start the notebook -to communicate via a secure protocol mode using a self-signed certificate with -the command:: - - $ ipython notebook --certfile=mycert.pem - -.. note:: - - A self-signed certificate can be generated with ``openssl``. For example, - the following command will create a certificate valid for 365 days with - both the key and certificate data written to the same file:: - - $ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem - -Your browser will warn you of a dangerous certificate because it is -self-signed. If you want to have a fully compliant certificate that will not -raise warnings, it is possible (but rather involved) to obtain one, -as explained in detail in `this tutorial`__. - -.. __: http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars - -Keep in mind that when you enable SSL support, you will need to access the -notebook server over ``https://``, not over plain ``http://``. The startup -message from the server prints this, but it is easy to overlook and think the -server is for some reason non-responsive. - - -.. _notebook_public_server: - -Running a public notebook server --------------------------------- - -If you want to access your notebook server remotely via a web browser, -you can do the following. - -Start by creating a certificate file and a hashed password, as explained -above. Then create a custom profile for the notebook, with the following -command line, type:: - - $ ipython profile create nbserver - -In the profile directory just created, edit the file -``ipython_notebook_config.py``. By default, the file has all fields -commented; the minimum set you need to uncomment and edit is the following:: - - c = get_config() - - # Notebook config - c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem' - c.NotebookApp.ip = '*' - c.NotebookApp.open_browser = False - c.NotebookApp.password = u'sha1:bcd259ccf...[your hashed password here]' - # It is a good idea to put it on a known, fixed port - c.NotebookApp.port = 9999 - -You can then start the notebook and access it later by pointing your browser -to ``https://your.host.com:9999`` with ``ipython notebook ---profile=nbserver``. - - -Firewall Setup -`````````````` - -To function correctly, the firewall on the computer running the ipython server must be -configured to allow connections from client machines on the ``c.NotebookApp.port`` -port to allow connections to the web interface. The firewall must also allow -connections from 127.0.0.1 (localhost) on ports from 49152 to 65535. -These ports are used by the server to communicate with the notebook kernels. -The kernel communication ports are chosen randomly by ZeroMQ, and may require -multiple connections per kernel, so a large range of ports must be accessible. - -Running with a different URL prefix ------------------------------------ - -The notebook dashboard (the landing page with an overview -of the notebooks in your working directory) typically lives at the URL -``http://localhost:8888/``. If you prefer that it lives, together with the -rest of the notebook, under a sub-directory, -e.g. ``http://localhost:8888/ipython/``, you can do so with -configuration options like the following (see above for instructions about -modifying ``ipython_notebook_config.py``):: - - c.NotebookApp.base_url = '/ipython/' - c.NotebookApp.webapp_settings = {'static_url_prefix':'/ipython/static/'} - -Using a different notebook store --------------------------------- - -By default, the notebook server stores the notebook documents that it saves as -files in the working directory of the notebook server, also known as the -``notebook_dir``. This logic is implemented in the -:class:`FileNotebookManager` class. However, the server can be configured to -use a different notebook manager class, which can -store the notebooks in a different format. - -The bookstore_ package currently allows users to store notebooks on Rackspace -CloudFiles or OpenStack Swift based object stores. - -Writing a notebook manager is as simple as extending the base class -:class:`NotebookManager`. The simple_notebook_manager_ provides a great example -of an in memory notebook manager, created solely for the purpose of -illustrating the notebook manager API. - -.. _bookstore: https://github.com/rgbkrk/bookstore - -.. _simple_notebook_manager: https://github.com/khinsen/simple_notebook_manager - -Known issues ------------- - -When behind a proxy, especially if your system or browser is set to autodetect -the proxy, the notebook web application might fail to connect to the server's -websockets, and present you with a warning at startup. In this case, you need -to configure your system not to use the proxy for the server's address. - -For example, in Firefox, go to the Preferences panel, Advanced section, -Network tab, click 'Settings...', and add the address of the notebook server -to the 'No proxy for' field. diff --git a/docs/source/notebook/security.rst b/docs/source/notebook/security.rst deleted file mode 100644 index 8a3130f..0000000 --- a/docs/source/notebook/security.rst +++ /dev/null @@ -1,154 +0,0 @@ -.. _notebook_security: - -Security in IPython notebooks -============================= - -As IPython notebooks become more popular for sharing and collaboration, -the potential for malicious people to attempt to exploit the notebook -for their nefarious purposes increases. IPython 2.0 introduces a -security model to prevent execution of untrusted code without explicit -user input. - -The problem ------------ - -The whole point of IPython is arbitrary code execution. We have no -desire to limit what can be done with a notebook, which would negatively -impact its utility. - -Unlike other programs, an IPython notebook document includes output. -Unlike other documents, that output exists in a context that can execute -code (via Javascript). - -The security problem we need to solve is that no code should execute -just because a user has **opened** a notebook that **they did not -write**. Like any other program, once a user decides to execute code in -a notebook, it is considered trusted, and should be allowed to do -anything. - -Our security model ------------------- - -- Untrusted HTML is always sanitized -- Untrusted Javascript is never executed -- HTML and Javascript in Markdown cells are never trusted -- **Outputs** generated by the user are trusted -- Any other HTML or Javascript (in Markdown cells, output generated by - others) is never trusted -- The central question of trust is "Did the current user do this?" - -The details of trust --------------------- - -IPython notebooks store a signature in metadata, which is used to answer -the question "Did the current user do this?" - -This signature is a digest of the notebooks contents plus a secret key, -known only to the user. The secret key is a user-only readable file in -the IPython profile's security directory. By default, this is:: - - ~/.ipython/profile_default/security/notebook_secret - -.. note:: - - The notebook secret being stored in the profile means that - loading a notebook in another profile results in it being untrusted, - unless you copy or symlink the notebook secret to share it across profiles. - -When a notebook is opened by a user, the server computes a signature -with the user's key, and compares it with the signature stored in the -notebook's metadata. If the signature matches, HTML and Javascript -output in the notebook will be trusted at load, otherwise it will be -untrusted. - -Any output generated during an interactive session is trusted. - -Updating trust -************** - -A notebook's trust is updated when the notebook is saved. If there are -any untrusted outputs still in the notebook, the notebook will not be -trusted, and no signature will be stored. If all untrusted outputs have -been removed (either via ``Clear Output`` or re-execution), then the -notebook will become trusted. - -While trust is updated per output, this is only for the duration of a -single session. A notebook file on disk is either trusted or not in its -entirety. - -Explicit trust -************** - -Sometimes re-executing a notebook to generate trusted output is not an -option, either because dependencies are unavailable, or it would take a -long time. Users can explicitly trust a notebook in two ways: - -- At the command-line, with:: - - ipython trust /path/to/notebook.ipynb - -- After loading the untrusted notebook, with ``File / Trust Notebook`` - -These two methods simply load the notebook, compute a new signature with -the user's key, and then store the newly signed notebook. - -Reporting security issues -------------------------- - -If you find a security vulnerability in IPython, either a failure of the -code to properly implement the model described here, or a failure of the -model itself, please report it to security@ipython.org. - -If you prefer to encrypt your security reports, -you can use :download:`this PGP public key `. - -Affected use cases ------------------- - -Some use cases that work in IPython 1.0 will become less convenient in -2.0 as a result of the security changes. We do our best to minimize -these annoyance, but security is always at odds with convenience. - -Javascript and CSS in Markdown cells -************************************ - -While never officially supported, it had become common practice to put -hidden Javascript or CSS styling in Markdown cells, so that they would -not be visible on the page. Since Markdown cells are now sanitized (by -`Google Caja `__), all Javascript -(including click event handlers, etc.) and CSS will be stripped. - -We plan to provide a mechanism for notebook themes, but in the meantime -styling the notebook can only be done via either ``custom.css`` or CSS -in HTML output. The latter only have an effect if the notebook is -trusted, because otherwise the output will be sanitized just like -Markdown. - -Collaboration -************* - -When collaborating on a notebook, people probably want to see the -outputs produced by their colleagues' most recent executions. Since each -collaborator's key will differ, this will result in each share starting -in an untrusted state. There are three basic approaches to this: - -- re-run notebooks when you get them (not always viable) -- explicitly trust notebooks via ``ipython trust`` or the notebook menu - (annoying, but easy) -- share a notebook secret, and use an IPython profile dedicated to the - collaboration while working on the project. - -Multiple profiles or machines -***************************** - -Since the notebook secret is stored in a profile directory by default, -opening a notebook with a different profile or on a different machine -will result in a different key, and thus be untrusted. The only current -way to address this is by sharing the notebook secret. This can be -facilitated by setting the configurable: - -.. sourcecode:: python - - c.NotebookApp.secret_file = "/path/to/notebook_secret" - -in each profile, and only sharing the secret once per machine.