Extensions Index
Pages 142
- Home
- A gallery of interesting IPython Notebooks
- A gallery of interesting Jupyter and IPython Notebooks
- Code blocks and other ideas
- Cookbook: Branding the IPython notebook
- Cookbook: Connecting to a remote kernel via ssh
- Cookbook: Dated logging
- Cookbook: deploying ipython
- Cookbook: Dynamic prompt
- Cookbook: Hotkeys for faster notebook editing
- Cookbook: Ignoring some commands in history
- Cookbook: Index
- Cookbook: IPython and Emacs
- Cookbook: IPython and Python.NET
- Cookbook: Job control extension
- Cookbook: Launching IPython on OSX
- Cookbook: Macro arguments
- Cookbook: nbconvert templates
- Cookbook: Notebook utilities
- Cookbook: Running a file in the background
- Cookbook: Running screen
- Cookbook: Sending built in help to the pager
- Cookbook: Shadow history
- Cookbook: Standalone executable zip
- Cookbook: Storing aliases
- Cookbook: Styling Notebook
- Cookbook: Styling the QtConsole
- Cookbook: Updating code for use with IPython 0.11 and later
- Cookbook: Using IPython with Console2
- Cookbook: Using IPython with TextMate
- Dev: boot2docker
- Dev: Closing pull requests
- Dev: Coding style
- Dev: Compiling .LESS files
- Dev: Documenting IPython
- Dev: Extending the Messaging Protocol
- Dev: GitHub workflow
- Dev: Index
- Dev: IPython Sphinx directive
- Dev: Javascript Events
- Dev: Lab meetings on Air
- Dev: Meeting notes, February 6, 2013
- Dev: Meeting notes, January 6, 2013
- Dev: Meeting, January 2014
- Dev: Meeting, July 2013
- Dev: Meeting, September 2014
- Dev: Py3compat module
- Dev: PyData 2012 HackNight
- Dev: Releasing IPython
- Dev: Testing
- Dev: Testing kernels against message specification
- Dev: The perfect pull request
- Dev: URL mapping of IPython notebook
- Dev: Windows Sophos issues
- Dev:Codenames
- Extensions Index
- Fix the boot manager after install ubuntu with windows 8
- Frequently asked questions
- Install: Docker
- Install: Index
- Install: Mobile
- Install: Python 3
- IPEP 0: IPEP Template
- IPEP 10: kernel side filtering of display formats
- IPEP 11: Tab Completion System Refactor
- IPEP 12: Splitting KernelManager and KernelClient
- IPEP 13: Updating the Message Spec
- IPEP 14: Notebook Regression Tests
- IPEP 15: Autosaving the IPython Notebook
- IPEP 16: Notebook multi directory dashboard and URL mapping
- IPEP 17: Notebook Format 4
- IPEP 18: Text Editor for the Notebook
- IPEP 19: concurrent.futures (PEP 3148) for IPython.parallel
- IPEP 1: Cleanup and extension of the Magic system in IPython
- IPEP 20: Informal structure of cell metadata
- IPEP 21: Widget Messages
- IPEP 22: Notebook, new cell type "Comment"
- IPEP 23: Backbone.js Widgets
- IPEP 24: completion and object_info
- IPEP 25: Registry of installed kernels
- IPEP 26: Full Featured python js object bridge
- IPEP 27: Contents Service
- IPEP 28: Interleaving Widgets and Output
- IPEP 29: Project Governance
- IPEP 2: Input transformations
- IPEP 3: Multiuser support in the notebook
- IPEP 4: Python 3 Compatibility
- IPEP 5: Notebook JavaScript organization
- IPEP 6: Qt console additional pane
- IPEP 7: Subclients for the Notebook
- IPEP 8: Custom messages and message handlers
- IPEP 9: Slideshow from the notebook
- IPEPs: IPython Enhancement Proposals
- IPython 3.0 comm and widget migration document
- IPython kernels for other languages
- Lets talk Python
- News Categorization using Multinomial Naive Bayes
- Projects using IPython
- Projects using IPython: PyMAD
- Research at UC Berkeley using IPython
- Roadmap: IPython
- Roadmap: NBviewer
- ShowMeDo
- Sprints: PyCon2012
- Sprints: SciPy2012
- Sprints: SciPy2014
- Sprints: SciPy2014 Py3 BoF
- Sprints: SciPy2014 sprint ideas
- Syntax for code blocks
- Trash: 0.11 Migration
- Trash: Cookbook Adding support for ipipe
- Trash: Cookbook Custom completers
- Trash: Cookbook Custom magic commands
- Trash: Cookbook Custom magic examples
- Trash: Cookbook Defining prompts via hooks
- Trash: Cookbook envpersist
- Trash: Cookbook GVim integration
- Trash: Cookbook Integrate with any loop(panda3d example)
- Trash: Cookbook Interrupting threads
- Trash: Cookbook ipy_exportdb
- Trash: Cookbook ipy_render
- Trash: Cookbook Leo IPython Bridge
- Trash: Cookbook Logging
- Trash: Cookbook Moving config to IPython 0.11
- Trash: Cookbook Saving the session on exit
- Trash: Cookbook String list processing
- Trash: Cookbook The sh profile
- Trash: Cookbook User config file
- Trash: EuroSciPy2011
- Trash: IpyKit
- Trash: IPython:About
- Trash: Main Page
- Trash: Main Page PyCon12Sprint
- Trash: Old Embedding GTK
- Trash: Old Embedding Tkinter
- Trash: Parallel Computing
- Trash: Potential projects
- Trash: Py4Science
- Trash: Scratchpad
- Trash: Scratchpad Persistence
- Trash: Using ipipe
- Widgets
- Show 127 more pages…
Clone this wiki locally
Extensions you can install for IPython are listed here. To create a new extension, please refer to the extension docs.
The install_ext magic has been removed from IPython.
Extensions should be published as Python packages, and installed with pip.
ActiveState Code Recipes magics
Allows querying ActiveState Code Recipes
Installation:
Download from: https://raw.github.com/debjan/ipython-recipes-magic/master/recipes.py
Asymptote
Asymptote is a powerful vector graphics language for generating scientific diagrams.
This IPython magic extension makes it easy to create and display Asymptote diagrams within an IPython notebook.
See the example notebook for installation instruction and example of how to use this magic extension.
AsyncIO Magic
An extension for IPython that help to run AsyncIO code in your interactive session.
Installation:
Download from: https://raw.githubusercontent.com/Gr1N/asyncio-ipython-magic/master/asynciomagic.py
base16-ipython-matplotlibrc
Enables matplotlib themes that match base16 notebook themes.
Brythonmagic
Enables the possibility to use Brython in the notebook so you can interact with the notebook or use javascript libraries without having to write [much] javascript.
Some notebooks:
To install:
Download from: https://raw.github.com/kikocorreoso/brythonmagic/master/brythonmagic.py
Cassandra (CQL3) integration
Query cassandra directly from ipython.
Installation:
pip install ipython-cql
CSV Magic
Tools for quickly importing and exporting data from CSV files.
Installation:
Download from: https://raw.githubusercontent.com/FrankSalad/ipython-csvmagic/master/csvtools.py
Django ORM magic
Define your django models in a cell and use them on the fly. Let the magic do the boring part.
Installation:
Download from: https://raw.github.com/mgaitan/django-orm-magic/master/django_orm_magic.py
ipythonPexpect magic
A magic that allows IPython notebooks to interface with other programs via Pexpect (written by Adam Lyon).
- Example notebook - including interfacing with bash, R, and CERN's ROOT system.
To install :
Download from: https://cdcvs.fnal.gov/redmine/projects/ipython_ext/repository/revisions/master/raw/ipythonPexpect.py
fortran magic
Compile and import everything from a Fortran code cell, using f2py.
To install :
Download from: https://raw.github.com/mgaitan/fortran_magic/master/fortranmagic.py
clrmagic (C# cell magic for IPython kernel)
Compile and import everything from a C# (CLR) code cell, using pythonnet.
To install :
pip install clrmagic
%reload_ext clrmagic
ferret
ferret, the Data Visualisation and Analysis software from NOAA/PMEL, can now be integrated into notebooks using the ipython ferretmagic extension. Install instructions and examples are included in notebooks on the GitHub page.
To install:
pip install ferretmagic
In ipython notebooks,
%load_ext ferretmagic
ipyBibtex
With this extension you can use LATEX style references within IPython (Notebook) while still using markdown for formatting.
To install:
Download from: https://gist.github.com/z-m-k/6080008/raw/7611cb869b5ff162d00e95856054b887b0b0d095/ipyBibtex.py
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.
To install:
Download from: 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.
To install:
Download from: 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".
To install:
Download from: 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.
A Notebook example can be found here. This is not an extension, so it does not need %install_ext nor %load_ext to work.
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.
To install:
Download from: https://gist.githubusercontent.com/bfroehle/3458310/raw/biteymagic.py
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.
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.
Examples:
imatlab is a Jupyter kernel for MATLAB.
IDL
Provides magics for embedding IDL and GDL code using pIDLy.
To install:
Download from: https://raw.github.com/ebellm/ipython-idlmagic/master/idlmagic.py
pep8
Allows to check for the pep8 styleguide using the cellmagic %%pep8.
To install:
Download from: https://raw.githubusercontent.com/SiggyF/notebooks/master/pep8_magic.py
An example is provided here.
px magic
Executes shell command and returns stdout as a file like object (pipe). This will make it easy to e.g. read tabular output from shell commands to pandas DataFrame:s.
To install:
Download from: https://gist.github.com/kpalin/ec5264445dbb56616d6e/raw/94fe58912752ca2e4b0b20d38674ee8dea69d003/pxmagic.py
An example is provided here.
py2tex
Enables conversion of simple expressions to a nice Tex Representation.
To install:
Download from: https://raw.githubusercontent.com/BekeJ/py2tex/master/py2tex.py
An example is provided here.
The Unum class is supported for unit-aware calculation.
duster
Reset namespace and automatically (re)load several modules immediately thereafter.
To install (from the command line):
pip install duster
icypher
Query a Neo4J graph database with Cypher and get back the results in Python data structures.
To install (from the command line):
pip install icypher
idisplay
Magic function for accessing IPython's rich display system without having to explicitly import and call its various classes.
To install (from the command line):
pip install idisplay
inumpy
A numpy extension for IPython. Autocomplete recarray.
To install:
Download from: https://raw.github.com/piti118/inumpy/master/inumpy.py
iorient
Query OrientDB via IPython using OrientDB SQL or Gremlin.
To install:
pip install iorient
PlantUML integration
Generate inline, PlantUML-based SVG UML diagrams.
Installation:
pip install iplantuml
##ipy_magics
Cell magics for generating PostScript 2D graphics (using Ghostscript) and RenderMan 3D graphics (using Aqsis), and also audio via Csound.
##ipy_table
Create richly formatted data tables in IPython Notebooks.
Examples:
ipy2wp
Small tool to convert an IPython notebook to html and upload the result to your wordpress blog using XML-RPC.
[Maybe this is not the appropriate place for this but I couldn't find a better place]
ipython-autoimport
Automagically import missing modules into the user namespace.
SQLite magics
IPython magics to run SQL and see the result in table format.
Download from: https://raw.github.com/tkf/ipython-sqlitemagic/master/sqlitemagic.py
Doctest magics
Run and debug doctest in IPython.
Download from: https://raw.github.com/tkf/ipython-doctestmagic/master/doctestmagic.py
scd - smart change of directory
- add
%scdmagic for changing to any directory with a few keystrokes - modify
%cd,%pushd,%popdmagics to record visited directories in~/.scdhistory
This plugin is for IPython terminal session on Linux, Mac or other Unix-like system only. Must have Z shell (zsh package) and scd script installed in the PATH. For best results activate scd also for the system shell as described on the Homepage.
Download from: https://raw.github.com/pavoljuhas/smart-change-directory/master/ipython/ipy_scd.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.
Download from: 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
Download from: 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.
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.
See:
https://github.com/ipython-contrib/IPython-notebook-extensions
The AnyBody Modeling System
The AnyBody extension adds an %%anybody cell magic to run AnyScript macros directly from the IPython Notebook. The AnyBody Modeling System is a multibody modelling system for musculoskeletal biomechanics.
Usage: See this IPython notebook
To install: Download from: https://raw.github.com/melund/anybodymagic/master/anybodymagic.py
Module version information: %version_information
The %version_information magic extension displays a table with version information for selected Python modules. Use it in a notebook keep a record of exactly which versions of dependency modules were used to run the notebook.
Section numbering: %secnum
Provides automatic section numbering for IPython notebooks.
Currently, level-1 headings are labelled like "1. First" and level-2 headings "1.1. Second". The section numbers are automatically updated every time any cell changes type (e.g. from a Markdown cell to a heading cell).
To install:
Download from: https://github.com/dpsanders/ipython_extensions/tree/master/section_numbering
To use:
%load_ext secnum
%secnum
(Updates are automatic; %secnum only needs to be run once per session.)
.zip, .tar.gz, .tgz extensions support: %zip_extensions
To install:
Download from: https://raw.github.com/mksenzov/ipython_zip_extensions/master/zip_extensions.py
If for example you want to load/start using extension called grasp (described above) without using pip do:
%load_ext zip_extensions
%install_zip_ext https://pypi.python.org/packages/source/g/grasp/grasp-0.3.2.tar.gz
%load_zip_ext grasp
Graphviz Extensions:
These magic functions just pipe various input formats to dot using the standard library subprocess module. They were written for simplistic demonstration of binary decision diagrams in PyEDA.
To install:
Download from: https://raw.github.com/cjdrake/ipython-magic/master/gvmagic.py
To load:
%load_ext gvmagic
Magics:
-
%dot- line/cell magic converts raw input to GraphvizdotSVG output. -
%dotstr- line magic converts string input to GraphvizdotSVG output. -
%dotobj- line magic converts object withto_dotmethod to GraphvizdotSVG output. -
%dotobjs- line magic converts sequence of objects withto_dotmethod to GraphvizdotSVG output.
Examples:
%dot digraph G { a -> b; a -> c }
%%dot digraph G {
a -> b;
b -> c;
}
%dotstr "digraph G { a -> b; a -> c }"
%dotobj dotobj.to_dot()
%dotobjs dotojb[0].to_dot(), dotobj[1].to_dot(), ...
BeautifulSoup
Pretty HTML rendering and html display of BeautifulSoup queries in the notebook and the qtconsole.
To install:
pip install "ipython-beautifulsoup[bs4,notebook]"
To load:
%load_ext soup
Configure how you want the soup extension to work using configure_ipython_beautifulsoup, for example:
configure_ipython_beautifulsoup(show_html=True, show_css=True, show_js=False)
Then just use the BeautifulSoup object loading into the current context.
Page navigation for IPython Notebook
A Greasemonkey/Tampermonkey user script that adds a few functions to help you move up and down easily in an IPython notebook page.
To install:
Get Tampermonkey for Chrome or Greasemonkey for Firefox
and install the script from http://userscripts.org/scripts/show/180884
What you can do:
Turbo-Scrolling : Hold [Shift] key while using your mouse wheel to speed
up the scrolling about x6. Or, you could also do it
by hovering near the left side of page (within 50 px)
[Top] : Scroll to the page top
[Bottom] : Scroll to the bottom of page
[LastCell] : Scroll back to the selected cell
[+] : increase font-size of notebook tile
[–] : decrease font-size of notebook tile
Min's IPython extensions
MinRK has published various (both Python and Notebook) extensions for IPython.
py.test plugin
Discover and run IPython notebook cells as unit tests
db.py plugin
ipython db.py shell extension
To install:
Download from: https://raw.githubusercontent.com/dongweiming/idb/master/idb.py
TikZ
IPython magics for generating figures with TikZ. You can select the output format as svg, png or jpg, define the image size, specify a scale factor, load TikZ packages, and save to external files.
trepanmagic
IPython extension for using the python trepan debugger.
Download from: https://raw.github.com/rocky/ipython-trepan/master/trepanmagic.py
or put trepanmagic.py in $HOME/.python/profile_default/startup:
cd `$HOME/.python/profile_default/startup`:
wget https://raw.github.com/rocky/ipython-trepan/master/trepanmagic.py
Module Magic
The %%module cell magic for the IPython Notebook. %%module saves the cell as a file and imports it into the session. This is useful for both creating and managing modules within the Notebook, as well as creating sandboxed code - i.e. executing code cells in a separate environment.
Giphy Magic
An IPython magic to embed random GIFs from giphy.com
To install:
Download from: https://raw.githubusercontent.com/AustinRochford/giphy-ipython-magic/master/giphy_magic.py
S3 Image Magic
A set of magics that will display images stored in Amazon S3 and save matplotlib figures to S3.
To install:
Download from: https://github.com/AustinRochford/s3img-ipython-magic/blob/master/s3img_magic.py
Autotime
Times every command.
Installation:
Download from: https://raw.github.com/cpcloud/ipython-autotime/master/autotime.py
Py_D3
D3 magic for IPython (targeted at Jupyter).
Installation:
pip install py_d3
Mocodo
IPython magic extension to use Mocodo in a Jupyter Notebook.
Mocodo is an open-source tool for designing and teaching relational databases. It takes as an input a textual description of both entities and associations of an entity-relationship diagram (ERD). It outputs a vectorial drawing in SVG and a relational schema in various formats (SQL, LaTeX, Markdown, etc.).
Installation
pip install mocodo_magic
IPython Bell
iPython/Jupyter Notebook magic to notify the programmer when a line/cell has completed execution.
Installation
pip install IPythonBell
Usage
%%bell
import time
time.sleep(5)
