import typing
import grp


def get_group_by_name(name: str) -> typing.Optional[typing.Mapping]:
    """
    Get group info by group's name from group database.
    """
    try:
        group = grp.getgrnam(name)
        return dict(gid=group.gr_gid, name=group.gr_name, members=group.gr_mem)

    except KeyError:
        pass

    return None