api

06 Built-in Exceptions

exceptions Python’s standard exception class hierarchy.

07 String Services

string A collection of string operations (most are no longer used).
re Support for regular expressions (RE).
struct Functions to convert between Python values and C structs represented as Python strings.
difflib Module difflib – helpers for computing deltas between objects.
StringIO File-like objects that read from or write to a string buffer.
cStringIO A simple fast partial StringIO replacement.
textwrap Text wrapping and filling.
codecs codecs – Python Codec Registry, API and helpers.
encodings Standard “encodings” Package
encodings.idna
encodings.utf_8_sig Python ‘utf-8-sig’ Codec
unicodedata This module provides access to the Unicode Character Database which defines character properties for all Unicode characters.
stringprep Library that exposes various tables found in the StringPrep RFC 3454.
fpformat General floating point formatting functions.

08 Data Types

datetime Fast implementation of the datetime type.
calendar Calendar printing functions
collections This module implements specialized container datatypes providing alternatives to Python’s general purpose built-in containers, dict, list, set, and tuple.
heapq Heap queue algorithm (a.k.a.
bisect Bisection algorithms.
array This module defines an object type which can efficiently represent an array of basic values: characters, integers, floating point numbers.
sets Classes to represent arbitrary sets (including sets of sets).
sched A generally useful event scheduler class.
mutex Mutual exclusion – for use with module sched
Queue A multi-producer, multi-consumer queue.
weakref Weak reference support for Python.
UserDict A more or less complete user-defined wrapper around dictionary objects.
UserList A more or less complete user-defined wrapper around list objects.
UserString A user-defined wrapper around string objects
types Define names for all type symbols known in the standard interpreter.
new Create new objects of various types.
copy Generic (shallow and deep) copying operations.
pprint Support to pretty-print lists, tuples, & dictionaries recursively.
repr Redo the builtin repr() (representation) but with limits on most sizes.

09 Numeric and Mathematical Methods

numbers Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
math This module is always available.
cmath This module is always available.
decimal This is a Py2.3 implementation of decimal floating point arithmetic based on
fractions Rational, infinite-precision, real numbers.
random Random variable generators.
itertools Functional tools for creating and using iterators.
functools functools.py - Tools for working with functions and callable objects
operator Operator interface.

10 File and Directory Access

os.path Common operations on Posix pathnames.
fileinput Helper class to quickly write a loop over all standard input files.
stat Constants/functions for interpreting results of os.stat() and os.lstat().
statvfs Constants for interpreting the results of os.statvfs() and os.fstatvfs().
filecmp Utilities for comparing files and directories.
tempfile Temporary files.
glob Filename globbing utility.
fnmatch Filename matching with shell patterns.
linecache Cache lines from files.
shutil Utility functions for copying and archiving files and directory trees.
dircache Read and cache directory listings.
macpath Pathname and path-related operations for the Macintosh.

11 Data Persistence

pickle Create portable serialized representations of Python objects.
cPickle C implementation and optimization of the Python pickle module.
copy_reg Helper to provide extensibility for pickle/cPickle.
shelve Manage shelves of pickled objects.
marshal This module contains functions that can read and write Python values in a binary format.
anydbm Generic interface to all dbm clones.
whichdb Guess which db package to use to open a db file.
dbm
gdbm
dbhash
bsddb
dumbdbm A dumb and slow but simple dbm clone.
sqlite3

12 Data Compression and Archiving

zlib The functions in this module allow compression and decompression using the zlib library, which is based on GNU zip.
gzip Functions that read and write gzipped files.
bz2 The python bz2 module provides a comprehensive interface for the bz2 compression library.
zipfile Read and write ZIP files.
tarfile Read from and write to tar format archives.

13 File Formats

csv CSV parsing and writing.
ConfigParser Configuration file parser.
robotparser robotparser.py
netrc An object-oriented interface to .netrc files.
xdrlib Implements (a subset of) Sun XDR – eXternal Data Representation.
plistlib plistlib.py – a tool to generate and parse MacOSX .plist files.

14 Cryptographic Services

hashlib hashlib module - A common interface to many hash functions.
hmac HMAC (Keyed-Hashing for Message Authentication) Python module.
md5
sha

15 Generic Operating System Services

os OS routines for NT or Posix depending on what system we’re on.
io The io module provides the Python interfaces to stream handling.
time This module provides various functions to manipulate time values.
argparse Command-line parsing library
optparse A powerful, extensible, and easy-to-use option parser.
getopt Parser for command line options.
logging Logging package for Python.
logging.config Configuration functions for the logging package for Python.
logging.handlers Additional handlers for the logging package for Python.
getpass Utilities to get a password and/or the current user name.
curses curses
curses.ascii Constants and membership tests for ASCII characters
curses.panel curses.panel
platform This module tries to retrieve as much platform-identifying data as possible.
errno This module makes available standard errno system symbols.
ctypes create and manipulate C data types in Python

16 Optional Operating System Services

select This module supports asynchronous I/O on multiple file descriptors.
threading Thread module emulating a subset of Java’s threading model.
thread This module provides primitive operations to write multi-threaded programs.
dummy_threading Faux threading version using dummy_thread instead of thread.
dummy_thread Drop-in replacement for the thread module.
multiprocessing
mmap
readline Importing this module enables command line editing using GNU readline.
rlcompleter Word completion for GNU readline.

17 Interprocess Communication and Networking

subprocess subprocess - Subprocesses with accessible I/O streams
socket This module provides socket operations and some related functions.
ssl This module provides some more Pythonic support for SSL.
signal This module provides mechanisms to use signal handlers in Python.
popen2 Spawn a command with pipes to its stdin, stdout, and optionally stderr.
asyncore Basic infrastructure for asynchronous socket service clients and servers.
asynchat A class supporting chat-style (command/response) protocols.

18 Internet Data Handling

email A package for parsing, handling, and generating email messages.
json JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format.
mailcap Mailcap file handling.
mailbox Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.
mhlib MH interface – purely object-oriented (well, almost)
mimetools Various tools used by MIME-reading or MIME-writing programs.
mimetypes Guess the MIME type of a file.
MimeWriter Generic MIME writer.
mimify Mimification and unmimification of mail messages.
multifile A readline()-style interface to the parts of a multipart message.
rfc822 RFC 2822 message manipulation.
base64 RFC 3548: Base16, Base32, Base64 Data Encodings
binhex Macintosh binhex compression/decompression.
binascii Conversion between binary data and ASCII
quopri Conversions to/from quoted-printable transport encoding as per RFC 1521.
uu Implementation of the UUencode and UUdecode functions.

19 Structured Markup Processing Tools

HTMLParser A parser for HTML and XHTML.
sgmllib A parser for SGML, using the derived class as a static DTD.
htmllib HTML 2.0 parser.
xml Core XML support for Python.
xml.etree.ElementTree
xml.dom W3C Document Object Model implementation for Python.
xml.dom.minidom Simple implementation of the Level 1 DOM.
xml.dom.pulldom
xml.sax Simple API for XML (SAX) implementation for Python.
xml.sax.handler This module contains the core classes of version 2.0 of SAX for Python.
xml.sax.saxutils A library of useful helper classes to the SAX classes, for the convenience of application and driver writers.
xml.sax.xmlreader An XML Reader is the SAX 2 name for an XML parser.
pyexpat Python wrapper for Expat parser.

20 Internet Protocols and Support

webbrowser Interfaces for launching and remotely controlling Web browsers.
cgi Support module for CGI (Common Gateway Interface) scripts.
cgitb More comprehensive traceback formatting for Python scripts.
wsgiref wsgiref – a WSGI (PEP 333) Reference Library
urllib Open an arbitrary URL.
urllib2 An extensible library for opening URLs using a variety of protocols
httplib HTTP/1.1 client library
ftplib An FTP client class and some helper functions.
poplib A POP3 client class.
imaplib IMAP4 client.
nntplib An NNTP client class based on RFC 977: Network News Transfer Protocol.
smtplib SMTP/ESMTP client class.
smtpd An RFC 2821 smtp proxy.
telnetlib TELNET client class.
uuid UUID objects (universally unique identifiers) according to RFC 4122.
urlparse Parse (absolute and relative) URLs.
SocketServer Generic socket server classes.
BaseHTTPServer HTTP server base class.
SimpleHTTPServer Simple HTTP Server.
CGIHTTPServer CGI-savvy HTTP Server.
cookielib HTTP cookie handling for web clients.
Cookie Here’s a sample session to show how to use this module.
xmlrpclib An XML-RPC client interface for Python.
SimpleXMLRPCServer Simple XML-RPC Server.
DocXMLRPCServer Self documenting XML-RPC Server.

21 Multimedia Services

audioop
imageop
aifc Stuff to parse AIFF-C and AIFF files.
sunau Stuff to parse Sun and NeXT audio files.
wave Stuff to parse WAVE files.
chunk Simple class to read IFF chunks.
colorsys Conversion functions between RGB and other color systems.
imghdr Recognize image file formats based on their first few bytes.
sndhdr Routines to help recognizing sound files.
ossaudiodev

22 Internationalization

gettext Internationalization and localization support.
locale Locale support module.

23 Program Frameworks

cmd A generic class to build line-oriented command interpreters.
shlex A lexical analyzer class for simple shell-like syntaxes.

24 Graphical User Interfaces with Tk

Tkinter Wrapper functions for Tcl/Tk.
ttk Ttk wrapper.
Tix
ScrolledText A ScrolledText widget feels like a text widget but also has a vertical scroll bar on its right.
turtle Turtle graphics is a popular way for introducing programming to kids.
IDLE

25 Development Tools

pydoc Generate Python documentation in HTML or text for interactive use.
doctest Module doctest – a framework for running examples in docstrings.
unittest Python unit testing framework, based on Erich Gamma’s JUnit and Kent Beck’s Smalltalk testing framework.
test

26 Debugging and Profiling

bdb Debugger basics
pdb A Python debugger.
profile Class for profiling Python code.
cProfile Python interface for the ‘lsprof’ profiler.
hotshot High-perfomance logging profiler, mostly written in C.
timeit Tool for measuring execution time of small code snippets.
trace program/module to trace Python program or function execution

27 Software Packaging and Distribution

distutils distutils

28 Python Runtime Services

sys This module provides access to some objects used or maintained by the interpreter and to functions that interact strongly with the interpreter.
sysconfig Provide access to Python’s configuration information.
__builtin__ Built-in functions, exceptions, and other objects.
future_builtins This module provides functions that will be builtins in Python 3.0, but that conflict with builtins that already exist in Python 2.x.
__main__
warnings Python part of the warnings subsystem.
contextlib Utilities for with-statement contexts.
abc Abstract Base Classes (ABCs) according to PEP 3119.
atexit atexit.py - allow programmer to define multiple exit functions to be executed
traceback Extract, format and print information about Python stack traces.
__future__ Record of phased-in incompatible language changes.
gc This module provides access to the garbage collector for reference cycles.
inspect Get useful information from live Python objects.
site Append module search paths for third-party packages to sys.path.
user Hook to allow user-specified customization code to run.
fpectl

29 Custom Python Interpreters

code Utilities needed to emulate Python’s interactive interpreter.
codeop Utilities to compile possibly incomplete Python source code.

30 Restricted Execution

rexec Restricted execution facilities.
Bastion Bastionification utility.

31 Importing Modules

imp This module provides the components needed to build your own __import__ function.
importlib Backport of importlib.import_module from 3.x.
imputil Import utilities
zipimport zipimport provides support for importing Python modules from Zip archives.
pkgutil Utilities to support packages.
modulefinder Find modules used by a script, using introspection.
runpy runpy.py - locating and running Python code using the module namespace

32 Python Language Services

parser This is an interface to Python’s internal parser.
ast ast
symtable Interface to the compiler’s internal symbol tables
symbol Non-terminal symbols of Python grammar (from “graminit.h”).
token Token constants (from “token.h”).
keyword Keywords (from “graminit.c”)
tokenize Tokenization help for Python programs.
tabnanny The Tab Nanny despises ambiguous indentation.
pyclbr Parse a Python module and describe its classes and methods.
py_compile Routine to “compile” a .py file to a .pyc (or .pyo) file.
compileall Module/script to byte-compile all .py files to .pyc (or .pyo) files.
dis Disassembler of Python byte code into mnemonics.
pickletools “Executable documentation” for the pickle module.

33 (depr) Python compiler package

compiler Package for parsing and compiling Python source code

34 Miscellaneous Services

formatter Generic output formatting.

35 MS Windows Specific Services

msilib
msvcrt
_winreg
winsound

36. Unix Specific Services

posix This module provides access to operating system functionality that is standardized by the C Standard and the POSIX standard (a thinly disguised Unix interface).
pwd This module provides access to the Unix password database.
spwd This module provides access to the Unix shadow password database.
grp Access to the Unix group database.
crypt
dl
termios This module provides an interface to the Posix calls for tty I/O control.
tty Terminal utilities.
pty Pseudo terminal utilities.
fcntl This module performs file control and I/O control on file descriptors.
pipes Conversion pipeline templates.
posixfile Extended file operations available in POSIX.
resource
nis This module contains functions for accessing NIS maps.
syslog
commands Execute shell commands via os.popen() and return status, output.

37 Mac OS X specific services

ic
MacOS
macostools
EasyDialogs
FrameWork
autoGIL
Carbon
ColorPicker