Skip to main content

A little wrapper around `uv` to launch ephemeral Jupyter notebooks.

Project description

juv

A little wrapper around uv to launch ephemeral Jupyter notebooks.

uvx juv
# juv [uvx flags] <command>[@version] <path>
#
# Commands:
#   lab       Launch JupyterLab
#   notebook  Launch Jupyter Notebook (classic)
#
# Arguments:
#   path  Path to the Python script or notebook file
#
# Examples:
#   uvx juv lab script.py
#   uvx juv notebook@7.2.2 script.ipynb
#   uvx juv notebook existing_notebook.ipynb
#   uvx juv --with pandas,matplotlib lab new_notebook.ipynb

juv has two main commands:

  • juv lab launches a Jupyter Lab session
  • juv notebook launches a classic notebook session

Both commands accept a single argument: the path to the notebook or script to launch. A script will be converted to a notebook before launching.

uvx juv lab script.py # creates script.ipynb

Any flags that are passed prior to the command (e.g., uvx juv --with=polars lab) will be forwarded to uvx as-is. This allows you to specify additional dependencies, a different interpreter, etc.

what

PEP 723 (inline script metadata) allows specifying dependencies as comments within Python scripts, enabling self-contained, reproducible execution. This feature could significantly improve reproducibility in the data science ecosystem, since many analyses are shared as standalone code (not packages). However, a lot of data science code lives in notebooks (.ipynb files), not Python scripts (.py files).

juv bridges this gap by:

  • Extending PEP 723-style metadata support from uv to Jupyter notebooks
  • Launching Jupyter sessions with the specified dependencies

It's a simple Python script that parses the notebook and starts a Jupyter session with the specified dependencies (piggybacking on uv's existing functionality).

alternatives

juv is opinionated and might not suit your preferences. That's ok! uv is super extensible, and I recommend reading the documentation to learn about its primitives.

For example, you can achieve a similar workflow using the --with-requirements flag:

uvx --with-requirements=requirements.txt --from=jupyter-core --with=jupyterlab jupyter lab notebook.ipynb

While slightly more verbose, and breaking self-containment, this approach works well.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

juv-0.0.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

juv-0.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file juv-0.0.0.tar.gz.

File metadata

  • Download URL: juv-0.0.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for juv-0.0.0.tar.gz
Algorithm Hash digest
SHA256 a7d8cc576ed4b9600a2b12650d8bf9cb5ec732ad65d11b7bd8b0a6be4259e178
MD5 7a0c7c1b9cd21e63d0041bc006bc2863
BLAKE2b-256 9738f874b98d7c30c4164ecd6d1214daded94936dd326b43a6cb516712393fba

See more details on using hashes here.

File details

Details for the file juv-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: juv-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for juv-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 959a391356800997c0b7a194c4a4ec53399ca4a437b58906f9e0fc7251768a2d
MD5 65085beccfc04c432104b42db24d98e6
BLAKE2b-256 24e52b819ce31ddfeb7b22b11e146bb2520ae6aca9c6a43ccea532fdbd533db8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page