# Our indexes

Every SWNDX index is a deliberate subset of PyPI or npm. Leaving things out is how it protects you, so expect some installs to fail: a package we don't list, or a version our rules leave out. We've tried to strike a reasonable balance between what you can install and what can reach your build. This page explains the choices behind each index and how much everyday installing it should cover.

## How we choose packages

- **Established, widely used packages.** We list the most-downloaded packages on PyPI and npm. Popular packages have many eyes on them; a name registered last week has none.
- **Changes to the list are reviewed.** A package that climbs into the list waits for our review, and one that drops out stays for 28 days. Neither a sudden spike nor a quiet month changes your build overnight.
- **New releases wait 7 days.** Most malicious releases are found and pulled within days. The wait means they're gone before your build could see them.
- **Known-malicious versions never appear.** We check OpenSSF's list of malicious packages every 6 hours, and a listed version is removed at the next build.
- **Unusual releases wait longer.** A release that breaks its project's usual pattern, or a published file whose contents change, is held for longer while we look at it.

## PyPI: `default`

`https://py.swndx.dev/public/default/simple/` — our strictest index, and the one we recommend.

- **Wheels only.** Installing a wheel unpacks files; it never runs the package's own code. A source distribution can run arbitrary code the moment it's installed, so we leave source distributions out.
- **Pre-releases only when there's nothing else.** Alphas, betas and release candidates are where projects try things out, so we leave them out. A few widely used projects, OpenTelemetry's instrumentation among them, publish nothing but pre-releases; for those we serve the single newest one.
- **The 10 newest versions, none older than 3 years.** Old versions keep their old bugs and vulnerabilities. If a project has nothing that recent, we keep its newest version. When a package we list needs an older version of a dependency, we keep that version too, wheels only and never older than 10 years.
- **Python 3.11 and later.** We serve files for the Python versions that still receive security fixes.
- **No yanked files.** A release its maintainers withdrew stays withdrawn.

**Should support more than 98% of installs** of the most-downloaded projects without a missing dependency. Projects that publish only source code, and packages that pin very old versions of their dependencies, are the usual reasons an install fails here.

## PyPI: `relaxed`

`https://py.swndx.dev/public/relaxed/simple/` — the `default` rules, with two exceptions for packages that need them.

- **Approved pre-releases.** A pre-release appears only for a project we've approved, typically because a popular package depends on it.
- **Source distributions only when there's no wheel.** For a version with no installable wheel we serve its source distribution. That restores packages `default` can't install, at a cost: those packages can run code during installation.

**Should support more than 99.5% of installs** of the most-downloaded projects without a missing dependency. Use it when `default` is too strict for your dependencies.

## npm: `default`

`https://node.swndx.dev/public/default/`

- **Integrity required.** A version appears only with a sha512 integrity value and a tarball on the npm registry, so your client verifies every file against what npm published.
- **Pre-releases only when a package we list depends on one,** because a few widely used packages, Babel's among them, still depend on a beta.
- **The 10 newest versions, none older than 3 years,** plus the version the publisher tagged `latest` when it passes the other rules.
- **Older versions that listed packages need.** npm packages depend on version ranges, often deep in the tree. We keep an older version when a package we serve requires it, and only then.

npm packages can run install scripts, and SWNDX never changes a package, so this index can't stop that. Consider npm's `ignore-scripts` setting for your projects.



## About these figures

They're estimates. For each package on our list, we check whether it and every dependency it needs can be installed from the index alone, and weight the result by its downloads over the past 30 days. A package's downloads include installs as someone else's dependency, so read the figures as a guide rather than a guarantee. They're re-measured weekly.

The figures cover the most-downloaded packages, which is where nearly all installing happens. On PyPI, the projects ranked 15,001 to 30,000 together add only about 0.3% to the downloads of the top 30,000.

## When something's missing

Your tools report the missing package or version; they don't fetch it from somewhere else. That's the point. [Send a package request](/feedback/) and we'll review it. On PyPI, try the `relaxed` index.
