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 uses streaming strategy to read input files. That is to read frame by frame, decrease occupation on memory, as well as enhance efficiency in some way.

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 Beta (22F5037d)

Chip

Apple M2 Pro

Memory

16 GB

Test Results

Engine

Performance (ms per packet)

dpkt

0.010694_027361

scapy

0.093399_399399

pcapkit

0.199796_296296

pyshark

25.066692_025359

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.0.2.post8.tar.gz (441.5 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.0.2.post8-pp39-none-any.whl (740.2 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post8-pp38-none-any.whl (740.2 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post8-cp311-none-any.whl (740.2 kB view details)

Uploaded CPython 3.11

pypcapkit-1.0.2.post8-cp310-none-any.whl (740.2 kB view details)

Uploaded CPython 3.10

pypcapkit-1.0.2.post8-cp39-none-any.whl (740.2 kB view details)

Uploaded CPython 3.9

pypcapkit-1.0.2.post8-cp38-none-any.whl (740.2 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.0.2.post8.tar.gz.

File metadata

  • Download URL: pypcapkit-1.0.2.post8.tar.gz
  • Upload date:
  • Size: 441.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.0.2.post8.tar.gz
Algorithm Hash digest
SHA256 27b07f710ce57846275609b31db4ef7d0ea87cfd7a672d52fe9ce8ac589c4b6c
MD5 1567094b623473415293716a723f6afe
BLAKE2b-256 27b6c55debf2c14e5145e07f1b38b2d1ff284822b9dfcf5a4b44f758fc007f48

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post8-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post8-pp39-none-any.whl
Algorithm Hash digest
SHA256 95ef44a3e041e96ebcd9ed7f10be84095b36a6bc1196baa184739b98a385f8ad
MD5 800ad7835a47fd6158c9242b6d3d005e
BLAKE2b-256 db53a594fccdf384349cb9aefb31237b56b2e8978776c19e8433cdefd70e353e

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post8-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post8-pp38-none-any.whl
Algorithm Hash digest
SHA256 8b3405967f3d058715bae3959c3ea793e7b6c0b7c615a3ae48d7c5f7dded202e
MD5 391e274de78837332cdd2b05f644bb41
BLAKE2b-256 7db025e8ccb631db27c855dab5410006c61f78bed3a627f60359e2e0e89ad948

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post8-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post8-cp311-none-any.whl
Algorithm Hash digest
SHA256 8823f15d5fbb264353f44a6bed5784f0a613ce4afb8ca863cfb6023e34c2487c
MD5 e4f3eec2c47ab0cc5c8391b3601ac7f3
BLAKE2b-256 ff2e8223badce17eba92163113d8b2505e6732edc3df26ae40bcf8582f4fee29

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post8-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post8-cp310-none-any.whl
Algorithm Hash digest
SHA256 0a3890ed593b715efdfc9bb8f0d77837582fc7d2fed979f9f6fad175d9b1b29b
MD5 e8f9f233a5ccc09facbdcbb7ef44fc87
BLAKE2b-256 2f0bf96d4833d17a04505a4506dad27aa0122f4042f17298cfc1ddfcf68c0202

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post8-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post8-cp39-none-any.whl
Algorithm Hash digest
SHA256 50fb0fef9e1ebfe9c8c784d237f1a786ef84af1f3600c1b14cc1c987f1a9bc95
MD5 8e63096af3926a9ccd186c9ac423fe1d
BLAKE2b-256 0e27750a29f278537d1c172927e89e363e17e036184e933d259b632948439cc1

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post8-cp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post8-cp38-none-any.whl
Algorithm Hash digest
SHA256 99d3fd6154f27a6375044539850638732a60351dd9d896cdc45066d42c70cc81
MD5 b9bccfd73331ad5ea16229219c0138bf
BLAKE2b-256 d190a15277662127add1577b4b0fbff322cca3379e4ed386e540d0f1ce9fbc82

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