execnb 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {execnb-0.2.0/execnb.egg-info → execnb-0.2.2}/PKG-INFO +8 -8
- {execnb-0.2.0 → execnb-0.2.2}/README.md +7 -7
- execnb-0.2.2/execnb/__init__.py +1 -0
- {execnb-0.2.0 → execnb-0.2.2}/execnb/shell.py +31 -31
- {execnb-0.2.0 → execnb-0.2.2/execnb.egg-info}/PKG-INFO +8 -8
- execnb-0.2.0/execnb/__init__.py +0 -1
- {execnb-0.2.0 → execnb-0.2.2}/LICENSE +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/MANIFEST.in +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/execnb/_modidx.py +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/execnb.egg-info/SOURCES.txt +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/execnb.egg-info/dependency_links.txt +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/execnb.egg-info/entry_points.txt +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/execnb.egg-info/requires.txt +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/execnb.egg-info/top_level.txt +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/pyproject.toml +0 -0
- {execnb-0.2.0 → execnb-0.2.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: execnb
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A description of your project
|
|
5
5
|
Author-email: Jeremy Howard <j@fast.ai>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -53,9 +53,9 @@ to run Jupyter code and capture notebook outputs, without running a
|
|
|
53
53
|
Jupyter server (or even having it installed):
|
|
54
54
|
|
|
55
55
|
``` python
|
|
56
|
-
from execnb.nbio import *
|
|
57
56
|
from execnb.shell import *
|
|
58
57
|
from fastcore.utils import *
|
|
58
|
+
from fastcore.nbio import *
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
``` python
|
|
@@ -66,7 +66,7 @@ s.run('1+1')
|
|
|
66
66
|
[{'data': {'text/plain': ['2']},
|
|
67
67
|
'metadata': {},
|
|
68
68
|
'output_type': 'execute_result',
|
|
69
|
-
'execution_count':
|
|
69
|
+
'execution_count': None}]
|
|
70
70
|
|
|
71
71
|
To execute a notebook and save it with outputs filled in, use
|
|
72
72
|
[`CaptureShell.execute`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell.execute):
|
|
@@ -78,7 +78,7 @@ try:
|
|
|
78
78
|
finally: Path('tmp.ipynb').unlink()
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count':
|
|
81
|
+
[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count': None, 'metadata': {}, 'output_type': 'execute_result'}]
|
|
82
82
|
|
|
83
83
|
You can also execute notebooks from the command line with
|
|
84
84
|
[`exec_nb`](https://AnswerDotAI.github.io/execnb/shell.html#exec_nb):
|
|
@@ -88,8 +88,7 @@ You can also execute notebooks from the command line with
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
usage: exec_nb [-h] [--dest DEST] [--exc_stop] [--inject_code INJECT_CODE]
|
|
91
|
-
[--inject_path INJECT_PATH] [--inject_idx INJECT_IDX]
|
|
92
|
-
[--verbose]
|
|
91
|
+
[--inject_path INJECT_PATH] [--inject_idx INJECT_IDX] [--verbose]
|
|
93
92
|
src
|
|
94
93
|
|
|
95
94
|
Execute notebook from `src` and save with outputs to `dest`
|
|
@@ -97,11 +96,12 @@ You can also execute notebooks from the command line with
|
|
|
97
96
|
positional arguments:
|
|
98
97
|
src Notebook path to read from
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
options:
|
|
101
100
|
-h, --help show this help message and exit
|
|
102
101
|
--dest DEST Notebook path to write to (default: )
|
|
103
102
|
--exc_stop Stop on exceptions? (default: False)
|
|
104
103
|
--inject_code INJECT_CODE Code to inject into a cell
|
|
105
104
|
--inject_path INJECT_PATH Path to file containing code to inject into a cell
|
|
106
105
|
--inject_idx INJECT_IDX Cell to replace with `inject_code` (default: 0)
|
|
107
|
-
--verbose Show stdout/stderr during execution (default:
|
|
106
|
+
--verbose Show stdout/stderr during execution (default:
|
|
107
|
+
False)
|
|
@@ -28,9 +28,9 @@ to run Jupyter code and capture notebook outputs, without running a
|
|
|
28
28
|
Jupyter server (or even having it installed):
|
|
29
29
|
|
|
30
30
|
``` python
|
|
31
|
-
from execnb.nbio import *
|
|
32
31
|
from execnb.shell import *
|
|
33
32
|
from fastcore.utils import *
|
|
33
|
+
from fastcore.nbio import *
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
``` python
|
|
@@ -41,7 +41,7 @@ s.run('1+1')
|
|
|
41
41
|
[{'data': {'text/plain': ['2']},
|
|
42
42
|
'metadata': {},
|
|
43
43
|
'output_type': 'execute_result',
|
|
44
|
-
'execution_count':
|
|
44
|
+
'execution_count': None}]
|
|
45
45
|
|
|
46
46
|
To execute a notebook and save it with outputs filled in, use
|
|
47
47
|
[`CaptureShell.execute`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell.execute):
|
|
@@ -53,7 +53,7 @@ try:
|
|
|
53
53
|
finally: Path('tmp.ipynb').unlink()
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count':
|
|
56
|
+
[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count': None, 'metadata': {}, 'output_type': 'execute_result'}]
|
|
57
57
|
|
|
58
58
|
You can also execute notebooks from the command line with
|
|
59
59
|
[`exec_nb`](https://AnswerDotAI.github.io/execnb/shell.html#exec_nb):
|
|
@@ -63,8 +63,7 @@ You can also execute notebooks from the command line with
|
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
usage: exec_nb [-h] [--dest DEST] [--exc_stop] [--inject_code INJECT_CODE]
|
|
66
|
-
[--inject_path INJECT_PATH] [--inject_idx INJECT_IDX]
|
|
67
|
-
[--verbose]
|
|
66
|
+
[--inject_path INJECT_PATH] [--inject_idx INJECT_IDX] [--verbose]
|
|
68
67
|
src
|
|
69
68
|
|
|
70
69
|
Execute notebook from `src` and save with outputs to `dest`
|
|
@@ -72,11 +71,12 @@ You can also execute notebooks from the command line with
|
|
|
72
71
|
positional arguments:
|
|
73
72
|
src Notebook path to read from
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
options:
|
|
76
75
|
-h, --help show this help message and exit
|
|
77
76
|
--dest DEST Notebook path to write to (default: )
|
|
78
77
|
--exc_stop Stop on exceptions? (default: False)
|
|
79
78
|
--inject_code INJECT_CODE Code to inject into a cell
|
|
80
79
|
--inject_path INJECT_PATH Path to file containing code to inject into a cell
|
|
81
80
|
--inject_idx INJECT_IDX Cell to replace with `inject_code` (default: 0)
|
|
82
|
-
--verbose Show stdout/stderr during execution (default:
|
|
81
|
+
--verbose Show stdout/stderr during execution (default:
|
|
82
|
+
False)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.2"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"""A shell for running notebook code without a notebook server"""
|
|
2
2
|
|
|
3
|
-
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/
|
|
3
|
+
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_shell.ipynb.
|
|
4
4
|
|
|
5
5
|
# %% auto #0
|
|
6
6
|
__all__ = ['CaptureShell', 'format_exc', 'NbResult', 'render_outputs', 'find_output', 'out_exec', 'out_stream', 'out_error',
|
|
7
7
|
'exec_nb', 'SmartCompleter']
|
|
8
8
|
|
|
9
|
-
# %% ../nbs/
|
|
9
|
+
# %% ../nbs/00_shell.ipynb #535003cf
|
|
10
10
|
from fastcore.utils import *
|
|
11
11
|
from fastcore.script import call_parse
|
|
12
12
|
from fastcore.ansi import ansi2html, strip_ansi
|
|
@@ -27,15 +27,12 @@ from IPython.display import display as disp, HTML
|
|
|
27
27
|
|
|
28
28
|
from base64 import b64encode
|
|
29
29
|
from html import escape
|
|
30
|
-
try: from matplotlib_inline.backend_inline import set_matplotlib_formats
|
|
31
|
-
except ImportError: set_matplotlib_formats = None
|
|
32
|
-
|
|
33
30
|
|
|
34
31
|
from fastcore.nbio import *
|
|
35
32
|
from fastcore.nbio import _dict2obj
|
|
36
33
|
|
|
37
34
|
|
|
38
|
-
# %% ../nbs/
|
|
35
|
+
# %% ../nbs/00_shell.ipynb #6913382c
|
|
39
36
|
class _CustDisplayHook(DisplayHook):
|
|
40
37
|
def write_output_prompt(self): pass
|
|
41
38
|
def write_format_data(self, data, md_dict): pass
|
|
@@ -47,7 +44,7 @@ def __repr__(self: ExecutionInfo): return f'cell: {self.raw_cell}; id: {self.cel
|
|
|
47
44
|
@patch
|
|
48
45
|
def __repr__(self: ExecutionResult): return f'result: {self.result}; err: {self.error_in_exec}; info: <{self.info}>'
|
|
49
46
|
|
|
50
|
-
# %% ../nbs/
|
|
47
|
+
# %% ../nbs/00_shell.ipynb #e3fb2bee
|
|
51
48
|
class CaptureShell(InteractiveShell):
|
|
52
49
|
displayhook_class = _CustDisplayHook
|
|
53
50
|
|
|
@@ -59,10 +56,13 @@ class CaptureShell(InteractiveShell):
|
|
|
59
56
|
if path: self.set_path(path)
|
|
60
57
|
self.display_formatter.active = True
|
|
61
58
|
if not IN_NOTEBOOK: InteractiveShell._instance = self
|
|
62
|
-
if
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
if mpl_format:
|
|
60
|
+
try: from matplotlib_inline.backend_inline import set_matplotlib_formats
|
|
61
|
+
except ImportError: set_matplotlib_formats = None
|
|
62
|
+
if set_matplotlib_formats:
|
|
63
|
+
self.enable_matplotlib("inline")
|
|
64
|
+
self._run("from matplotlib_inline.backend_inline import set_matplotlib_formats")
|
|
65
|
+
self._run(f"set_matplotlib_formats('{mpl_format}')")
|
|
66
66
|
|
|
67
67
|
def _run(self, raw_cell, store_history=False, silent=False, shell_futures=True, cell_id=None,
|
|
68
68
|
stdout=True, stderr=True, display=True, verbose=False):
|
|
@@ -73,16 +73,16 @@ class CaptureShell(InteractiveShell):
|
|
|
73
73
|
return AttrDict(result=result, stdout='' if semic else c.stdout, stderr=c.stderr,
|
|
74
74
|
display_objects=c.outputs,
|
|
75
75
|
exception=result.error_in_exec or result.error_before_exec, quiet=semic)
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
def set_path(self, path):
|
|
78
78
|
"Add `path` to python path, or `path.parent` if it's a file"
|
|
79
79
|
path = Path(path)
|
|
80
80
|
if path.is_file(): path = path.parent
|
|
81
81
|
self._run(f"import sys; sys.path.insert(0, '{path.as_posix()}')")
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
def enable_gui(self, gui=None): pass
|
|
84
84
|
|
|
85
|
-
# %% ../nbs/
|
|
85
|
+
# %% ../nbs/00_shell.ipynb #93adf867
|
|
86
86
|
@patch
|
|
87
87
|
def run_cell(self:CaptureShell, raw_cell, store_history=False, silent=False, shell_futures=True, cell_id=None,
|
|
88
88
|
stdout=True, stderr=True, display=True, timeout=None, verbose=False):
|
|
@@ -96,15 +96,15 @@ def run_cell(self:CaptureShell, raw_cell, store_history=False, silent=False, she
|
|
|
96
96
|
finally:
|
|
97
97
|
if timeout: signal.alarm(0)
|
|
98
98
|
|
|
99
|
-
# %% ../nbs/
|
|
99
|
+
# %% ../nbs/00_shell.ipynb #a1eb7703
|
|
100
100
|
def format_exc(e):
|
|
101
101
|
"Format exception `e` as a string list"
|
|
102
102
|
return traceback.format_exception(type(e), e, e.__traceback__)
|
|
103
103
|
|
|
104
|
-
# %% ../nbs/
|
|
104
|
+
# %% ../nbs/00_shell.ipynb #8ba0ae59
|
|
105
105
|
class NbResult(list): pass
|
|
106
106
|
|
|
107
|
-
# %% ../nbs/
|
|
107
|
+
# %% ../nbs/00_shell.ipynb #26bf9161
|
|
108
108
|
def _out_stream(text, name): return dict(name=name, output_type='stream', text=text.splitlines(True))
|
|
109
109
|
def _out_exc(e):
|
|
110
110
|
ename = type(e).__name__
|
|
@@ -137,7 +137,7 @@ def _out_nb(o, fmt):
|
|
|
137
137
|
if p["output_type"]=="execute_result": p['execution_count'] = o['execution_count']
|
|
138
138
|
return res
|
|
139
139
|
|
|
140
|
-
# %% ../nbs/
|
|
140
|
+
# %% ../nbs/00_shell.ipynb #242f732f
|
|
141
141
|
@patch
|
|
142
142
|
def run(self:CaptureShell,
|
|
143
143
|
code:str, # Python/IPython code to run
|
|
@@ -151,7 +151,7 @@ def run(self:CaptureShell,
|
|
|
151
151
|
self.exc = res.exception
|
|
152
152
|
return _out_nb(res, self.display_formatter)
|
|
153
153
|
|
|
154
|
-
# %% ../nbs/
|
|
154
|
+
# %% ../nbs/00_shell.ipynb #eaa11df9
|
|
155
155
|
@patch
|
|
156
156
|
async def run_async(self:CaptureShell,
|
|
157
157
|
code: str, # Python/IPython code to run
|
|
@@ -161,7 +161,7 @@ async def run_async(self:CaptureShell,
|
|
|
161
161
|
verbose:bool=False): # Show stdout/stderr during execution
|
|
162
162
|
return self.run(code, stdout=stdout, stderr=stderr, timeout=timeout, verbose=verbose)
|
|
163
163
|
|
|
164
|
-
# %% ../nbs/
|
|
164
|
+
# %% ../nbs/00_shell.ipynb #f698a432
|
|
165
165
|
def _pre(s, xtra=''): return f"<pre {xtra}><code>{escape(s)}</code></pre>"
|
|
166
166
|
def _strip(s): return strip_ansi(escape(s))
|
|
167
167
|
|
|
@@ -196,7 +196,7 @@ def render_outputs(outputs, ansi_renderer=_strip, include_imgs=True, pygments=Fa
|
|
|
196
196
|
|
|
197
197
|
return '\n'.join(map(render_output, outputs))
|
|
198
198
|
|
|
199
|
-
# %% ../nbs/
|
|
199
|
+
# %% ../nbs/00_shell.ipynb #c6176b9e
|
|
200
200
|
@patch
|
|
201
201
|
def cell(self:CaptureShell, cell, stdout=True, stderr=True, verbose=False):
|
|
202
202
|
"Run `cell`, skipping if not code, and store outputs back in cell"
|
|
@@ -205,32 +205,32 @@ def cell(self:CaptureShell, cell, stdout=True, stderr=True, verbose=False):
|
|
|
205
205
|
outs = self.run(cell.source, verbose=verbose)
|
|
206
206
|
if outs: cell.outputs = _dict2obj(outs)
|
|
207
207
|
|
|
208
|
-
# %% ../nbs/
|
|
208
|
+
# %% ../nbs/00_shell.ipynb #008c0cef
|
|
209
209
|
def find_output(outp, # Output from `run`
|
|
210
210
|
ot='execute_result' # Output_type to find
|
|
211
211
|
):
|
|
212
212
|
"Find first output of type `ot` in `CaptureShell.run` output"
|
|
213
213
|
return first(o for o in outp if o['output_type']==ot)
|
|
214
214
|
|
|
215
|
-
# %% ../nbs/
|
|
215
|
+
# %% ../nbs/00_shell.ipynb #6e677414
|
|
216
216
|
def out_exec(outp):
|
|
217
217
|
"Get data from execution result in `outp`."
|
|
218
218
|
out = find_output(outp)
|
|
219
219
|
if out: return '\n'.join(first(out['data'].values()))
|
|
220
220
|
|
|
221
|
-
# %% ../nbs/
|
|
221
|
+
# %% ../nbs/00_shell.ipynb #c7352a2b
|
|
222
222
|
def out_stream(outp):
|
|
223
223
|
"Get text from stream in `outp`."
|
|
224
224
|
out = find_output(outp, 'stream')
|
|
225
225
|
if out: return ('\n'.join(out['text'])).strip()
|
|
226
226
|
|
|
227
|
-
# %% ../nbs/
|
|
227
|
+
# %% ../nbs/00_shell.ipynb #7d52326c
|
|
228
228
|
def out_error(outp):
|
|
229
229
|
"Get traceback from error in `outp`."
|
|
230
230
|
out = find_output(outp, 'error')
|
|
231
231
|
if out: return '\n'.join(out['traceback'])
|
|
232
232
|
|
|
233
|
-
# %% ../nbs/
|
|
233
|
+
# %% ../nbs/00_shell.ipynb #60a25f27
|
|
234
234
|
def _false(o): return False
|
|
235
235
|
|
|
236
236
|
@patch
|
|
@@ -251,7 +251,7 @@ def run_all(self:CaptureShell,
|
|
|
251
251
|
postproc(cell)
|
|
252
252
|
if self.exc and exc_stop: raise self.exc from None
|
|
253
253
|
|
|
254
|
-
# %% ../nbs/
|
|
254
|
+
# %% ../nbs/00_shell.ipynb #70808010
|
|
255
255
|
@patch
|
|
256
256
|
def execute(self:CaptureShell,
|
|
257
257
|
src:str|Path, # Notebook path to read from
|
|
@@ -273,7 +273,7 @@ def execute(self:CaptureShell,
|
|
|
273
273
|
inject_code=inject_code, inject_idx=inject_idx, verbose=verbose)
|
|
274
274
|
if dest: write_nb(nb, dest)
|
|
275
275
|
|
|
276
|
-
# %% ../nbs/
|
|
276
|
+
# %% ../nbs/00_shell.ipynb #694161cb
|
|
277
277
|
@patch
|
|
278
278
|
def prettytb(self:CaptureShell,
|
|
279
279
|
fname:str|Path=None): # filename to print alongside the traceback
|
|
@@ -285,7 +285,7 @@ def prettytb(self:CaptureShell,
|
|
|
285
285
|
fname_str = f' in {fname}' if fname else ''
|
|
286
286
|
return f"{type(self.exc).__name__}{fname_str}:\n{_fence}\n{cell_str}\n"
|
|
287
287
|
|
|
288
|
-
# %% ../nbs/
|
|
288
|
+
# %% ../nbs/00_shell.ipynb #1227c8b1
|
|
289
289
|
@call_parse
|
|
290
290
|
def exec_nb(
|
|
291
291
|
src:str, # Notebook path to read from
|
|
@@ -300,7 +300,7 @@ def exec_nb(
|
|
|
300
300
|
CaptureShell().execute(src, dest, exc_stop=exc_stop, inject_code=inject_code,
|
|
301
301
|
inject_path=inject_path, inject_idx=inject_idx, verbose=verbose)
|
|
302
302
|
|
|
303
|
-
# %% ../nbs/
|
|
303
|
+
# %% ../nbs/00_shell.ipynb #c44963a0
|
|
304
304
|
class SmartCompleter(IPCompleter):
|
|
305
305
|
def __init__(self, shell, namespace=None, jedi=False):
|
|
306
306
|
if namespace is None: namespace = shell.user_ns
|
|
@@ -320,7 +320,7 @@ class SmartCompleter(IPCompleter):
|
|
|
320
320
|
if res and res[0][-1]=='=': res = [o for o in res if o[-1]=='=']
|
|
321
321
|
return res
|
|
322
322
|
|
|
323
|
-
# %% ../nbs/
|
|
323
|
+
# %% ../nbs/00_shell.ipynb #7d7c852c
|
|
324
324
|
@patch
|
|
325
325
|
def complete(self:CaptureShell, c):
|
|
326
326
|
if not hasattr(self, '_completer'): self._completer = SmartCompleter(self)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: execnb
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A description of your project
|
|
5
5
|
Author-email: Jeremy Howard <j@fast.ai>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -53,9 +53,9 @@ to run Jupyter code and capture notebook outputs, without running a
|
|
|
53
53
|
Jupyter server (or even having it installed):
|
|
54
54
|
|
|
55
55
|
``` python
|
|
56
|
-
from execnb.nbio import *
|
|
57
56
|
from execnb.shell import *
|
|
58
57
|
from fastcore.utils import *
|
|
58
|
+
from fastcore.nbio import *
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
``` python
|
|
@@ -66,7 +66,7 @@ s.run('1+1')
|
|
|
66
66
|
[{'data': {'text/plain': ['2']},
|
|
67
67
|
'metadata': {},
|
|
68
68
|
'output_type': 'execute_result',
|
|
69
|
-
'execution_count':
|
|
69
|
+
'execution_count': None}]
|
|
70
70
|
|
|
71
71
|
To execute a notebook and save it with outputs filled in, use
|
|
72
72
|
[`CaptureShell.execute`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell.execute):
|
|
@@ -78,7 +78,7 @@ try:
|
|
|
78
78
|
finally: Path('tmp.ipynb').unlink()
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count':
|
|
81
|
+
[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\n']}, {'data': {'text/plain': ['2']}, 'execution_count': None, 'metadata': {}, 'output_type': 'execute_result'}]
|
|
82
82
|
|
|
83
83
|
You can also execute notebooks from the command line with
|
|
84
84
|
[`exec_nb`](https://AnswerDotAI.github.io/execnb/shell.html#exec_nb):
|
|
@@ -88,8 +88,7 @@ You can also execute notebooks from the command line with
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
usage: exec_nb [-h] [--dest DEST] [--exc_stop] [--inject_code INJECT_CODE]
|
|
91
|
-
[--inject_path INJECT_PATH] [--inject_idx INJECT_IDX]
|
|
92
|
-
[--verbose]
|
|
91
|
+
[--inject_path INJECT_PATH] [--inject_idx INJECT_IDX] [--verbose]
|
|
93
92
|
src
|
|
94
93
|
|
|
95
94
|
Execute notebook from `src` and save with outputs to `dest`
|
|
@@ -97,11 +96,12 @@ You can also execute notebooks from the command line with
|
|
|
97
96
|
positional arguments:
|
|
98
97
|
src Notebook path to read from
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
options:
|
|
101
100
|
-h, --help show this help message and exit
|
|
102
101
|
--dest DEST Notebook path to write to (default: )
|
|
103
102
|
--exc_stop Stop on exceptions? (default: False)
|
|
104
103
|
--inject_code INJECT_CODE Code to inject into a cell
|
|
105
104
|
--inject_path INJECT_PATH Path to file containing code to inject into a cell
|
|
106
105
|
--inject_idx INJECT_IDX Cell to replace with `inject_code` (default: 0)
|
|
107
|
-
--verbose Show stdout/stderr during execution (default:
|
|
106
|
+
--verbose Show stdout/stderr during execution (default:
|
|
107
|
+
False)
|
execnb-0.2.0/execnb/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|