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.dev5.tar.gz (670.9 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.dev5-pp39-none-any.whl (975.4 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.dev5-pp38-none-any.whl (975.4 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.dev5-cp311-none-any.whl (975.4 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.1.dev5-cp310-none-any.whl (975.4 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.1.dev5-cp39-none-any.whl (975.4 kB view details)

Uploaded CPython 3.9

pypcapkit-1.3.1.dev5-cp38-none-any.whl (975.4 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.1.dev5.tar.gz
Algorithm Hash digest
SHA256 fd52c64198237f18d6b1e12fa758c0c24991c4b453396a5bcefb10089ab63b96
MD5 62d30ef36d6827ca77c9275ba3c6b230
BLAKE2b-256 dc5ffbfb52112190e44763c85a2ab897b2396c3023caabf2f5645f416a00d853

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev5-pp39-none-any.whl
Algorithm Hash digest
SHA256 6cbcf94e5a869c6951ed26a0814d5f7380aa696740239b3b2bd01f1cce0411d7
MD5 6d62d696c87bd30aa7618b98a29940fc
BLAKE2b-256 69e21082d3f340a3836838605c294345a80075340b3eb7c0518ee72ae3e03636

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev5-pp38-none-any.whl
Algorithm Hash digest
SHA256 c5245dc051bb0652d57c46403b5873be5562a1d6bace96f08bbc067d807596bc
MD5 1d32a8ee7a146270e65a3afac3aa2ce9
BLAKE2b-256 4a5673947ed857529083f9eeb7666313a8a4db87ebd6aad457297d1f6576398a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev5-cp311-none-any.whl
Algorithm Hash digest
SHA256 0dbfe5e6c44bb090de1cfb16391e706bd043bdfcd20c9c2604fd225519edfa33
MD5 5c28c1802b4d118d6e0c2d9e0852c43c
BLAKE2b-256 0920b57240155b24071817b67900b7510aec1fc6548a84f4578822d0c7c8a862

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev5-cp310-none-any.whl
Algorithm Hash digest
SHA256 dfad31be19064b41e16891ffa253d3a1c00a67528410f680ef58da2a12733e53
MD5 964da8a420cbac58735ffed84b528349
BLAKE2b-256 6fc618f909cd8777ac9ff7c37c7556168ae4799b1a0c584f6a6fbc0131186d83

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.1.dev5-cp39-none-any.whl
Algorithm Hash digest
SHA256 524d7e6259310c741f7e949709baebdf5f7cc4b5ec47bec825573488110845d7
MD5 9420f3cda074f97a28eeb647f642b0f2
BLAKE2b-256 eaaf4d29a38b8e2feb1dd67a6381b50a2b04c6b81e90a361ec0aa2d3159a74c3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.1.dev5-cp38-none-any.whl
Algorithm Hash digest
SHA256 6a77b40551bbf125389ef3a71d5abed217b99f0e9908f6fabdf6290b558c6fca
MD5 f280ac85150da4903ac680eff57b1884
BLAKE2b-256 5b156b52c16c6f53537e581b98b551cb7146fa9b2a220fd8c42a2201c25c7450

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