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

Uploaded PyPy

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

Uploaded PyPy

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

Uploaded CPython 3.11

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

Uploaded CPython 3.10

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

Uploaded CPython 3.9

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

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.2.1.post3.tar.gz
  • Upload date:
  • Size: 663.6 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.post3.tar.gz
Algorithm Hash digest
SHA256 42632e3072a8d539e178182190310dafb3249ba354f6b516846f482def089108
MD5 69a05cffcff9ec4ce520bc512fb7e30f
BLAKE2b-256 94efd7af2e2237426a3ff956309dcefff7c6f427574b1487b4344bbd68db51ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post3-pp39-none-any.whl
Algorithm Hash digest
SHA256 c9ec39f1491d1b11963e760ca91a6521784e60659ae01cb1dd1d37b37afd3ec9
MD5 4952cec38dcfe125005a4a5a00669f6e
BLAKE2b-256 d361a519a5b668c8b52e46bd6d6534c948129bb890deba3452e5d629a4d890ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post3-pp38-none-any.whl
Algorithm Hash digest
SHA256 bcf6d744e061e22913e31fe78abf14728170e7e65d2ee53e29157565da3353a3
MD5 b380a9f67dce974e05b623bd78cf22da
BLAKE2b-256 622ab78c33d5c30834d83a5d7a8d17bcfc9147922381ef88c3ab57fcfbed96b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post3-cp311-none-any.whl
Algorithm Hash digest
SHA256 ab8d39c97678a522f216dc236b3f170663e0a88cd9132cfc41d09661cd9d7d01
MD5 9746bca5980441384c3b2cfa25692025
BLAKE2b-256 a13d267bb8ff48e8262ebc5cd22bc1d3dbd0098376ba85b8778ba72c137a8924

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post3-cp310-none-any.whl
Algorithm Hash digest
SHA256 67d5ff0a27c2b1fc01d66f1abdf67b98e3e46d83535bf38a885d73da829301a5
MD5 9d6b66d23d172a91d121d4ce75637fc5
BLAKE2b-256 dfa50f56c3c4e2baac9a90676e0bfb7aa2f1b2ba8b80d97e4c79c88cbeaa6e5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post3-cp39-none-any.whl
Algorithm Hash digest
SHA256 775bb0131708fab3d2ab410b92760345c146e98f1c83294c593d3f0b9b9fd39f
MD5 978616eb1f8902556befd40357afa7ab
BLAKE2b-256 60e812037deae45fee2db66ab40e99a60af4270d5885439794bb3595d28eb242

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post3-cp38-none-any.whl
Algorithm Hash digest
SHA256 bc9950df33dc6a46c99529315d10ec3bbe432e8ae98d24489d8b0c337ca25982
MD5 595598da15191e93975ac9bd9717bda0
BLAKE2b-256 65b291a7f47495e3bfad8eb865143efdbeb9a5ce6c7fd5d47b0140b1927e878e

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