Library usage ############# Use the :py:class:`~pcapng.scanner.FileScanner` class to iterate over blocks in a pcap-ng archive file, like this: .. code-block:: python from pcapng import FileScanner with open('/tmp/mycapture.pcap') as fp: scanner = FileScanner(fp) for block in scanner: pass # do something with the block... Block types can be checked against blocks in :py:mod:`pcapng.blocks`.