Skip to content
gnovak edited this page Apr 2, 2013 · 9 revisions

Extensions you can install for IPython are listed here. To create a new extension, please refer to the extension docs.

physics

Enables calculations involving units, such as (5 m/s) * (3 s). It also defines a range of physical constants, such as the speed of light in a vacuum, and the mass of an electron.

Homepage

To install:

    %install_ext https://bitbucket.org/birkenfeld/ipython-physics/raw/default/physics.py

Note: In the latest version, quantities with uncertainties are supported if the uncertainties module is installed.

%hierarchy and %%dot magics

The %hierarchy magic command draws an inheritance diagram of the given class or object. With the %%dot cell magic, you can write graphiz dot language in a cell.

Homepage

To install:

  %install_ext https://raw.github.com/tkf/ipython-hierarchymagic/master/hierarchymagic.py

%importfile magic

%importfile tries to import Python file in most "natural way". For example, if you have spam/egg/module.py, spam/egg/__init__.py and spam/__init__.py, you would want import module.py as spam.egg.module, not as module or egg.module. %importfile tries several heuristics to find the best "module path".

Homepage

To install:

  %install_ext https://raw.github.com/tkf/ipython-importfilemagic/master/importfilemagic.py

Usage:

  %importfile PATH/TO/SOME/FILE.py

Divers

Interactive plotting in notebook using the flot library, use the ipython-flot package.

Homepage

A Notebook example can be found here. This is not an extension, so it does not need %install_ext nor %load_ext to work.

Mathematica

Mathematica can be integrated into notebooks using the IPython-mathematicamagic-extension. Install instructions and examples are included in a notebook on the GitHub page. Requires the mathlink python module distributed with Mathematica.

Homepage

Bitey

The Bitey extension adds a %%bitey cell magic for automatically compiling C (or C++) code into LLVM bitcode and loading the bitcode with Bitey. See also a sample notebook.

Homepage

To install:

    %install_ext https://raw.github.com/gist/3458310/biteymagic.py

Matlab

The Python MATLAB bridge enables calling of MATLAB code and functions from an IPython session and adds a %%matlab cell magic, which allows embedding matlab code in IPython notebooks.

Homepage

Examples:

py2tex

Enables conversion of simple expressions to a nice Tex Representation.

Homepage

To install:

    %install_ext https://raw.github.com/gist/4032651/c33b92cade4e899c81d03e1573a6f8107c7d470f/py2tex.py

An example is provided here.

The Unum class is supported for unit-aware calculation.

inumpy

A numpy extension for IPython. Autocomplete recarray.

Homepage

To install:

    %install_ext https://raw.github.com/piti118/inumpy/master/inumpy.py

##ipy_table

Create richly formatted data tables in IPython Notebooks.

Homepage

Examples:

SQLite magics

IPython magics to run SQL and see the result in table format.

Homepage

%install_ext https://raw.github.com/tkf/ipython-sqlitemagic/master/sqlitemagic.py

Doctest magics

Run and debug doctest in IPython.

Homepage

%install_ext https://raw.github.com/tkf/ipython-doctestmagic/master/doctestmagic.py

Magics for temporary workspace

  • %cdtemp -- Creates a temporary directory that is magically cleaned up when you exit IPython session.

  • %%with_temp_dir -- Run Python code in a temporary directory and clean up it after the execution.

Homepage

%install_ext https://raw.github.com/tkf/ipython-tempmagic/master/tempmagic.py

Magics for activity, block, network and sequence diagrams

Create activity, block, network and sequence diagrams using text definitions similar to graphwiz. The extension uses blockdiag modules from http://blockdiag.com

Homepage

%install_ext https://bitbucket.org/vladf/ipython-diags/raw/default/diagmagic.py

sql

Passes SQL statements to any database reachable by SQLAlchemy, and renders results as tabular HTML or pretty text tables, where possible.

Homepage

Usage sample

To install (from command line):

pip install ipython-sql

grasp

A set of python functions to help with interactive object inspection and discovery.

  • %gist -- object inspection
  • %rtype -- recursive type, deep object inspection
  • %apropos -- deep search for things with a given name, value, etc.

Install: pip install grasp

Use: %load_ext grasp

Source code: http://launchpad.net/grasp

More info: http://pypi.python.org/pypi/grasp/

breakpoint

Run code cells in an iPython notebook until a breakpoint is encountered

Extension download: https://gist.github.com/juhasch/5241322

Demo notebook: https://gist.github.com/juhasch/5287081

(You can't see the breakpoints using the nbviewer: http://nbviewer.ipython.org/5287081 )

Clone this wiki locally