Skip to main content

nuv

PyPI version Python versions License PyPI monthly downloads Downloads Wheel CI Publish to PyPI Lint: Ruff Types: ty

Scaffold opinionated uv Python projects — tests passing, linting green, out of the box.

nuv new my-tool

That's it. You get a working project with click, logging, test coverage, ruff, and ty — all green from commit zero.

Install

uv tool install nuv

Run without installing

uvx nuv new my-tool

Usage

nuv new <name>                              # creates ./<name>/, syncs deps, prints tool install command
nuv new <name> --at <path>                  # creates at an explicit path
nuv new <name> --archetype spark            # PySpark 4 project with notebooks
nuv new <name> --archetype fastapi          # FastAPI + Granian + Docker
nuv new <name> --archetype polars           # Polars + DuckDB + Delta Lake for local data work
nuv new <name> --archetype ds               # Data science: thin core + commented DS/ML/LLM catalog
nuv new <name> --archetype util             # Lean reusable utility (uv_build, agent-ready) for scripts, migrations, remediations
nuv new <name> --python-version 3.13        # override default Python version
nuv new <name> --install none               # scaffold + sync, skip tool install
nuv new <name> --install command-only       # log install command, do not execute (default)
nuv new <name> --keep-on-failure            # keep generated files if sync/install fails

Archetypes

script (default)

A single-file CLI tool with click and logging.

nuv new my-tool
my-tool/
├── main.py          # click + logging
├── _logging.py
├── pyproject.toml   # pytest, ruff, ty, uv
├── README.md
└── tests/
    ├── __init__.py
    └── test_main.py

util

The leanest archetype: a reusable utility for the scripts you (or your agents) end up running more than once, such as helpers, migrations, remediations, and backfills. It's built on the uv_build backend, with click as the only runtime dependency, and ships instructions for coding agents.

nuv new fix-thing --archetype util
fix-thing/
├── AGENTS.md                # working agreement for coding agents
├── CLAUDE.md                # @AGENTS.md, so Claude Code loads it even when nested in a repo
├── pyproject.toml           # uv_build, click, pytest + ruff + ty
├── README.md
├── src/fix_thing/
│   ├── __init__.py
│   ├── _logging.py
│   └── main.py              # run() holds the logic; click wrapper with --dry-run
└── tests/
    ├── __init__.py
    └── test_main.py

Default Python version: 3.14.

uv run fix-thing --help       # console script, no root main.py
uv run fix-thing --dry-run    # rehearse without side effects
uv run pytest                 # passing
uv run ruff check .           # clean
uv run ty check               # clean
uv build                      # wheel + sdist via uv_build

Compared with script:

  • Build backend: uv_build instead of hatchling, so the layout is src-only.
  • No coverage gate: tests ship and pass, but there's no --cov-fail-under.
  • run() / CLI split: the logic lives in run(), separate from the click wrapper, so the tool is as easy to import as it is to run.
  • Exit codes: run() returns the exit code, so a check can return non-zero for "drift found", and click.ClickException exits 1 cleanly.
  • Agent instructions: AGENTS.md carries the gates and conventions, including the dry-run and idempotency rules for tools that change things.

Use this when a script is going to outlive the conversation that wrote it. Pair it with the Claude Code plugin so agents reach for it on their own.

spark

A PySpark 4 project with src-layout, chispa testing, and dual notebooks (Jupyter + marimo).

nuv new my-spark-app --archetype spark
my-spark-app/
├── main.py
├── pyproject.toml
├── README.md
├── src/my_spark_app/
│   ├── __init__.py
│   ├── _logging.py
│   ├── config.py
│   ├── session.py
│   └── jobs/
│       ├── __init__.py
│       └── example.py
├── tests/
│   ├── __init__.py
│   ├── conftest.py
│   └── test_example.py
└── notebooks/
    ├── explore.ipynb
    └── explore_marimo.py

Default Python version: 3.13 (PySpark 4 compatibility).

uv run pytest          # 8 tests, passing
uv run ruff check .    # clean
uv run ty check        # clean

Notebooks are an optional dependency group:

uv sync --group notebooks
uv run jupyter lab notebooks/
uv run marimo run notebooks/explore_marimo.py

fastapi

A production-ready FastAPI project with Granian ASGI server, Pydantic settings, and a multi-stage Dockerfile.

nuv new my-api --archetype fastapi
my-api/
├── main.py                         # Granian server entry point
├── pyproject.toml
├── README.md
├── Dockerfile                      # multi-stage build
├── .dockerignore
├── src/my_api/
│   ├── __init__.py
│   ├── app.py                      # FastAPI factory with lifespan
│   ├── config.py                   # Pydantic settings from env vars
│   ├── _logging.py
│   ├── dependencies.py             # shared FastAPI deps
│   └── routes/
│       ├── __init__.py
│       └── health.py               # /healthz endpoint
└── tests/
    ├── __init__.py
    ├── conftest.py                  # async httpx client fixture
    └── test_health.py

Default Python version: 3.13 (Delta Lake wheel compatibility).

uv run pytest          # passing
uv run ruff check .    # clean
uv run ty check        # clean

Run locally:

uv run python main.py
uv run python main.py --host 0.0.0.0 --port 8000

Docker:

docker build -t my-api .
docker run -p 8000:8000 my-api

polars

A single-node data project with Polars, DuckDB, and Delta Lake. For local analysis, ETL, and feature engineering when Spark is overkill.

nuv new my-pipeline --archetype polars
my-pipeline/
├── main.py                          # Click CLI entry point
├── pyproject.toml
├── README.md
├── data/
│   ├── raw/                         # input datasets (gitignored)
│   └── features/                    # derived datasets (gitignored)
├── src/my_pipeline/
│   ├── __init__.py
│   ├── _logging.py
│   ├── _io.py                       # read/write CSV, Parquet, JSON, Delta + show/glimpse helpers
│   ├── _db.py                       # DuckDB SQL → Polars DataFrame
│   ├── config.py                    # Pydantic settings
│   └── main.py
├── tests/
│   ├── __init__.py
│   ├── conftest.py
│   └── test_io.py                   # roundtrip tests for every supported format
└── notebooks/
    └── explore.py                   # marimo

Default Python version: 3.14.

uv run pytest          # passing, ≥90% branch coverage enforced
uv run ruff check .    # clean
uv run ty check        # clean

Run locally:

uv run python main.py --help
uv run python main.py --log-level INFO

Notebooks are an optional dependency group:

uv sync --group notebooks
uv run marimo edit notebooks/explore.py

Use this when:

  • You want fast single-node dataframes without the JVM (Polars instead of PySpark).
  • You want to mix Polars expressions with SQL on the same data — _db.sql("...") returns a Polars DataFrame via DuckDB.
  • You're reading or writing Parquet, CSV, JSON, or Delta Lake tables.
  • You want a marimo notebook for exploration with the I/O helpers pre-wired.

Pick spark instead when the dataset doesn't fit on one machine, or you need a long-running cluster.

ds

A batteries-included data science project. Manifesto: all of what you need or want, but off by default.

nuv new my-ds-project --archetype ds

pyproject.toml ships a deliberately thin active core — numpy, pandas, Arrow, a Click CLI, and typed config — alongside a large, curated, commented-out catalog of the rest of the modern stack: classical ML (scikit-learn, scipy, statsmodels, XGBoost/LightGBM/CatBoost), deep learning & neural nets (PyTorch, TensorFlow, Keras, JAX/Flax/Optax), LLMs & NLP (transformers, datasets, accelerate, peft, vLLM, OpenAI/Anthropic clients, LangChain, LlamaIndex, spaCy), vector stores, viz, and experiment tracking (MLflow, Weights & Biases, DVC, Hydra, Ray). Uncomment a line, run uv sync, and uv resolves it against everything already locked.

my-ds-project/
├── main.py                          # Click CLI entry point
├── pyproject.toml                   # thin core + commented catalog
├── src/my_ds_project/
│   ├── __init__.py
│   ├── _logging.py
│   ├── config.py                    # Pydantic settings (paths, seed, ...)
│   ├── data.py                      # CSV/Parquet/JSON I/O + quick-look helpers
│   └── main.py
├── tests/
│   ├── __init__.py
│   ├── conftest.py
│   └── test_data.py
├── notebooks/
│   ├── explore.ipynb                # Jupyter / IPython
│   └── explore_marimo.py            # marimo
├── data/
│   ├── raw/                         # inputs (gitignored)
│   └── processed/                   # derived data (gitignored)
└── models/                          # trained artifacts (gitignored)

Default Python version: 3.13 (broadest compatibility across the DS/ML ecosystem).

uv run pytest          # passing, 100% coverage
uv run ruff check .    # clean
uv run ty check        # clean

Notebooks ship in two flavors and are an optional dependency group (Jupyter/IPython and marimo):

uv sync --group notebooks
uv run jupyter lab notebooks/                  # Jupyter / IPython
uv run marimo edit notebooks/explore_marimo.py # marimo

The generated .gitignore is comprehensive for AI/ML work: datasets, model weights and checkpoints (*.safetensors, *.ckpt, *.gguf, ...), experiment-tracking dirs (mlruns/, wandb/, lightning_logs/), notebook and library caches, and .env secrets.

Claude Code plugin

This repo is also a Claude Code plugin marketplace. The nuv plugin adds one skill, /nuv:util. Claude invokes it on its own when it's about to write Python outside an existing project. The skill routes the script to the smallest tier that gives it a pinned environment: an inline uv run --with for a one-off, a single file with a PEP 723 header run by uv run --script, or a util project from nuv new --archetype util when it needs tests or changes real systems. No loose .py file is left behind.

claude plugin marketplace add stevencarpenter/nuv
claude plugin install nuv@nuv

To pick up skill changes later, run claude plugin update nuv@nuv, or turn on auto-update for the nuv marketplace under /plugin → Marketplaces. To skip the plugin, copy plugins/nuv/skills/util/ to ~/.claude/skills/nuv-util/ instead.

The same skill works in Codex. Copy it (Codex skips symlinks), then restart Codex:

cp -r plugins/nuv/skills/util ~/.codex/skills/util

The skill tells Claude to:

  • Name the tool verb-first in kebab-case.
  • Put it where you said, or under tools/ when it operates on the current repo, or ask you where it belongs.
  • For a single file, write the PEP 723 header, add dependencies with uv add --script, and run it with uv run --script.
  • For a project, run nuv new (falling back to uvx nuv@latest), then follow the generated AGENTS.md.
  • Finish only when pytest, ruff, and ty are green.

Quality out of the box

Every generated project ships with these tools configured and green:

Tool Config
pytest branch coverage enforced (util: tests only, no coverage gate)
ruff lint + format
ty type checking

By default, nuv new logs the command you can run to install the generated project as a tool:

uv tool install --editable <project-path>

Why

uv init produces a stub. The gap between that and "actually writing code" is annoying when you create projects frequently. nuv closes it.

Publishing to PyPI

This project uses trusted publishing from GitHub Actions.

  1. Bump [project].version in pyproject.toml.
  2. Push a matching tag: vX.Y.Z.
  3. GitHub Actions builds and publishes to PyPI.

After release:

uv tool install nuv

Metadata

Release files for nuv 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nuv 0.6.0
File Size Uploaded Provenance Actions
nuv-0.6.0.tar.gz 93.5 kB With provenance Details for nuv-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nuv 0.6.0
File Interpreter ABI Platform Actions
nuv-0.6.0-py3-none-any.whl Python 3 none any Details for nuv-0.6.0-py3-none-any.whl

Total release size: 141.5 kB

Release files / nuv-0.6.0.tar.gz

Download URL nuv-0.6.0.tar.gz
Size 93.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2630b8ac667ad0a7b3a2367b1c9cbd8a846097ac411fa9107acaa6f1378593eb
BLAKE2b-256 checksum
How to use checksums
2d08c48fb7beb49bd4c8d07a58d21ea6ad3adcbf8e92f685a8a297b523bdca27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Release files / nuv-0.6.0-py3-none-any.whl

Download URL nuv-0.6.0-py3-none-any.whl
Size 47.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd618a4406fefe21f63b550a323ec2e59116bf6ea5ea0f847f911a7fbadc4f75
BLAKE2b-256 checksum
How to use checksums
ed827f999bcc761daf7bdc84c0688234d4df6352e911fb1609e3cd0e127f0c9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Security for nuv 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nuv-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page