pure-pcapy3, currently at version 1.0.1, is a pure Python reimplementation of the `pcapy` library, designed to be API compatible and a drop-in replacement. It allows Python programs to capture live network traffic and read/write pcap files without requiring C extensions. While aiming for full compatibility, its release cadence is infrequent, focusing on stability.
pip install pure-pcapy3Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `pure-pcapy3` for live packet capture on a specified network interface. It includes a basic packet handler and a fallback mechanism to illustrate opening a pcap file. Remember to replace `'eth0'` with an actual network interface on your system (e.g., `'wlan0'`, `'en0'`) and ensure your user has permissions to capture packets (e.g., by running with `sudo` or being in the appropriate user group).
Always use `import pcapy` after installing `pure-pcapy3`. Do not attempt `import pure_pcapy3` or `from pure_pcapy3 import pcapy`.
Ensure `libpcap` development headers are installed on Linux/macOS (e.g., `apt-get install libpcap-dev`) or `Npcap` (with 'WinPcap API-compatible mode') on Windows. You may also need appropriate user permissions (e.g., run as root/administrator or add user to `wireshark`/`pcap` group) to capture traffic.
Benchmark your application with `pure-pcapy3` under expected load. If performance bottlenecks are identified, evaluate whether the pure Python requirement is strict or if a faster, potentially C-dependent, alternative can be used.
No dependency data recorded yet.