import pwd


def get_uid_from_user(user):
    """Return UID from user name

    Looks up UID matching the supplied user name;
    returns None if no matching name can be found.

    NB returned UID will be an integer.

    """
    try:
        return pwd.getpwnam(str(user)).pw_uid
    except KeyError:
        return None