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
We can execute the invidual cells in a .py file just like a Jupyter notebook.
example.py
# %% cell1
a = 10
print(a)
# %% cell2
a += 1
print(a)
In IPython:
# load the extension and a .py file
%load_ext ipython_cells
%load_file example.py
# run some cells
%cell_run cell1
10
%cell_run cell2
11
# list available cells for running
%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'
]
Execute a range of cells
%load_file example.py
# 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
Autoreloading
# load example.py with autoreloading
%load_file example.py
%cell_run cell1
10
# example.py is modified by an external editor (e.g. `a = 10` -> `a = 20`)
# File change is detected and automatically reloaded
%cell_run cell1
20
Auto reloading can be disabled with %load_file example.py --noreload
Cell Delimiter Syntax
Cells are delimited by special comments. Both Jupyter and Spyder style cells are supported.
Examples
# %% foobar_cell# In[foobar_cell]# %% foobar_cell some extra text# In[foobar_cell] some extra text
Metadata
Release files for ipython-cells 5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ipython_cells-5.tar.gz | 3.4 kB | Without provenance | Details for ipython_cells-5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ipython_cells-5-py3-none-any.whl | Python 3 | none | any | Details for ipython_cells-5-py3-none-any.whl |
Total release size: 7.3 kB
Release files / ipython_cells-5.tar.gz
| Download URL | ipython_cells-5.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
892c63d6dbf348b5ed0f4fe792cfc82595c942373a912c94cfe4dd98b455c85b
|
|
BLAKE2b-256 checksum How to use checksums |
8455f8bbfe53d0789a33e8a84bbfb8dfaace792bb067b6880b549e196607ca56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.9
|
Release files / ipython_cells-5-py3-none-any.whl
| Download URL | ipython_cells-5-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa43d41f5c390c43e244c47a9761419f3c3a2fb1d4a833c98e37de7c243beab4
|
|
BLAKE2b-256 checksum How to use checksums |
eb234006140b1ee818ae4583a6fdf367c4f02c740674c37fe7f391b583c4dcb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.9
|
Security for ipython-cells 5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.