# core


<div class="boopcell boop-raw">

</div>

<div class="boopcell boop-note">

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

</div>

<div class="boopcell boop-note">

## Port management

Before starting, boopiter checks who owns the target port:
[`_port_owner`](https://drscotthawley.github.io/boopiter/core.html#_port_owner)
pings it to tell a running boopiter from someone else from nobody, and
[`_kill_port`](https://drscotthawley.github.io/boopiter/core.html#_kill_port)
frees a port held by a *previous boopiter* run – so relaunching is safe
but an unrelated service is never killed.

</div>

<div class="boopcell boop-note">

## Tailwind precompile

[`_build_tailwind`](https://drscotthawley.github.io/boopiter/core.html#_build_tailwind)
compiles a static Tailwind CSS file once at launch, replacing the CDN’s
in-browser JIT compiler – faster page loads and no runtime CDN
dependency.

</div>

<div class="boopcell boop-note">

## Launching

[`launch`](https://drscotthawley.github.io/boopiter/core.html#launch)
ties it together – free the port if it’s ours, build the CSS, start the
server. It’s the `@call_parse` entry point exposed on the command line.

</div>

<div class="prose" data-markdown="1">

------------------------------------------------------------------------

<a
href="https://github.com/drscotthawley/boopiter/blob/main/boopiter/core.py#L54"
target="_blank" style="float:right; font-size:smaller">source</a>

### launch

``` python
def launch(
    nbfile:Annotated=None, # .ipynb file to load on startup
    port:int=8000, # the port to serve boopiter on
    no_auth:bool=False, # skip token-gating the server -- ONLY on a network you fully trust; every code cell already runs with this process's own permissions, so an unauthed boopiter is equivalent to handing out a shell
):
```

*Launch (or relaunch) the boopiter server; refuses to touch a port held
by something that isn’t boopiter*

</div>
