liveBook · Manning

Python Package Index

As explained in Python Workout: 50 ten-minute exercises

PyPI is the Python Package Index, a repository and distribution service for Python packages.

When the standard library is not enough, Python programmers can find community-contributed third-party packages on the Python Package Index (PyPI). PyPI acts as both a package repository and a distribution service, while pip provides a command-line way to install packages. section 8.0

Installing a package

A typical installation command is `pip install packagename`. After installation, the package can be imported into a Python program alongside modules from the standard library. section 8.0

PyPI’s size creates a practical selection problem: many packages may be buggy or unmaintained. Edited lists such as Awesome Python can provide a first filter before choosing a package. section 8.0

Table 8.1 What you need to know (view table figure)

Concept

What is it?

Example

To learn more

import

Statement for importing modules

import os

http://mng.bz/xWme

from X import Y

Imports module X, but only defines Y as a global variable

from os import sep

http://mng.bz/xWme

importlib.reload

Re-imports an already loaded module, typically to update definitions during development

importlib.reload(mymod)

http://mng.bz/Z2PO

pip

Command-line program for installing packages from PyPI

pip install packagename

https://pypi.org/

Decimal

Class that accurately handles floating-point numbers

from decimal import Decimal

http://mng.bz/RAX0

Use the reference table to connect PyPI with pip installation and the import statements used after packages are available. section 8.0

How Python Workout: 50 ten-minute exercises covers it

How deep it goes
Defines PyPI and shows pip installation, but stops short of package publishing or dependency-management details.
Examples
Uses pypi.org, `pip install packagename`, and Awesome Python as concrete package-discovery and installation examples.
What it assumes
Assumes Python programming and introduces modules, packages, imports, and the standard library as surrounding concepts.
What you can do after
Operate/configure Python package installation through pip and assess package choices using curated lists.
How it connects
Ties PyPI to modules, packages, imports, the standard library, pip, and package-quality evaluation.

Also explained in

Compare how 2 books explain Python Package Index →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Python Workout: 50 ten-minute exercises. The section links point to the parts of the book it draws on.