A description of your project
Project description
execnb
Install
Either:
pip install execnb
or if you use conda:
conda install -c fastai execnb
(You can replace conda
with mamba
in the line above if you have
mamba installed.)
How to use
Use CaptureShell
to run Jupyter code and capture notebook outputs,
without running a Jupyter server (or even having it installed):
s = CaptureShell()
s.run('1+1')
[{'data': {'text/plain': ['2']},
'metadata': {},
'output_type': 'execute_result',
'execution_count': 1}]
To execute a notebook and save it with outputs filled in, use execute
:
try:
s.execute('../tests/clean.ipynb', 'tmp.ipynb')
print(read_nb('tmp.ipynb').cells[1].outputs)
finally: Path('tmp.ipynb').unlink()
[{'data': {'text/plain': ['2']}, 'execution_count': 6, 'metadata': {}, 'output_type': 'execute_result'}, {'name': 'stdout', 'output_type': 'stream', 'text': ['1']}]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
execnb-0.0.1.tar.gz
(11.8 kB
view details)
Built Distribution
execnb-0.0.1-py3-none-any.whl
(11.6 kB
view details)
File details
Details for the file execnb-0.0.1.tar.gz
.
File metadata
- Download URL: execnb-0.0.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 313d350b1dc93eb2ea4fdee617a084bcd5fbd41be95ef2f793debbdd7e5e3205 |
|
MD5 | 8e6d7d745af3d38e8876fe74ae5be182 |
|
BLAKE2b-256 | 336ac7a2d2e87739652962c68138d18c72db9fdbe0ed5a64258a51816606410b |
File details
Details for the file execnb-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: execnb-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 311630bf83a3957af1c265c6bafaf8cb2a154bdfc901c9639b55a6dcdccafd84 |
|
MD5 | d2eb23b7713fa209330a8b9462a76bc7 |
|
BLAKE2b-256 | e68843a17ec5f22ae40911a10648e0c0d25a038307dbcf688babdb2fcd27cba4 |