Skip to main content

PCAP Format

Stream PCAP / PCAP-NG packet captures as timestamped raw frames.

Overview

PropertyValue
Format idpcap (alias pcapng)
ClassPCAPIterable
Extensions.pcap, .pcapng
ReadYes
WriteNo
Extrapcap (dpkt)
Maturitystable

Record shape

{"timestamp": 1700000000.123, "data": b"..."}

Packets are decoded incrementally (streaming). Auto-detects classic PCAP vs PCAP-NG.

Usage

from iterable import open_iterable

with open_iterable("capture.pcap") as source:
for pkt in source:
print(pkt["timestamp"], len(pkt["data"]))

Install with pip install iterabledata[pcap].

See also