.. Chunker documentation master file, created by sphinx-quickstart on Sun Nov 3 00:14:38 2013. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Chunker - Easy Chunk-Based File Structure Parsing ================================================= Chunker provides simple APIs to help parsing chunk-based file structure such as Zip/PNG/JPEG/WAV, etc. You simply define the structure and Chunker handles the rest. .. toctree:: :maxdepth: 2 parsers chunks fields utils An example printing out file names in a `zip `_ file:: class InsideFileChunk(Chunk): Fields = ( UnsignedLongField('signature'), UnsignedShortField('min_ver'), UnsignedShortField('general_purpose'), UnsignedShortField('compress_method'), UnsignedShortField('last_modified_time'), UnsignedShortField('last_modified_date'), UnsignedLongField('crc32'), UnsignedLongField('compressed_size'), UnsignedLongField('uncompressed_size'), UnsignedShortField('filename_length'), UnsignedShortField('extra_field_length'), StringField('filename', 'filename_length'), SkipBasedOnLengthField('extra_field', 'extra_field_length'), SkipBasedOnLengthField('data', 'compressed_size'), # No need to read file content ) @classmethod def safe_matches(cls, fp): # Each file chunk starts with 0x04034b50 buf = fp.read(4) sig = struct.unpack('