Documentation

Python includes an extensive library of classes that can be included in any Python program. These classes are included as part of the Python Standard Library, which is included in most installations of the Python programming language.

Thankfully, the developers of the Python programming language have also written an extensive online manual that explains all of the features of the Python Standard Library in detail. Many developers refer to this manual as the Python API, or sometimes simply the documentation for the Python Standard Library.

To explore the Python Standard Library, we can start on this webpage. That link goes directly to the documentation for the latest version of Python 3, but it is very easy to find the manual for other versions of Python as well. There is a more technical version of the documentation found here that covers the specifics of the Python programming language itself..

On the home page of the Python Standard Library documentation, we’ll see several items. To the left is an index of where we are in the documentation, though there isn’t much to show on this home page. On the main page itself is a list of all of the packages included as part of the Python Standard Library. A package is a set of classes that are all related somehow, giving us a nice layer of organization to our code.

Here are some Python packages that we may want to explore as we continue to develop more advanced programs using Python:

  • string—methods for manipulating strings
  • datetime—types and methods for dealing with dates and times
  • collections—types and methods for storing data
  • math—functions for mathematics
  • random—pseudo-random number generators
  • pathlib—working with file system paths
  • os—interfaces for working with the operating system
  • io—tools for working with input and output streams

In this module, we’ll mostly explore a few of the collection classes that are built-in to the Python language itself, but are related to those found in the collections package.