grp

Access to the Unix group database.

Group entries are reported as 4-tuples containing the following fields from the group database, in order:

gr_name - name of the group gr_passwd - group password (encrypted); often empty gr_gid - numeric ID of the group gr_mem - list of members

The gid is an integer, name and password are strings. (Note that most users are not explicitly listed as members of the groups they are in according to the password database. Check both databases to get complete membership information.)

Functions

getgrall(() -> list of tuples) Return a list of all available group entries, in arbitrary order.
getgrgid(id) -> (gr_name,gr_passwd,gr_gid,gr_mem) Return the group database entry for the given numeric group ID.
getgrnam(...) Return the group database entry for the given group name.

Classes

struct_group grp.struct_group: Results from getgr*() routines.