blob: 5275acd82deb739e8981a2f4cdc01d304a8df12b [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Built-in Module \module{pwd}}
Guido van Rossume47da0a1997-07-17 16:34:52 +00002\label{module-pwd}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00003
4\bimodindex{pwd}
5This module provides access to the \UNIX{} password database.
6It is available on all \UNIX{} versions.
7
8Password database entries are reported as 7-tuples containing the
9following items from the password database (see \file{<pwd.h>}), in order:
10\code{pw_name},
11\code{pw_passwd},
12\code{pw_uid},
13\code{pw_gid},
14\code{pw_gecos},
15\code{pw_dir},
16\code{pw_shell}.
17The uid and gid items are integers, all others are strings.
Guido van Rossumeb0f0661997-12-30 20:38:16 +000018A \code{KeyError} exception is raised if the entry asked for cannot be found.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000019
20It defines the following items:
21
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000022\begin{funcdesc}{getpwuid}{uid}
23Return the password database entry for the given numeric user ID.
24\end{funcdesc}
25
26\begin{funcdesc}{getpwnam}{name}
27Return the password database entry for the given user name.
28\end{funcdesc}
29
30\begin{funcdesc}{getpwall}{}
31Return a list of all available password database entries, in arbitrary order.
32\end{funcdesc}