def requirements(fname):
    """
    Generator to parse requirements.txt file

    Supports bits of extended pip format (git urls)
    """
    with open(fname) as f:
        for line in f:
            match = re.search('#egg=(.*)$', line)
            if match:
                yield match.groups()[0]
            else:
                yield line.strip()
def requirements ( fname ) : with open ( fname ) as f : for line in f : match = re . search ( '#egg=(.*)$' , line ) if match : yield match . groups ( ) [ 0 ] else : yield line . strip ( )
Generator to parse requirements.txt file

    Supports bits of extended pip format (git urls)