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

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.1.dev3.tar.gz (670.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pypcapkit-1.3.1.dev3-pp39-none-any.whl (975.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.dev3-pp38-none-any.whl (975.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.dev3-cp311-none-any.whl (975.2 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.1.dev3-cp310-none-any.whl (975.2 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.1.dev3-cp39-none-any.whl (975.2 kB view details)

Uploaded CPython 3.9

pypcapkit-1.3.1.dev3-cp38-none-any.whl (975.2 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.3.1.dev3.tar.gz.

File metadata

  • Download URL: pypcapkit-1.3.1.dev3.tar.gz
  • Upload date:
  • Size: 670.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pypcapkit-1.3.1.dev3.tar.gz
Algorithm Hash digest
SHA256 50f9f5cc510b7d1cab26429324ce638d0b336026bdbf8d10fd01cb77bf4db408
MD5 c9911aa86b919b06284b9e22aed68c1e
BLAKE2b-256 feb277a7965c3ef8067c459823fd59de4c63fd5d9c710a6a4a0d1c4845523f3e

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev3-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev3-pp39-none-any.whl
Algorithm Hash digest
SHA256 c93b804f82097299fd8380dc72a0acc6fe1915de1d82edbbacb0f18588c32f8f
MD5 355c3ec3fa2889f4828d8010f5b96750
BLAKE2b-256 c35950d8788e7518bb5b52e1e735d147a30b097fbad884940240662abdda0517

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev3-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev3-pp38-none-any.whl
Algorithm Hash digest
SHA256 363fdc2fb1bed8eac1b9c485328dedd89b0443e85febf00d8e8e4413e31bef60
MD5 52b543efb0cd521c166845afa8430e81
BLAKE2b-256 cd143493f1898d81f886cee93c73f1c82d249eaa6de81ec5e93a43ca2916df53

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev3-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev3-cp311-none-any.whl
Algorithm Hash digest
SHA256 ffbcdab04d5c75666bf499aba31dd9c36f314694d11fe54f81db8cdcc48be079
MD5 bcac86a13f492758fcb057c43a99357e
BLAKE2b-256 f9b9b19d06e4d4becfd6ebf4c0d0b6b09b6d6bec80825e7813ab6a91a84a5376

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev3-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev3-cp310-none-any.whl
Algorithm Hash digest
SHA256 c2aea6c26951f94a5e49e50840ce7b32e19177a5bac72541d20ad9774d32f6a2
MD5 135afe068d26276bd8c247ca973e75a1
BLAKE2b-256 f004107906e594567ab9ea31a6942b4801c5d5f580df924ce199c6c0b38b8a7d

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev3-cp39-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.1.dev3-cp39-none-any.whl
  • Upload date:
  • Size: 975.2 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pypcapkit-1.3.1.dev3-cp39-none-any.whl
Algorithm Hash digest
SHA256 4de8f605a60ddbdc6b23d4533e8ce238663e48e68a77ea161071f72d5dabc480
MD5 9d52d36017f08d1746f31a09e5a85a5b
BLAKE2b-256 ed829ce0fd8da6eac3aeb80abd43a618613f1c3c7b8808d3d834a9aecd76ada5

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev3-cp38-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.1.dev3-cp38-none-any.whl
  • Upload date:
  • Size: 975.2 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pypcapkit-1.3.1.dev3-cp38-none-any.whl
Algorithm Hash digest
SHA256 d3b9bd45c265b5d3f2326b7fa31cbc36be873bc5083579e3e48311f8452142f2
MD5 f8aa878dc2fa17e2824c43c4582d078d
BLAKE2b-256 f17e70f547d2c2697f412fd049b4a41b2200c456f3a4aa7402994c16fae07cb7

See more details on using hashes here.

Supported by

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