calkit-python 0.0.5__py3-none-any.whl → 0.0.6__py3-none-any.whl
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.
- calkit/__init__.py +1 -1
- calkit/cli.py +17 -4
- {calkit_python-0.0.5.dist-info → calkit_python-0.0.6.dist-info}/METADATA +1 -1
- {calkit_python-0.0.5.dist-info → calkit_python-0.0.6.dist-info}/RECORD +7 -7
- {calkit_python-0.0.5.dist-info → calkit_python-0.0.6.dist-info}/WHEEL +0 -0
- {calkit_python-0.0.5.dist-info → calkit_python-0.0.6.dist-info}/entry_points.txt +0 -0
- {calkit_python-0.0.5.dist-info → calkit_python-0.0.6.dist-info}/licenses/LICENSE +0 -0
calkit/__init__.py
CHANGED
calkit/cli.py
CHANGED
|
@@ -270,15 +270,28 @@ def clean_notebook_outputs(path: str):
|
|
|
270
270
|
|
|
271
271
|
|
|
272
272
|
@notebooks_app.command("execute")
|
|
273
|
-
def execute_notebook(
|
|
274
|
-
|
|
273
|
+
def execute_notebook(
|
|
274
|
+
path: str,
|
|
275
|
+
to: Annotated[
|
|
276
|
+
str, typer.Option("--to", help="Output format ('html' or 'notebook').")
|
|
277
|
+
] = "notebook",
|
|
278
|
+
):
|
|
279
|
+
"""Execute notebook and place a copy in the relevant directory.
|
|
275
280
|
|
|
276
281
|
This can be useful to use as a preprocessing DVC stage to use a clean
|
|
277
282
|
notebook as a dependency for a stage that caches and executed notebook.
|
|
278
283
|
"""
|
|
279
284
|
if os.path.isabs(path):
|
|
280
285
|
raise ValueError("Path must be relative")
|
|
281
|
-
|
|
286
|
+
if to == "html":
|
|
287
|
+
subdir = "html"
|
|
288
|
+
fname_out = path.removesuffix(".ipynb") + ".html"
|
|
289
|
+
elif to == "notebook":
|
|
290
|
+
subdir = "executed"
|
|
291
|
+
fname_out = path
|
|
292
|
+
else:
|
|
293
|
+
raise ValueError(f"Invalid output format: '{to}'")
|
|
294
|
+
fpath_out = os.path.join(".calkit", "notebooks", subdir, fname_out)
|
|
282
295
|
folder = os.path.dirname(fpath_out)
|
|
283
296
|
os.makedirs(folder, exist_ok=True)
|
|
284
297
|
subprocess.call(
|
|
@@ -288,7 +301,7 @@ def execute_notebook(path: str):
|
|
|
288
301
|
path,
|
|
289
302
|
"--execute",
|
|
290
303
|
"--to",
|
|
291
|
-
|
|
304
|
+
to,
|
|
292
305
|
"--output",
|
|
293
306
|
fpath_out,
|
|
294
307
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
calkit/__init__.py,sha256=
|
|
2
|
-
calkit/cli.py,sha256=
|
|
1
|
+
calkit/__init__.py,sha256=MLdE9hjYmVEWkHdbusBCZDUzUC3oiY_AL-IfCGKX8eI,142
|
|
2
|
+
calkit/cli.py,sha256=Ko3ntXUTqYeiLv00PQz68SWRp_vY1hruQgjmgwXnuzc,11788
|
|
3
3
|
calkit/cloud.py,sha256=CnQKms4mBQo4X8jVLIa-70-3jPDl38zRNFyK5TjiaHM,2209
|
|
4
4
|
calkit/config.py,sha256=NPFRk5inn66Wy44pyx8WppyqvIzkW1sO6VjXwIcCacE,2044
|
|
5
5
|
calkit/core.py,sha256=qLNjBwlECzMitL85pMGIHzne4j7FpQAR9-ukYtdIMig,1225
|
|
@@ -13,8 +13,8 @@ calkit/server.py,sha256=gq3643ABKTQu1eVR_OqJ-SdQh2dPLHSFsipmmAK5ttA,5959
|
|
|
13
13
|
calkit/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
calkit/tests/test_core.py,sha256=CdRqvYnq3MidyTknvfIbkmmhMfydpyKtTW9hakAvzsc,167
|
|
15
15
|
calkit/tests/test_jupyter.py,sha256=YTL6zI740UM2KUjskSipzvSKxsyQ8rVPFQIX5cb2tMQ,114
|
|
16
|
-
calkit_python-0.0.
|
|
17
|
-
calkit_python-0.0.
|
|
18
|
-
calkit_python-0.0.
|
|
19
|
-
calkit_python-0.0.
|
|
20
|
-
calkit_python-0.0.
|
|
16
|
+
calkit_python-0.0.6.dist-info/METADATA,sha256=kL3dH09fqVyHjPjkKnclC21IAHwmwP8NNdvWgOEEthg,4004
|
|
17
|
+
calkit_python-0.0.6.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
18
|
+
calkit_python-0.0.6.dist-info/entry_points.txt,sha256=tiPfbDDZNB-YStw5YVO_4Gww0W3Dcdy8Mh6muX_GWnY,42
|
|
19
|
+
calkit_python-0.0.6.dist-info/licenses/LICENSE,sha256=9ZamCaSUTZk9rcrnf-sWFKLOHr3ws-S_dgKMegW4nw8,1056
|
|
20
|
+
calkit_python-0.0.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|