programming

Kept in this browser · My desk

Stands for: Python Package Index

Python Package Index: the default package index for the Python community, at pypi.org, where any Python developer can publish distributions and from which pip installs.

The Packaging User Guide records that the pypi.org domain replaced the legacy pypi.python.org in 2017. pip installs from it unless pointed at another index. Because it is open to all developers and, in its own documentation's words, does not pre-screen or review projects before they are published, a project's name alone says nothing about who published a file or what the file does; pinning versions and hashes is how a deployment fixes exactly what it installs.

PyPI (Python Package Index), pronounced pie-pea-eye so that it is not confused with the PyPy interpreter, describes itself as a repository of software for the Python programming language and is the default source for pip, PDM, Poetry and uv. Its content has three levels: a project is a named collection of releases, a release is one version of the project, and a release consists of one or more files, each a source archive or a wheel built for some platform. As read on 12 November 2026 the front page counted 939,906 projects, 10,173,118 releases, 22,837,935 files and 1,141,478 users, and the statistics page put the sum of all release files at 51.2 TB (terabytes). What it is not is a curated catalogue. Its documentation says that anyone can upload projects of any quality, that PyPI does not pre-screen or review projects before they are published, and that anything on a project page not explicitly labelled as PyPI data or as verified should be assumed to be unverified text supplied by the author.

The index began as PEP (Python Enhancement Proposal) 301, written by Richard Jones, created on 24 October 2002 and implemented for Python 2.3. It proposed a central index server, a register command for Distutils and Trove classifiers in the metadata, and it deliberately left out two things that now define the service: package dependencies, and the storage and download of the packages themselves. Jones wanted the index hosted under python.org to give it an air of legitimacy that earlier catalogue efforts lacked, and for years its address was pypi.python.org. The present service runs on a rewritten codebase called Warehouse. A beta at pypi.org was announced on 26 March 2018, and on 16 April 2018 the new site became the canonical index, with browser traffic and pip install calls redirected from the old address and the legacy codebase due to be shut down on 30 April. The Packaging User Guide's glossary dates the replacement of the domain name itself to 2017.

Warehouse is open source, developed under the Python Packaging Authority (PyPA) and supported by the Packaging Working Group of the Python Software Foundation (PSF), which operates the infrastructure. The scale explains the architecture. In August 2026 the PSF's director of engineering wrote that PyPI takes more than six billion requests a day, about thirteen billion counting file downloads, with package egress of around 10 petabytes a day, and that Fastly's content delivery network (CDN) answers almost all of it at a cache hit ratio just under 99 per cent, so that only about one request in seventy reaches the origin, which runs on Amazon Web Services (AWS) with a PostgreSQL database behind the application. For 2025 PyPI reported 2.56 trillion requests, an average of 81,000 a second, 1.92 exabytes transferred, more than 3.9 million new files and more than 130,000 new projects. The August post also counted the people: one and a half full-time employees for development, security reports and maintenance, and one for support requests. Two consequences matter to whoever writes the firewall or proxy rule: files are downloaded from files.pythonhosted.org, not from pypi.org, and because all traffic is routed through the CDN, the list of PyPI's addresses is Fastly's published list of public ranges.

Installers do not use the website. They use the index API (application programming interface) under https://pypi.org/simple/, standardized as the Simple Repository API. Its first form, PEP 503 by Donald Stufft (September 2015), is a tree of HTML (Hypertext Markup Language) pages: the root has one anchor per project, each project page has one anchor per file, and each link should carry the file's hash as a URL (Uniform Resource Locator) fragment, the name of the hash function such as sha256 followed by the digest. A JSON (JavaScript Object Notation) form followed in May 2022 with PEP 691, selected through the Accept header with the media type application/vnd.pypi.simple.v1+json, and later PEPs added upload times (700), yanking (592), provenance (740) and project status markers (792). In August 2026 PyPI adopted PEP 833, which freezes the HTML representation; new features go into the JSON form only. Project names are compared in normalized form, lower-cased with every run of full stops, hyphens and underscores replaced by a single hyphen, so a project named HolyGrail is served at /simple/holygrail/. pip's default --index-url is https://pypi.org/simple, and its documentation is explicit about what happens when --extra-index-url adds a second index: there is no priority among the locations, all are checked and the best match by version wins.

A release or a project can change state without disappearing. Pre-releases are skipped by installers unless requested. A yanked release is ignored by an installer unless it is the only one matching an exact pin written with == or ===, and PyPI yanks whole releases, not single files; the maintainer's reason is published through the index API. An archived project accepts no new releases but still installs. A quarantined project or release, suspected of malware, spam or a policy violation, cannot be installed or modified and is left out of search and of the index API until an administrator reviews it. The limits are few, and the recent ones are worth knowing: by default 100 MB per file and 10 GB per project, doubled since 26 October 2026 for projects owned by an organization; version strings of at most 128 characters since October 2026; and, since 22 July 2026, no new files in a release more than 14 days old, so that a stolen token cannot add a poisoned file to a long-stable release (PyPI asks users not to rely on that behaviour until PEP 694 defines it).

On the publishing side the index has been replacing secrets that last with ones that expire. Two-factor authentication (2FA) has been mandatory for every account since 1 January 2024, with a time-based one-time password (TOTP) application or a WebAuthn security device, which PyPI prefers because it resists phishing. Uploads need an API token, which can be scoped to one project, or Trusted Publishing, introduced on 20 April 2023: an automated build job presents an OpenID Connect (OIDC) identity token from its platform and, if the project trusts that workflow, receives an upload token valid for 15 minutes. GitHub Actions, GitLab CI/CD (continuous integration and delivery), Google Cloud and ActiveState are supported. Since 14 November 2024 a file can also carry attestations under PEP 740, signed statements in the in-toto format that bind the file's digest to the identity that published it; PyPI accepts two kinds, its own publish attestation and SLSA (Supply-chain Levels for Software Artifacts) provenance. They took the place of PGP (Pretty Good Privacy) signatures, which PyPI stopped accepting on 23 May 2023 after an audit found that only 36 per cent of the keys used in three years could be meaningfully verified. By the end of 2025 more than 50,000 projects used Trusted Publishing and 17 per cent of uploads included an attestation.

The documentation lists what an open index attracts. Typosquatting registers a misspelling of a popular name, such as pyth0n-dateutil for python-dateutil. PyPI rejects a new name that collides with an existing one after removing separators and treating look-alike characters such as l, i and 1 as identical, or that matches a standard-library module, and admits that these checks do not catch everything; in March 2024 a large typosquatting campaign made it halt new user and project registration for a time. Names invented by a large language model (LLM) can be registered in advance by an attacker, which the documentation calls slopsquatting. Dependency confusion publishes on PyPI a package with the name of a company's private one and relies on the installer choosing it. Account takeover, phishing (one campaign used the look-alike domain pypj.org) and the re-registration of expired email domains aim at maintainers instead. The case that changed policy was a supply-chain compromise: PyPI's incident report of 2 April 2026 describes releases of litellm and telnyx, published after an API token was exposed through an exploited Trivy dependency, that carried credential-harvesting malware which ran on install. The poisoned litellm versions were downloaded more than 119,000 times in the 2 hours 32 minutes between upload and quarantine, and PyPI estimated that 40 to 50 per cent of litellm installs were unpinned, fetching the latest version every time.

The defences on the consuming side follow from that. PyPI publishes SHA-256 (Secure Hash Algorithm 256-bit) and BLAKE2b digests for every file and states their limit: a checksum shows that the file is the one on PyPI's servers, not that the code is safe. pip's hash-checking mode, --require-hashes, refuses anything whose digest is not in the requirements file. A lock file with hashes fixes the whole dependency tree, which the output of pip freeze does not. A dependency cooldown, pip's --uploaded-prior-to, skips releases younger than a few days so that reports and quarantine have time to work; PyPI handled 66 per cent of the malware reports of 2025 within 4 hours and 92 per cent within 24. pip's documentation calls --extra-index-url unsafe for private packages, because the public index may win. And for rehearsing a release there is TestPyPI at test.pypi.org, a separate instance with its own accounts and a database that is pruned from time to time.

Also known as: Python Package Index, pypi.org

Sources

← Back to P Back to the glossary