def unpack(self, fmt, fileobj):
    s_fmt = '=' + ''.join(data_fmt for name, data_fmt in fmt)
    size = struct.calcsize(s_fmt)
    values = struct.unpack(s_fmt, fileobj.read(size))
    for (name, _data_fmt), value in zip(fmt, values):
        if name:
            if isinstance(value, str):
                value = from_c_string(value)
            setattr(self, name, value)
    return size
unpack binary data from the file object fileobj, formatted by fmt.
dataset/ETHPy150Open thesamet/webilder/src/webilder/webshots/fileutil.py/unpack