kripodb.makebits¶
Module to read/write fingerprints in Makebits file format
-
kripodb.makebits.
iter_file
(infile)[source]¶ Reads Makebits formatted file Yields header first then tuples of identifier and BitMap object
Yields: first header (format name, format version, number of bits, description), then tuples of the fingerprint identifier and an BitMap object Parameters: infile (File) – File object of Makebits formatted file to read Examples
Read a file
>>> f = iter_file(open('fingerprints01.fp')) >>> read_fp_size(next(f)) 4 >>> {frag_id: fp for frag_id, fp in f} {'id1': BitMap([1, 2, 3, 4])}