Skip to main content

nab

nab generates universal lockfiles for Python projects. Declare your target Python versions and platforms in pyproject.toml, then write one PEP 751 pylock.toml covering them. An installer such as pip installs the dependencies selected for its environment from that file.

nab is written in Python and is experimental. It resolves dependencies and can download artifacts; it does not install packages or manage virtual environments.

Documentation · What nab locks · First universal lock

Install

pipx install nab
nab --version

Or install with uv:

uv tool install nab

nab runs on CPython 3.10 and newer. See installation options.

Example project

Save this as pyproject.toml in a new directory:

[project]
name = "example"
version = "0.1.0"
requires-python = ">=3.12,<3.16"
dependencies = ["requests>=2,<3"]

[tool.nab.matrix]
python = ">=3.12,<3.16"
platforms = ["linux_x86_64", "macos_arm64"]

Generate the lock:

nab lock pyproject.toml

Or use uvx nab lock pyproject.toml without installing nab first. This writes one lock for Python 3.12, 3.13, 3.14 and 3.15 on Linux x86-64 and Apple Silicon macOS.

Install from it in a covered virtual environment with pip 26.1 or newer:

python -m pip install -r pylock.toml

In nab, you choose which Python versions, platforms and interpreter implementations to resolve universally, because explicit is better than implicit. See the tutorial for a walkthrough and target configuration for other targets.

Safer defaults

pip and uv can run a downloaded package's build backend just to discover its dependencies. nab makes remote builds opt-in, reducing code execution during locking.

  • Universal locking disables metadata builds by default. To build on the host for a declared target, enable assume-universal-deps and allow the build. Host-specific locking allows local builds by default. You can limit remote build permission to one package or index. See build policy.
  • Git and Mercurial declarations permit the source they name. See VCS sources.
  • Direct archive sources require a hash, verified before reading metadata. See archive sources.

These controls apply during locking; your installer may still build a locked source distribution.

Soundness

By default, Nab checks dependencies and artifact compatibility for every environment you declare.

More features

Use requirements and markers to select dependencies by environment, and extras or groups for optional sets. Nab also supports scoped policies and metadata overrides, multiple indexes, workspaces, pinned VCS sources and hashed archives. Browse the guides for these workflows.

Policy overrides

Nab uses dependency requirements to select which releases a policy overrides.

Allow a reviewed update during a cooldown

Keep a seven-day cooldown, with an exception for reviewed files of certifi 2026.10.19:

[tool.nab]
uploaded-prior-to = "P7D"

[tool.nab.packages."certifi==2026.10.19"]
uploaded-prior-to = "2026-10-20T02:24:17Z"

The fixed cutoff excludes later uploads of the same version. Other versions keep the global cooldown.

Use an index without upload times

Disable the cutoff only for an internal index that does not publish upload times:

[tool.nab]
uploaded-prior-to = "P7D"

[[tool.nab.indexes]]
name = "pypi"
url = "https://pypi.org/simple/"

[[tool.nab.indexes]]
name = "internal"
url = "https://packages.example.com/simple/"

[tool.nab.index.internal]
uploaded-prior-to = false

See package and index policies.

Performance

Nab checks each target's wheel metadata and honors Python upper bounds by default. These checks can catch incompatible dependencies that uv's optimizations may miss.

By default, nab checks for package changes each time you lock. It uses stable decision order, so the versions it picks don't depend on which index request finishes first.

Configure these options in nab.toml beside pyproject.toml:

Option Behavior and tradeoff
lock-policy = "resolve" (default) Resolve from scratch using current package information.
lock-policy = "prefer-existing" Check the index and keep locked versions that still meet the requirements.
lock-policy = "reuse" If the lockfile still matches the project, keep it without checking the index.
decision-order = "arrival" Reduce HTTP waits by processing listings as they arrive; pin choices may vary.
assume-consistent-metadata = true Reuse wheel metadata across targets, assuming a release's wheels agree.

reuse is close to uv's default behavior for an unchanged project: keep the existing lock without looking for package updates.

See distribution policies and lock policies for configuration and restrictions.

Universal lock benchmark

Cold and warm cache timings compare Nab's default and performance settings with uv, Poetry and PDM.

Creating a fresh lock for NumPy, pandas, SciPy, Matplotlib and scikit-learn:

Fresh scientific lock, cold and warm caches: Nab default, Nab performance, uv, Poetry and PDM. Shorter is faster.

Relocking NumPy, pandas, SciPy, Matplotlib and scikit-learn with unchanged inputs. Saved-lock reuse can be a no-op:

Unchanged scientific project with an existing lock, cold and warm caches: Nab default, Nab performance, uv, Poetry and PDM. Shorter is faster.

Nab performance uses these settings in nab.toml:

http-backend = "httpx2"
decision-order = "arrival"
dist-policy = "wheel-only"
metadata-policy = "prefer-wheel"
assume-consistent-metadata = true
max-concurrency = 50

Existing-lock runs also set lock-policy = "reuse". wheel-only considers prebuilt wheels and excludes source distributions. The concurrency limit lets the client overlap more waiting HTTP requests. Higher concurrency can use more connections and memory. These settings can be slower when dependencies change.

Libraries

Nab also publishes components for other tools.

  • nab-resolver: a generic PubGrub dependency resolver.
  • nab-markersets: PEP 508 marker algebra.
  • nab-provider: Python packaging policy and resolution logic without I/O.
  • nab-index: package-index and source clients with caching.
  • nab-project: resolve orchestration, lockfiles and downloads.

Component APIs can change between 0.0.x releases. See how the packages fit together and the CLI walkthrough to explore the code.

Metadata

Release files for nab 0.0.32

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

Source distribution (sdist)

Source distribution for nab 0.0.32
File Size Uploaded Provenance Actions
nab-0.0.32.tar.gz 427.6 kB With provenance Details for nab-0.0.32.tar.gz

Built distribution (wheel)

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

Total release size: 600.9 kB

Release files / nab-0.0.32.tar.gz

Download URL nab-0.0.32.tar.gz
Size 427.6 kB
Tags Source
SHA-256 checksum
How to use checksums
85f1c6fce731ff60df8ff86db5df9433eefd673387db1414ec6a8d8679efda22
BLAKE2b-256 checksum
How to use checksums
9aaf8ca2139a24ff3d3d10fead0da4f08817deeb4242a9eff8b4fe87b830d73b
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 Dec 1, 2026.

Transparency log

Release files / nab-0.0.32-py3-none-any.whl

Download URL nab-0.0.32-py3-none-any.whl
Size 173.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b2d61520cdb4c0c3a3972bded8b213787f286e500f0a2a4e31039566bcc1978
BLAKE2b-256 checksum
How to use checksums
daa925b5747fb5699ddf3bd6856ba3502f699e44bc4064ea57d5aabe6bcfc72c
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 Dec 1, 2026.

Transparency log

Security for nab 0.0.32

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 nab-0.0.32.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 Dec 1, 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.

Release history Release notifications | RSS feed

This release

0.0.32 This release

2 release files Full provenance

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