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.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.1.0.post3.tar.gz (655.3 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.1.0.post3-pp39-none-any.whl (958.7 kB view details)

Uploaded PyPy

pypcapkit-1.1.0.post3-pp38-none-any.whl (958.7 kB view details)

Uploaded PyPy

pypcapkit-1.1.0.post3-cp311-none-any.whl (958.7 kB view details)

Uploaded CPython 3.11

pypcapkit-1.1.0.post3-cp310-none-any.whl (958.7 kB view details)

Uploaded CPython 3.10

pypcapkit-1.1.0.post3-cp39-none-any.whl (958.7 kB view details)

Uploaded CPython 3.9

pypcapkit-1.1.0.post3-cp38-none-any.whl (958.7 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.1.0.post3.tar.gz.

File metadata

  • Download URL: pypcapkit-1.1.0.post3.tar.gz
  • Upload date:
  • Size: 655.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0.post3.tar.gz
Algorithm Hash digest
SHA256 14088ddf5fa057506977311580305f8d92a01e3f801169f87b9935daf0db810a
MD5 75870516b97f6bcb79e193f4fcc86c56
BLAKE2b-256 ae1c158d00990e71089d4146c98b3491f9f2e8d466e874641485b3b8b9fdb44d

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.0.post3-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post3-pp39-none-any.whl
Algorithm Hash digest
SHA256 736000dd03ab527cb0d9118ad5989475dfadbf3168a1d94e47692f6afd71f4e4
MD5 8e2dde5b8e89c6e744be49b700830cf2
BLAKE2b-256 ea7dd9bbbf5ea785c35063889b2fd5da59c1e0fa0575ca2e6ab3e1b1f74a96eb

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.0.post3-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post3-pp38-none-any.whl
Algorithm Hash digest
SHA256 d794c293ea8285c8598dfe0b228f20347542f0c257e372179b3639230f3667dc
MD5 29178ecc1f48aecbad506582646245d8
BLAKE2b-256 10f90c95ee5bfecb76326ac48fa85971c4c163697d8eacb91fd7e353db519870

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.0.post3-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post3-cp311-none-any.whl
Algorithm Hash digest
SHA256 79246cc7fc366728db67ef5484b1ea78b1e87ff8953cde8db7a35f26b5d5cf00
MD5 f9c56dececa76cfe06de5dbafe3da530
BLAKE2b-256 87a9564df463df4f5785d701150eab52edfd6abe4d8220a30d6c73dc28b7d3e5

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.0.post3-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post3-cp310-none-any.whl
Algorithm Hash digest
SHA256 ffc35570cd492554f9c69236b7d602a3ba474846f350b8c378a4c000a925775a
MD5 d011b9346e020362e910d5036fe7e021
BLAKE2b-256 f5695e771376c4b0178821190b9a62ced9ac49e75577f8d6c429a3d95fc1ef11

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.0.post3-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post3-cp39-none-any.whl
Algorithm Hash digest
SHA256 b1e46dcc87e772104b087d5cfa9cd0c77ad93c041ceab77411e1aa09fad05c3e
MD5 1e43b03035488f215f97833946d4606b
BLAKE2b-256 37414ab8c8d74a1d23d3d16f63ce6d97526d06a8ff035e1cbdf1ba1db0684ea8

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.0.post3-cp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post3-cp38-none-any.whl
Algorithm Hash digest
SHA256 fcecdd599543c7f2809d8b609e8876cfb785ef5af601c8b767e6f2a21fa3b1f6
MD5 bbb4cbb847aa20381d8a65e52a551085
BLAKE2b-256 8d6f845bf7f9acd3a80e262cc159686bd5021977ff130caf32f9d7f545513edf

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