Scaffold opinionated uv Python projects
Project description
nuv
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 argparse, 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> --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 argparse and logging.
nuv new my-tool
my-tool/
├── main.py # argparse + logging
├── _logging.py
├── pyproject.toml # pytest, ruff, ty, uv
├── README.md
└── tests/
├── __init__.py
└── test_main.py
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.14.
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
Quality out of the box
Every generated project ships with these tools configured and green:
| Tool | Config |
|---|---|
| pytest | branch coverage enforced |
| 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.
- Bump
[project].versioninpyproject.toml. - Push a matching tag:
vX.Y.Z. - GitHub Actions builds and publishes to PyPI.
After release:
uv tool install nuv
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nuv-0.4.0.tar.gz.
File metadata
- Download URL: nuv-0.4.0.tar.gz
- Upload date:
- Size: 53.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e9dee95b00d5584ce4e903771a2b1f664429b7272b1b6131bb3e123bc97aaf5
|
|
| MD5 |
8b7c4f2cd215105a2283f12f80bb6b6f
|
|
| BLAKE2b-256 |
ad1a3449d2ea6a704567e888c6ae7bd65ffdcaac4732abb949387ee7bbe2aa20
|
Provenance
The following attestation bundles were made for nuv-0.4.0.tar.gz:
Publisher:
publish-pypi.yml on stevencarpenter/nuv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nuv-0.4.0.tar.gz -
Subject digest:
9e9dee95b00d5584ce4e903771a2b1f664429b7272b1b6131bb3e123bc97aaf5 - Sigstore transparency entry: 1417715150
- Sigstore integration time:
-
Permalink:
stevencarpenter/nuv@50249f57728e76e58aa7a75e2b533676aae190cf -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/stevencarpenter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@50249f57728e76e58aa7a75e2b533676aae190cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file nuv-0.4.0-py3-none-any.whl.
File metadata
- Download URL: nuv-0.4.0-py3-none-any.whl
- Upload date:
- Size: 30.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83b91376a272f5b9e423d408d7ebc5fb13c48310454e1638d92f610d44c582c2
|
|
| MD5 |
2f414e0eefb6bc1bf2875ab40bbebf26
|
|
| BLAKE2b-256 |
3dd1e6be68aeac810973a20b883f53a13a08d9f7c0ab60dfc22f943bd2ec90d0
|
Provenance
The following attestation bundles were made for nuv-0.4.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on stevencarpenter/nuv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nuv-0.4.0-py3-none-any.whl -
Subject digest:
83b91376a272f5b9e423d408d7ebc5fb13c48310454e1638d92f610d44c582c2 - Sigstore transparency entry: 1417715209
- Sigstore integration time:
-
Permalink:
stevencarpenter/nuv@50249f57728e76e58aa7a75e2b533676aae190cf -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/stevencarpenter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@50249f57728e76e58aa7a75e2b533676aae190cf -
Trigger Event:
push
-
Statement type: