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.2.1.tar.gz (663.0 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.2.1-pp39-none-any.whl (966.8 kB view details)

Uploaded PyPy

pypcapkit-1.2.1-pp38-none-any.whl (966.8 kB view details)

Uploaded PyPy

pypcapkit-1.2.1-cp311-none-any.whl (966.8 kB view details)

Uploaded CPython 3.11

pypcapkit-1.2.1-cp310-none-any.whl (966.8 kB view details)

Uploaded CPython 3.10

pypcapkit-1.2.1-cp39-none-any.whl (966.8 kB view details)

Uploaded CPython 3.9

pypcapkit-1.2.1-cp38-none-any.whl (966.8 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.2.1.tar.gz
  • Upload date:
  • Size: 663.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.1.tar.gz
Algorithm Hash digest
SHA256 372ee70bd8241dd625882108119be9074a4c595315b7f8839e2f0e23b1744bfd
MD5 54e6a7080df256be902603e831f3d1a5
BLAKE2b-256 62affa37cb506370c0d68d6bb6b12e5675f95d30a883abc4e03da0d91ddd4d50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.1-pp39-none-any.whl
  • Upload date:
  • Size: 966.8 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.1-pp39-none-any.whl
Algorithm Hash digest
SHA256 56a5e3737dd93245474e282da6a5cdbf5722176f5d3433c1dec6f64f53903c69
MD5 e8fffb15be5e442068f01375db636e94
BLAKE2b-256 8c71624fbf8f5ae3270fd2181f3971932950a62ac69e29f085fd6a424d02295c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.1-pp38-none-any.whl
  • Upload date:
  • Size: 966.8 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.1-pp38-none-any.whl
Algorithm Hash digest
SHA256 e32e3384f209e54416e230401249c5b28b20eae70f70b1f254c40c40c7203202
MD5 2be21f008556f7bdecb546ebed74be3d
BLAKE2b-256 2d93cd51ca08fbc295670f91993696895e470437c243218b394195f717b333e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.1-cp311-none-any.whl
  • Upload date:
  • Size: 966.8 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.1-cp311-none-any.whl
Algorithm Hash digest
SHA256 e294c78ea7f424314104cdac1e8ce25a380bfd725d10a992cd04f6fc71b32896
MD5 08ae50dc00252430d5817372a4dbf155
BLAKE2b-256 3f93027f422e4df509d5d6f2a3975157d88abc80962e2ee24d510f0a5c89763e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.1-cp310-none-any.whl
  • Upload date:
  • Size: 966.8 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.1-cp310-none-any.whl
Algorithm Hash digest
SHA256 f2fe1b4fe28a6da473b8b00e2c4363b90627575a5fcd703a6b8afc5b01985a38
MD5 ddff7af5271d83e3663b249c752f473a
BLAKE2b-256 60aea10cf6e937e5628d879ce004da084a73e524822da0fc53def48c466cbe58

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.2.1-cp39-none-any.whl
Algorithm Hash digest
SHA256 67b6b23ceade53972031ed051cb9608f23705496d2d587ca617b94f1727c83bb
MD5 25713a6b29d51821d5a773ab799dccba
BLAKE2b-256 854554a27e20feb93e707a1d411316cbb10075fd6d4d0d09255bbe3f782522c1

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1-cp38-none-any.whl.

File metadata

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

File hashes

Hashes for pypcapkit-1.2.1-cp38-none-any.whl
Algorithm Hash digest
SHA256 506e0fc4e7ab937180ccaf00f08e2776c44048149abd7809d24c07a2905acd49
MD5 a0cc4f6b5b3b3f4145456e5adba3ccad
BLAKE2b-256 72caebeccfb59c1ae44af778cbe6d89cbcaf01260495cfa2e65c0b7cfee4ad43

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