spwd - pydoc - phpman

Look up a command

 

Markdown Format | JSON API | MCP Server Tool


spwd
NAME DESCRIPTION CLASSES FUNCTIONS FILE
Help on built-in module spwd:

NAME
    spwd

DESCRIPTION
    This module provides access to the Unix shadow password database.
    It is available on various Unix versions.

    Shadow password database entries are reported as 9-tuples of type struct_spwd,
    containing the following items from the password database (see `<shadow.h>'):
    sp_namp, sp_pwdp, sp_lstchg, sp_min, sp_max, sp_warn, sp_inact, sp_expire, sp_flag.
    The sp_namp and sp_pwdp are strings, the rest are integers.
    An exception is raised if the entry asked for cannot be found.
    You have to be root to be able to use this module.

CLASSES
    builtins.tuple(builtins.object)
        struct_spwd

    class struct_spwd(builtins.tuple)
     |  struct_spwd(iterable=(), /)
     |
     |  spwd.struct_spwd: Results from getsp*() routines.
     |
     |  This object may be accessed either as a 9-tuple of
     |    (sp_namp,sp_pwdp,sp_lstchg,sp_min,sp_max,sp_warn,sp_inact,sp_expire,sp_flag)
     |  or via the object attributes as named in the above tuple.
     |
     |  Method resolution order:
     |      struct_spwd
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs) from builtins.type
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  sp_expire
     |      #days since 1970-01-01 when account expires
     |
     |  sp_flag
     |      reserved
     |
     |  sp_inact
     |      #days after pw expires until account is disabled
     |
     |  sp_lstchg
     |      date of last change
     |
     |  sp_max
     |      max #days between changes
     |
     |  sp_min
     |      min #days between changes
     |
     |  sp_nam
     |      login name; deprecated
     |
     |  sp_namp
     |      login name
     |
     |  sp_pwd
     |      encrypted password; deprecated
     |
     |  sp_pwdp
     |      encrypted password
     |
     |  sp_warn
     |      #days before pw expires to warn user about it
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('sp_namp', 'sp_pwdp', 'sp_lstchg', 'sp_min', 'sp_max...
     |
     |  n_fields = 11
     |
     |  n_sequence_fields = 9
     |
     |  n_unnamed_fields = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return key in self.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...) from builtins.type
     |      See PEP 585

FUNCTIONS
    getspall()
        Return a list of all available shadow password database entries, in arbitrary order.

        See `help(spwd)` for more on shadow password database entries.

    getspnam(arg, /)
        Return the shadow password database entry for the given user name.

        See `help(spwd)` for more on shadow password database entries.

FILE
    (built-in)



Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 05:15 @216.73.216.198 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 TransitionalValid CSS!

^_back to top