import itertools


def peek_first_item(gen):
    """
    Peek at first item from generator if available, else return None

    :param gen: generator
    :return: first item, generator

    """
    try:
        item = next(gen)
    except StopIteration:
        item = None

    gen = itertools.chain([item], gen)

    return item, gen