Skip to main content

PyPCAPKit: comprehensive network packet analysis library

Project description

For any technical and/or maintenance information, please kindly refer to the Official Documentation.

The PyPCAPKit project is an open source Python program focus on network packet parsing and analysis, which works as a comprehensive PCAP file extraction, construction and analysis library.

The whole project supports Python 3.6 or later.

About

PyPCAPKit is a comprehensive Python-native network packet analysis library, with DictDumper as its formatted output dumper.

Unlike popular PCAP file extractors, such as Scapy, DPKT, PyShark, and etc, pcapkit is designed to be much more comprehensive, which means it is able to provide more detailed information about the packet, as well as a more Pythonic interface for users to interact with.

Module Structure

In pcapkit, all files can be described as following eight parts.

  • Interface (pcapkit.interface)

    User interface for the pcapkit library, which standardises and simplifies the usage of this library.

  • Foundation (pcapkit.foundation)

    Synthesises file I/O and protocol analysis, coordinates information exchange in all network layers, as well as provides the foundamental functions for pcapkit.

  • Protocols (pcapkit.protocols)

    Collection of all protocol family, with detailed implementation and methods.

  • Utilities (pcapkit.utilities)

    Auxiliary functions and tools for pcapkit.

  • CoreKit (pcapkit.corekit)

    Core utilities for pcapkit implementation, mainly for internal data structure and processing.

  • ToolKit (pcapkit.toolkit)

    Auxiliary tools for pcapkit to support the multiple extraction engines with a unified interface.

  • DumpKit (pcapkit.dumpkit)

    File output formatters for pcapkit.

  • Constants (pcapkit.const)

    Constant enumerations used in pcapkit for protocol family extraction and representation.

Engine Comparison

Due to the general overhead of pcapkit, its extraction procedure takes around 0.2 milliseconds per packet, which is already impressive but not enough comparing to other popular extration engines availbale on the market, given the fact that pcapkit is a comprehensive packet processing module.

Additionally, pcapkit introduced alternative extractionengines to accelerate this procedure. By now pcapkit supports Scapy, DPKT, and PyShark.

Test Environment

Operating System

macOS Ventura 13.4.1

Chip

Apple M2 Pro

Memory

16 GB

Test Results

Engine

Performance (ms per packet)

dpkt

0.010390_056723

scapy

0.091690_233567

pcapkit

0.200390_390390

pyshark

24.682185_018351

Installation

Simply run the following to install the current version from PyPI:

pip install pypcapkit

Or install the latest version from the gi repository:

git clone https://github.com/JarryShaw/PyPCAPKit.git
cd pypcapkit
pip install -e .
# and to update at any time
git pull

And since pcapkit supports various extraction engines, and extensive plug-in functions, you may want to install the optional ones:

# for DPKT only
pip install pypcapkit[DPKT]
# for Scapy only
pip install pypcapkit[Scapy]
# for PyShark only
pip install pypcapkit[PyShark]
# and to install all the optional packages
pip install pypcapkit[all]
# or to do this explicitly
pip install pypcapkit dpkt scapy pyshark

For CLI usage, you will need to install the optional packages:

pip install pypcapkit[cli]
# or explicitly...
pip install pypcapkit emoji

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypcapkit-1.3.5.tar.gz (671.6 kB view details)

Uploaded Source

Built Distributions

pypcapkit-1.3.5-pp310-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.5-pp39-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.5-pp38-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.5-cp313-none-any.whl (976.2 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.5-cp311-none-any.whl (976.2 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.5-cp310-none-any.whl (976.2 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.5-cp39-none-any.whl (976.2 kB view details)

Uploaded CPython 3.9

File details

Details for the file pypcapkit-1.3.5.tar.gz.

File metadata

  • Download URL: pypcapkit-1.3.5.tar.gz
  • Upload date:
  • Size: 671.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5.tar.gz
Algorithm Hash digest
SHA256 30e9d5e6963f8bf5d288fa5025ee855323edbf1986820937f12e1abf8587e175
MD5 22e1e05415e3544f879723669fe89740
BLAKE2b-256 42494e32c7ebc5ecebde1572a06065211c41af64c1414d32f4d4bd511c329c31

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5-pp310-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.5-pp310-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5-pp310-none-any.whl
Algorithm Hash digest
SHA256 996b3203f1c3a7494a7e3dea7c708b46549af9f83858369447481472c482c67e
MD5 db7aa2a3535a652b51107d63655c31cc
BLAKE2b-256 208c5f5db175b94426c3d5ff3f031a733706afd621cf5c0a3ceb41d1493375cd

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5-pp39-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.5-pp39-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5-pp39-none-any.whl
Algorithm Hash digest
SHA256 f9ecbeac0c7b811f56dd0aff6a24f8fc16d0154e12ee0ebe2432a641f74d0e9e
MD5 7d8d9c9b9c00f251042b82265d8a7c13
BLAKE2b-256 2b84600dd41ec4fa89ad27b47af58b01e5bb36d093088028861675dc947998ca

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5-pp38-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.5-pp38-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5-pp38-none-any.whl
Algorithm Hash digest
SHA256 3a41a3941629eecb69c5d717d8d0a190deb1c18eeaf9f525ef1f06b33c2d8cf7
MD5 5f8cb823ca3857fd035a87d94836be8b
BLAKE2b-256 b35ef5bdaa67f2f6eb62f39485fae323d314d066b70031acde91f8d054aed6f0

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5-cp313-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.5-cp313-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.13
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5-cp313-none-any.whl
Algorithm Hash digest
SHA256 06e5739521aaaab2e4280870d38fb970a2b98c00babb5d24a1f36799ebb6c622
MD5 fd45e6c5449a3db334fb0e0fbb58d360
BLAKE2b-256 a421c8278ecfe8f373e0f25133919aa859454161a1cae7a2e4fae923d9c7c55e

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5-cp311-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.5-cp311-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5-cp311-none-any.whl
Algorithm Hash digest
SHA256 1f6ca5de1b8d210b7bd0f2916c52052024c9725adf1d25a710ddbbe819f2536e
MD5 a9d419b7aefb4289210b4476933e6493
BLAKE2b-256 5eb4cb2ff0f7b63ba7c9c725e281c9ddfc3efc9389fe92a13f4fa2de98a81b23

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5-cp310-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.5-cp310-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5-cp310-none-any.whl
Algorithm Hash digest
SHA256 35e4c5334ddd53207cb1d85151f1f7095c7799e2f2469624ce522cb98dcbcc1f
MD5 5dbe520e67027d4e061cd2233a163c56
BLAKE2b-256 ed97747b560e774b8234ab6c525f0051a6e0920ce0a953f2cc02d033f26dd689

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5-cp39-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.5-cp39-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5-cp39-none-any.whl
Algorithm Hash digest
SHA256 a9b21173790b5abba3f3ed4c551a8e78dffdf0cb6485fecd61e57b207814a768
MD5 0e2c58e6276c418fe21625d294a744a3
BLAKE2b-256 6b6d17676266ae1dd89e800d3d6215ad1af67dc778d2a989a6d0d1dd593c1c92

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page