Tools & Data
What Is PyPI?
The Python Package Index: the public repository that pip installs from, and the place you publish a package to.
Definition
The Python Package Index, known as PyPI, is the official public repository of software packages for Python. It is operated by the Python Software Foundation. When pip installs a dependency without being told otherwise, PyPI is where it fetches it from.
Consuming packages safely
- Pin versions in a lockfile so an install is reproducible across machines and time
- Check the project's repository and release history before adding a dependency
- Watch for typosquatting, where a package name differs from the intended one by a character
- Prefer packages that publish wheels, which avoids compiling at install time
Publishing to it
Publishing means building a distribution, a source archive and a wheel, and uploading it. Test PyPI exists as a separate instance for rehearsing a release without consuming a real version number, since a version once published cannot be reused.
The Python Package Index is a repository of software for the Python programming language.