Skip to content

Commit

Permalink
Update README.md with new commands
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Jan 15, 2025
1 parent e0ce712 commit 05d9baa
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ uvx juv
dependencies management to Jupyter notebooks.

```sh
# create a notebook
# Create a notebook
juv init notebook.ipynb
juv init --python=3.9 notebook.ipynb # specify a minimum Python version

# add dependencies to the notebook
# Add dependencies to the notebook
juv add notebook.ipynb pandas numpy
juv add notebook.ipynb --requirements=requirements.txt

# Pin a timestamp to constrain dependency resolution to a specific date
juv stamp notebook.ipynb # now

# launch the notebook
# Launch the notebook
juv run notebook.ipynb
juv run --with=polars notebook.ipynb # additional dependencies for this session (not saved)
juv run [email protected] notebook.ipynb # pick a specific Jupyter frontend
Expand All @@ -57,6 +57,18 @@ juv run --jupyter=nbclassic notebook.ipynb -- --no-browser # pass additional arg
# JUV_JUPYTER env var to set preferred Jupyter frontend (default: lab)
export JUV_JUPYTER=nbclassic
juv run notebook.ipynb

# Lock the dependencies of a notebook
# The lockfile is respected (and updated) when using `juv run`/`juv add`/`juv remove`
juv lock Untitled.ipynb
# Print the lockfile
cat Untitled.ipynb | jq -r '.metadata["uv.lock"]'

# See dependency tree of notebook
juv tree Untitled.ipynb

# Export a lockfile in a pip-compatable format
juv export Untitled.ipynb
```

If a script is provided to `run`, it will be converted to a notebook before
Expand Down

0 comments on commit 05d9baa

Please sign in to comment.