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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.0.5"
1
+ __version__ = "0.0.6"
2
2
 
3
3
  from .core import *
4
4
  from . import git
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(path: str):
274
- """Execute notebook and place a copy in the executed notebooks directory.
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
- fpath_out = os.path.join(".calkit", "notebooks", "executed", path)
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
- "notebook",
304
+ to,
292
305
  "--output",
293
306
  fpath_out,
294
307
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: calkit-python
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: Reproducibility simplified.
5
5
  Project-URL: Homepage, https://github.com/calkit/calkit
6
6
  Project-URL: Issues, https://github.com/calkit/calkit/issues
@@ -1,5 +1,5 @@
1
- calkit/__init__.py,sha256=msMn6fygXybwu7UaIyTE7aSHGggrzrO1oPGG8SC8EbQ,142
2
- calkit/cli.py,sha256=akfF8Qk_okiVNS37fUjjMMjDQaqIVi7NTam96XjVGQE,11427
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.5.dist-info/METADATA,sha256=tTUrA0R_i6RffDEd4VmMHbWvN0NR_4ifj53-SauHuVI,4004
17
- calkit_python-0.0.5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
18
- calkit_python-0.0.5.dist-info/entry_points.txt,sha256=tiPfbDDZNB-YStw5YVO_4Gww0W3Dcdy8Mh6muX_GWnY,42
19
- calkit_python-0.0.5.dist-info/licenses/LICENSE,sha256=9ZamCaSUTZk9rcrnf-sWFKLOHr3ws-S_dgKMegW4nw8,1056
20
- calkit_python-0.0.5.dist-info/RECORD,,
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,,