def sniff( self, filename ):
        try:
            header = open(filename).read(8)
            if binascii.b2a_hex(header) == binascii.hexlify('NCBI.sra'):
                return True
            else:
                return False
        except:
            return False
The first 8 bytes of any NCBI sra file is 'NCBI.sra', and the file is binary.
dataset/ETHPy150Open ARTbio/tools-artbio/tools/sra-tools/sra.py/Sra.sniff