pypcap
pypcap -- Python interface to pcap a packet capture library
What it is and what it does
Pypcap is a Python wrapper around libpcap, the standard packet-capture library used by tcpdump and other network tools. It provides an object-oriented interface to capture live network traffic from a specified interface, allowing you to iterate over packets and extract headers and payload data. The package works on both Linux and Windows, though the description notes WinPcap has compatibility issues with Windows 10.
The library is designed for network analysis, packet inspection, and traffic monitoring tasks where you need direct access to link-layer frames. It has no Python runtime dependencies but requires compilation of C extensions and system-level packet-capture libraries to be present before installation. The project is currently unmaintained and the authors are seeking a new maintainer.
Use it for:
- Build a network packet sniffer to monitor and log traffic on a specific interface for debugging or security analysis.
- Analyze network protocols by capturing raw packets and extracting source and destination addresses.
- Create a network traffic monitor component that needs to inspect live packets as they arrive.
- Develop packet-level network diagnostics tools that require direct access to link-layer frames.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python wrapper around libpcap that lets you capture and inspect network packets at the link layer, with support for both Linux and Windows systems.
No—install only if you have a specific, legacy requirement. The project is unmaintained and actively seeking a new maintainer; the last commit was 2023-03-29. High installation friction (system dependencies, C compilation), unclear licensing, and no Python version guarantees make this a poor choice for new projects.
Install
pypcap on PyPI
pip
pip install pypcapuv
uv add pypcappoetry
poetry add pypcapInstalling pypcap
Before you install
Installation requires system-level dependencies (libpcap-dev on Linux, Npcap SDK on Windows) and compiles C extensions, creating high friction. The project is explicitly unmaintained; the last commit was 2023-03-29 and maintainers are actively seeking someone to take over.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is provided in the package metadata, making it uncertain what restrictions or permissions apply to use or modification.
Quickstart
pip install pypcap
# Capture packets from network interface
sniffer = pcap.pcap(name=None, promisc=True, immediate=True, timeout_ms=50)
for ts, pkt in sniffer:
print(ts, pkt)
Requires libpcap-dev (Linux) or Npcap SDK (Windows) to be installed before pip install; compiles C extensions during installation.
Verify before relying
- Whether the 2023-03-29 commit represents a stable state or stalled development.
- What the actual license is, given the unclear treatment in metadata.
- Python version compatibility—requires_python is unspecified in the metadata.
- Whether WinPcap compatibility issues with Windows 10 affect current Windows deployments.
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,432 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 187,456/month — #9,964 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pypcap-1.3.0.tar.gz
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
pure-pcapy3Pure-Python implementation of the pcapy API for…
permissive · top 15,000 on PyPI
pysharkPyshark wraps tshark (Wireshark's command-line…
permissive · top 5,000 on PyPI
scapyScapy is a Python library for forging,…
copyleft · top 5,000 on PyPI
python-pcapngParses and writes pcap-ng packet capture files,…
permissive · top 15,000 on PyPI
pydivertPyDivert is a Python binding for the WinDivert…
copyleft · top 15,000 on PyPI
dpktdpkt parses and creates TCP/IP protocol packets…
permissive · top 5,000 on PyPI
pysoemPySOEM is a Cython wrapper for the Simple Open…
permissive · top 15,000 on PyPI
aiortspProvides asyncio-based RTSP client…
copyleft · top 15,000 on PyPI
rtpDecodes, encodes, and manipulates RTP…
permissive · top 15,000 on PyPI
authcaptureproxyIntercepts and logs authentication credentials…
permissive · top 15,000 on PyPI