'Try to guess the Obo filetype.
It usually starts with a "format-version:" string and has several stanzas which starts with "id:".'

def sniff(self, filename):

    stanza = re.compile('^\\[.*\\]$')
    with open(filename) as handle:
        first_line = handle.readline()
        if (not first_line.startswith('format-version:')):
            return False
        for line in handle:
            if stanza.match(line.strip()):
                if handle.next().startswith('id:'):
                    return True
    return False
