Skip to main content

ipython-cells

iPython extension for executing cells Jupyter-style in .py files. Supports Jupyter and Spyder cell syntax.

Brings the advantages of linear, selective-execution during development to iPython without the bloat of Jupyter.

Example

Suppose we have a .py exported by Jupyter.

example.py

# %% cell1
a = 10
print(a)

# %% cell2
a += 1
print(a)

In ipython:

# load the extension
%load_ext ipython_cells

# load example.py and run a cell
%load_file example.py
%cell_run cell1
10

# load example.py with autoreloading
%load_file example.py --autoreload
%cell_run cell1
10
# example.py is modified by an external editor (e.g. `a = 10`  ->  `a = 20`)
# we detect that and automatically reload the cells
%cell_run cell1
20

# run all cells from beginning of file to cell2 (inclusive)
%cell_run ^cell2
10
11

# run all cells from cell1 (inclusive) to end of file
%cell_run cell1$
12
13

%list_cells
['__first', 'cell1', 'cell2']

Installation

pip install ipython-cells

Optionally, automatically load ipython-cells when ipython starts

~/.ipython/profile_default/ipython_config.py

c.InteractiveShellApp.extensions = [
    'ipython_cells'
]

Metadata

Release files for ipython-cells 2

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

Source distribution (sdist)

Source distribution for ipython-cells 2
File Size Uploaded
ipython_cells-2.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipython-cells 2
File Interpreter ABI Platform
ipython_cells-2-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / ipython_cells-2.tar.gz

Download URL ipython_cells-2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
32a1b2fdf5a5acff4375ad5c14d860a1e6c30abdbefacd6142aebb07857e2cf0
BLAKE2b-256 checksum
How to use checksums
70acfc8112a4c6718219dfb9d11e77413461930fd3e3d37dd325bc466a71549f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8

Release files / ipython_cells-2-py3-none-any.whl

Download URL ipython_cells-2-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23f28110fe1ec5c877e2a12af1c6657c0c5fd741b6a05baeeac2041702e05ee7
BLAKE2b-256 checksum
How to use checksums
f5389104225843ab2f625a8d9fecc45d02d33318b1cbc29c9629675d29dd15f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8

Release history Release notifications | RSS feed

5.2.2

2 release files

5.2.0

1 release file

5.1

2 release files

5

2 release files

4

2 release files

This release

2 This release

2 release files

1.0

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