Skip to main content

Extension for IPython/Jupyter Notebooks that adds namespaces that you can enter and re-enter

Project description

IPython Namespaces

Extension for IPython/Jupyter Notebooks that adds namespaces that you can enter and re-enter.

(Because: “Namespaces are one honking great idea – let’s do more of those!”)

Usage (in a Jupyter Notebook)

Install and load the extension:

!pip install -U ipython-namespaces
%load_ext ipython_namespaces

Use the space cell magic:

foo = 23
%%space dustin

bar = 42
foo, bar

Output: (23, 42)

foo, bar

Output: NameError: name 'bar' is not defined

%%space dustin

foo, bar

Output: (23, 42)

from ipython_namespaces import Namespaces


Output: 42


  1. Separate namespaces within one Jupyter Notebook
  2. Access to other namespaces via the Namespaces class
  3. Unchanged behavior of display – the value of the last line in a cell is displayed
  4. Unchanged behavior of tracebacks – the problematic line in one’s own code is highlighted


Thanks to Davide Sarra and the Jupyter Spaces extension for the inspiration!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ipython-namespaces, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size ipython_namespaces-0.1.3-py3-none-any.whl (2.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size ipython-namespaces-0.1.3.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page