Skip to main content

PyPCAPKit -- Comprehensive Network Packet Analysis Library

For technical and maintenance information, see the Official Documentation.

PyPCAPKit is an open-source Python library for parsing, constructing and analysing network packets and PCAP files, with DictDumper as its output dumper.

Compared with Scapy, DPKT and PyShark, pcapkit reports more detail about each packet through a more Pythonic interface. Where that depth is not needed, the same interface drives those tools as third-party extraction engines.

Requires Python 3.8 or later. CI supports 3.11 to 3.15, and tests the end-of-life 3.8 to 3.10 without letting a failure block anything.

Installation

pip install pypcapkit

Or from a clone, for unreleased changes and development:

git clone https://github.com/JarryShaw/PyPCAPKit.git
cd PyPCAPKit
pip install -e .

The extraction engines and plug-ins are optional extras:

pip install pypcapkit[DPKT]         # or Scapy, PyShark, PyPCAPFile, PyPCAP, PCAP_CT
pip install pypcapkit[crypto]       # ESP payload decryption
pip install pypcapkit[cli]          # command line interface
pip install pypcapkit[all]          # core addons only: cli + crypto + NGAP (pycrate)

Some engines need more than pip install -- a tshark binary, a C compiler, libpcap headers, or an older interpreter -- and pypcap and pcap-ct must not be installed together. The engine prerequisites give each constraint and its reason. Asking for an engine that cannot run here warns with the cause and falls back to pcapkit's own parser.

Usage

>>> import pcapkit
>>> extraction = pcapkit.extract('in.pcap', nofile=True)
>>> len(extraction.frame)
6
>>> frame = extraction.frame[0]
>>> str(frame.protochain)
'Ethernet:IPv6:ICMPv6'
>>> frame.info.time
datetime.datetime(2017, 11, 19, 15, 49, 5, 471719, tzinfo=datetime.timezone.utc)
>>> frame.payload.payload.src
IPv6Address('fe80::a6:87f9:2793:16ee')

The output is from the committed examples/captures/in.pcap.

Reassembly, TCP flow tracing and the engine are keyword arguments to the same call:

>>> scapy = pcapkit.extract('in.pcap', nofile=True, engine='scapy')
>>> reasm = pcapkit.extract('in.pcap', nofile=True, reassembly=True, ipv6=True)
>>> flows = pcapkit.extract('in.pcap', nofile=True, trace=True, tcp=True)
>>> len(flows.trace.tcp)
2

More examples, including the command line interface, are in How to ....

Documentation

Pages of the official documentation worth knowing by name:

Page What is in it
API reference Every module, protocol and constant
Module structure What each subpackage is for
Engine comparison Which engines exist, which Python versions they run on, what each needs installed, and measured speed per packet
Engine support What each engine does not support, and how the gap is surfaced
Installation Extras and the local development setup
Testing Running the suite, and the sample captures it needs
How to ... Worked examples, library and CLI
Extensions Registering your own protocols, engines and dumpers

The newest changelog entry is in CHANGELOG.md, which links to the full history; contribution guidelines are in CONTRIBUTING.md.

Metadata

Release files for pypcapkit 1.6.1.post3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypcapkit 1.6.1.post3
File Size Uploaded Provenance Actions
pypcapkit-1.6.1.post3.tar.gz 5.5 MB Without provenance Details for pypcapkit-1.6.1.post3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pypcapkit 1.6.1.post3
File Actions
pypcapkit-1.6.1.post3-pp311-none-any.whl PyPy 3.11 none any Details for pypcapkit-1.6.1.post3-pp311-none-any.whl
pypcapkit-1.6.1.post3-pp310-none-any.whl PyPy 3.10 none any Details for pypcapkit-1.6.1.post3-pp310-none-any.whl
pypcapkit-1.6.1.post3-cp315-none-any.whl CPython 3.15 none any Details for pypcapkit-1.6.1.post3-cp315-none-any.whl
pypcapkit-1.6.1.post3-cp314-none-any.whl CPython 3.14 none any Details for pypcapkit-1.6.1.post3-cp314-none-any.whl
pypcapkit-1.6.1.post3-cp313-none-any.whl CPython 3.13 none any Details for pypcapkit-1.6.1.post3-cp313-none-any.whl
pypcapkit-1.6.1.post3-cp312-none-any.whl CPython 3.12 none any Details for pypcapkit-1.6.1.post3-cp312-none-any.whl
pypcapkit-1.6.1.post3-cp311-none-any.whl CPython 3.11 none any Details for pypcapkit-1.6.1.post3-cp311-none-any.whl
pypcapkit-1.6.1.post3-cp310-none-any.whl CPython 3.10 none any Details for pypcapkit-1.6.1.post3-cp310-none-any.whl

Total release size: 24.2 MB

Release files / pypcapkit-1.6.1.post3.tar.gz

Download URL pypcapkit-1.6.1.post3.tar.gz
Size 5.5 MB
Tags Source
SHA-256 checksum
How to use checksums
89457e27cc73a84049340ac4ba52299480c1c8782bd2aad15a4b0d7b789925a0
BLAKE2b-256 checksum
How to use checksums
4434bc0d5dad7fa118e489f45498c7bc0d43c2d513bb56fc2b3419dd89d6f81d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pypcapkit-1.6.1.post3-pp311-none-any.whl

Download URL pypcapkit-1.6.1.post3-pp311-none-any.whl
Size 2.3 MB
Tags PyPy 3.11
SHA-256 checksum
How to use checksums
e112e3da5959f5c68f6c1a43f489a7587d3ddc104b2845135842f07d12dd4482
BLAKE2b-256 checksum
How to use checksums
ce58b07b2cca2fe11ec41686a86d285b1e2fe3672d37dc5c6923c9091ce42d99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pypcapkit-1.6.1.post3-pp310-none-any.whl

Download URL pypcapkit-1.6.1.post3-pp310-none-any.whl
Size 2.3 MB
Tags PyPy 3.10
SHA-256 checksum
How to use checksums
4f4e04fc0a52af1194e730a86f9f048afeb8253c614e4920c5166edfe8585e5f
BLAKE2b-256 checksum
How to use checksums
8c7e4bec2750fb939a2e2a466067c6549e897143ee921e0d72ebaca235bd81c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pypcapkit-1.6.1.post3-cp315-none-any.whl

Download URL pypcapkit-1.6.1.post3-cp315-none-any.whl
Size 2.3 MB
Tags CPython 3.15
SHA-256 checksum
How to use checksums
4a2e91b7b94541382011c300b1e6b07064050f0313c0489c485835c89afb7230
BLAKE2b-256 checksum
How to use checksums
22888731cc2c2345db2a3783e5cdc320b16c7be6aa6a63beee793b1e2ec93536
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pypcapkit-1.6.1.post3-cp314-none-any.whl

Download URL pypcapkit-1.6.1.post3-cp314-none-any.whl
Size 2.3 MB
Tags CPython 3.14
SHA-256 checksum
How to use checksums
36f7b2f14618023f3d3d333dd07442fff651b0ede42f8ec551a5342fd130d530
BLAKE2b-256 checksum
How to use checksums
8cde154cb90821b7ecb9898b2273b96fa220540f9c8072d80a619f89ca375c3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pypcapkit-1.6.1.post3-cp313-none-any.whl

Download URL pypcapkit-1.6.1.post3-cp313-none-any.whl
Size 2.3 MB
Tags CPython 3.13
SHA-256 checksum
How to use checksums
3f2b06f31c64e71963d7e24f97636a68ef74f89fdd8d869bb240ab33fa8b42c7
BLAKE2b-256 checksum
How to use checksums
442ffa4a3da8be4961eee5e65620cdaa8f9df81c31bbc37c0345f6f8d1bf69e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pypcapkit-1.6.1.post3-cp312-none-any.whl

Download URL pypcapkit-1.6.1.post3-cp312-none-any.whl
Size 2.3 MB
Tags CPython 3.12
SHA-256 checksum
How to use checksums
963629eff4cd5bf304fd075fb23afa25f5d4b5f1d02a93225204286a0cc3561a
BLAKE2b-256 checksum
How to use checksums
ce3ffb9059ee4be78aa7f04ca0ff60ea7bcee9ec7074f648024790e515afe380
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pypcapkit-1.6.1.post3-cp311-none-any.whl

Download URL pypcapkit-1.6.1.post3-cp311-none-any.whl
Size 2.3 MB
Tags CPython 3.11
SHA-256 checksum
How to use checksums
0707986b055c7c3bb3028f52401594de73bbcb425d98043fdf3b59dadba7f36e
BLAKE2b-256 checksum
How to use checksums
f7b77e2b352c0ae26b04c2536e07efeb4a7d3302d2bce325c33bbdc91d903c5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pypcapkit-1.6.1.post3-cp310-none-any.whl

Download URL pypcapkit-1.6.1.post3-cp310-none-any.whl
Size 2.3 MB
Tags CPython 3.10
SHA-256 checksum
How to use checksums
518f742d6b4c2583e9ae519a96d373051ea6f1743b9a688ae9b9b1941c15beab
BLAKE2b-256 checksum
How to use checksums
682a9d29abc1443de469740ca987205c24bd20f12900d6cb23640154af00d8c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pypcapkit 1.6.1.post3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.6.1.post3 This release

9 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page