Skip to main content

Jupyter Spaces

codecov Supported Python Versions

Jupyter Spaces is an IPython extension for creating parallel namespaces available within the user namespace. It is designed to be used via IPython magics in Jupyter notebooks.

Installation

pip install jupyter_spaces

jupyter_spaces supports Python versions 3.6, 3.7, 3.8, 3.9 and 3.10.

Usage

Load jupyter_spaces extension

%load_ext jupyter_spaces

Reload jupyter_spaces extension

%reload_ext jupyter_spaces

Reloading the extension will remove all spaces.

Run a cell within a space

%%space <space-name>
alpha = 0.50
alpha

When you execute a cell within a space, all references are firstly searched in the space namespace and secondly in the user namespace. All assignments are made in the space namespace.

Trying to delete a user namespace reference will raise an error. Trying to affect a user namespace reference using the keyword global will produce an execution equivalent to not using such keyword.

Mutable objects in the user namespace can be altered (e.g. appending an item to a list).

Remove a space

%remove_space <space-name>

Access all spaces at once

You can access all the spaces' namespaces at once without using any magic. This might be useful to jointly post-process or compare the spaces' contents.

from jupyter_spaces import get_spaces

spaces = get_spaces()
space = spaces[<space-name>]
reference = space.namespace[<reference-name>]

Space objects have two properties:

  • name the name of the space
  • namespace a dictionary with the namespace of the space

Modifying the spaces via get_spaces will actually modify the underlying spaces.

Acknowledgements

Many thanks to Yeray Diaz Diaz and Karol Duleba!

Release files for jupyter-spaces 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyter-spaces 0.3.0
File Size Uploaded
jupyter_spaces-0.3.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-spaces 0.3.0
File Interpreter ABI Platform
jupyter_spaces-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / jupyter_spaces-0.3.0.tar.gz

Download URL jupyter_spaces-0.3.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b18120a0339d565c92ff45127a08937e332706f5766f77cb262c1fe9afdb778e
BLAKE2b-256 checksum
How to use checksums
0939b5993dbd18d529fed8accc7361b30cfbb0c5407cb78ae8ef1913a7f6f2a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / jupyter_spaces-0.3.0-py3-none-any.whl

Download URL jupyter_spaces-0.3.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d953da8f29562ee155c259696fae7e59e884df7bb30613e5027f471efcadd89
BLAKE2b-256 checksum
How to use checksums
7373df2a457290d56684e00dce4a6c4b9002591e115e32008152ae70b55126ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

1 release file

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page