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

Project details


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.post20.tar.gz (670.7 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.post20-pp310-none-any.whl (975.5 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post20-pp39-none-any.whl (975.5 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post20-pp38-none-any.whl (975.5 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post20-cp312-none-any.whl (975.5 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.1.post20-cp311-none-any.whl (975.5 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.1.post20-cp310-none-any.whl (975.5 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.1.post20-cp39-none-any.whl (975.5 kB view details)

Uploaded CPython 3.9

pypcapkit-1.3.1.post20-cp38-none-any.whl (975.5 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.3.1.post20.tar.gz
  • Upload date:
  • Size: 670.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pypcapkit-1.3.1.post20.tar.gz
Algorithm Hash digest
SHA256 933d4a1eda55b882094b88b61d485d909b7ddc4a4cabd1b73a1c7977df01c6ed
MD5 206c4a244d9747f51f30ddf0a799c4b5
BLAKE2b-256 b0e81252f019522658f98a6afa76c201fd0bc79b2d49815d1faf842555cf37d5

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post20-pp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post20-pp310-none-any.whl
Algorithm Hash digest
SHA256 90868796fef0c1b28dc883d85b3b25af8cf3cfd670ddc6284df4f36ebb00faec
MD5 d5a19330707c2c3e3158ce873e95c3fe
BLAKE2b-256 f17eaa87ca8ce4d7fd98334fd5451424d560c718b78f3ce46b14aa129ba2fc28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post20-pp39-none-any.whl
Algorithm Hash digest
SHA256 8a634e8e33c954ea4941bcdc2562226b5ce256f505eb817688c20635afbc23ff
MD5 1c00d295cd12290b6c80fcdaf4211d48
BLAKE2b-256 1e340f087b7a72bdf0af300062fc3f2be7fd2b42ec4460316703e3ea93c5b52a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post20-pp38-none-any.whl
Algorithm Hash digest
SHA256 9b1418760aaa6afc67d3635089f5e5cc49a85eb9252d11da8eb3b19ecc75bd15
MD5 83cbad14abc0423e77d685be731eb022
BLAKE2b-256 979f5880c9122987644b2fe1e1aa7392d84af8378f9a59bf1fe3d2e87c22603f

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post20-cp312-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post20-cp312-none-any.whl
Algorithm Hash digest
SHA256 bf4f6d75eb8ef2c0c8c0f05732f73705e2a971576ea8755fb99cff7e9ea62769
MD5 f6cd21528405d4ff8e78fef1f3278608
BLAKE2b-256 99932b40bd230c9c6c9e42f76b68ff7129ee3d9c6ce3476080d5b83e5a3f270e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post20-cp311-none-any.whl
Algorithm Hash digest
SHA256 dcbe71860473c9911d9014e1be36dde2c4d835cde72f977c72d337b60aec4540
MD5 ae6534193a195090a4fb7f889085add0
BLAKE2b-256 d497a6dc294ad4f0b3480ed1d0303bb551fee8e3c8fdedd57917c4d59c42c4df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post20-cp310-none-any.whl
Algorithm Hash digest
SHA256 706e1919a6a49f80628c8461e32eb55eb161c77e64df684fde49105692f4a4d4
MD5 f8b0106e98aaaf50075e1c35e7a3d300
BLAKE2b-256 b82062a964279662da56007710f2eef96b5afba7dd7282dfc434c88c35ad87b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post20-cp39-none-any.whl
Algorithm Hash digest
SHA256 d8a8c299a803892f0d1e69a3174e49ebfcc8222cd5e4e849ee59cbe8a9fad7c1
MD5 11c53039e1a9d815af0f17d60101a080
BLAKE2b-256 d54de9ea8873294e1e666ff6b67d791d88ff6207c53e0e6fc78352d9b4e5bef3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post20-cp38-none-any.whl
Algorithm Hash digest
SHA256 f000dadc18b3d843a32101d35c77ab71102e433347d133d35899bcb82b23720f
MD5 0f0b9f88a0d9a4f8a9a7e0e3902e6a01
BLAKE2b-256 38424ca9ffaac8d779715ab8fc884b007855c712662f069d1a9f246a99087143

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