Build a Python package from notebooks.
1
2
3
4def build(
root='.' # root directory containing pyproject.toml
) -> str:
"""Build a Python package from notebooks.""" Build a Python package from notebooks.
1
2
3
4def build(
root='.' # root directory containing pyproject.toml
) -> str:
"""Build a Python package from notebooks.""" Remove cache and temporary files (__pycache__, __marimo__, .pytest_cache, etc).
1
2def tidy():
"""Remove cache and temporary files (__pycache__, __marimo__, .pytest_cache, etc).""" Remove all build artifacts (dist, docs, src) and cache files.
1
2def nuke():
"""Remove all build artifacts (dist, docs, src) and cache files.""" Map import name to PyPI package name.
1
2
3
4def get_pypi_name(
import_name
):
"""Map import name to PyPI package name.""" Extract top-level module names from import nodes.
1
2
3
4def extract_import_names(
nodes
):
"""Extract top-level module names from import nodes.""" Generate PEP 723 inline script metadata.
1
2
3
4def pep723_header(
deps
):
"""Generate PEP 723 inline script metadata.""" Bundle all notebooks into a single Python file with PEP 723 dependencies.
1
2
3
4
5def bundle(
root='.',
name=None
):
"""Bundle all notebooks into a single Python file with PEP 723 dependencies."""