Skip to content

raesl.jupyter

ESL Jupyter Kernel

Elephant Specification Language Kernel for Jupyter.

cli

ESL Jupyter kernel Command Line Interface.

install

install(
    user: bool,
    sys_prefix: bool,
    prefix: Optional[str] = None,
) -> None

Install the ESL Jupyter kernel spec.

Source code in src/raesl/jupyter/cli.py
@jupyter.command("install")
@click.option(
    "--user",
    is_flag=True,
    default=False,
    help="Install to the per-user kernels registry. Default if not root.",
)
@click.option(
    "--sys-prefix",
    is_flag=True,
    default=False,
    help="Install to sys.prefix (e.g. a virtualenv or conda env)",
)
@click.option(
    "--prefix",
    default=None,
    type=click.Path(exists=True, dir_okay=True, file_okay=False),
    help="Install to the given prefix. "
    "Kernelspec will be installed to {prefix}/share/jupyter/kernels/",
)
def install(user: bool, sys_prefix: bool, prefix: Optional[str] = None) -> None:
    """Install the ESL Jupyter kernel spec."""
    prefix = sys.prefix if sys_prefix else prefix

    if not prefix and not _is_root():
        user = True

    install_my_kernel_spec(user=user, prefix=prefix)

jupyter

jupyter()

Manage the Jupyter ESL kernel.

Source code in src/raesl/jupyter/cli.py
@click.group("jupyter")
def jupyter():
    """Manage the Jupyter ESL kernel."""
    pass

run

run(f: str)

Run the ESL Jupyter kernel.

Source code in src/raesl/jupyter/cli.py
@jupyter.command("run")
@click.option(
    "-f",
    type=click.Path(exists=True, file_okay=True, dir_okay=False),
    help="Kernel connection file.",
)
def run(f: str):
    """Run the ESL Jupyter kernel."""
    from ipykernel.kernelapp import IPKernelApp
    from raesl.jupyter.kernel import EslKernel

    IPKernelApp.launch_instance(kernel_class=EslKernel)

kernel

ESL Jupyter Kernel implementation.