import spwd


def make_shadow_dict(username):
    """Create a dictionary of user shadow password database attributes."""
    try:
        shadow_record = spwd.getspnam(username)
    except KeyError:
        return False

    shadow_dict = {
        'last_changed': shadow_record.sp_lstchg,
        'min_days': shadow_record.sp_min,
        'max_days': shadow_record.sp_max,
        'warn_days': shadow_record.sp_warn,
        'inact_days': shadow_record.sp_inact,
        'expire_days': shadow_record.sp_expire,
    }
    return shadow_dict