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.1.post1.tar.gz (655.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.1.1.post1-pp39-none-any.whl (958.9 kB view details)

Uploaded PyPy

pypcapkit-1.1.1.post1-pp38-none-any.whl (958.9 kB view details)

Uploaded PyPy

pypcapkit-1.1.1.post1-cp311-none-any.whl (958.9 kB view details)

Uploaded CPython 3.11

pypcapkit-1.1.1.post1-cp310-none-any.whl (958.9 kB view details)

Uploaded CPython 3.10

pypcapkit-1.1.1.post1-cp39-none-any.whl (958.9 kB view details)

Uploaded CPython 3.9

pypcapkit-1.1.1.post1-cp38-none-any.whl (958.9 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.1.1.post1.tar.gz.

File metadata

  • Download URL: pypcapkit-1.1.1.post1.tar.gz
  • Upload date:
  • Size: 655.5 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.1.post1.tar.gz
Algorithm Hash digest
SHA256 52933169039e1b0ca28dea593755583be09c85340c313c4541c559043c3e87bc
MD5 360e6254d77dbc0208d6749ae1e48a6d
BLAKE2b-256 7f4acc4aa4555920607c0e9a3bd32cd4abbb0ae758bbb2318b36357ed56dd785

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1.post1-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post1-pp39-none-any.whl
Algorithm Hash digest
SHA256 2c5315702d1cd0fda98f421102b58525411aa200be5be9698b5c8df1f18095b9
MD5 30af423b3dbbbc4f163f5f86d869492e
BLAKE2b-256 1e10508d094f84c987c6a232d56a3b54e7eeda74cd6b625957b30df2edc52d08

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1.post1-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post1-pp38-none-any.whl
Algorithm Hash digest
SHA256 804dbe84ea6f72e11024d21b2479564e4093d55ee96dfb1c103b7051e94aec38
MD5 51aca47023644597ada9106741443ee2
BLAKE2b-256 36f91aa7549f38b04e89ed665cf7b642bcd5c97fd25ec1dd7073d9d25ef07fa4

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1.post1-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post1-cp311-none-any.whl
Algorithm Hash digest
SHA256 9661b3fc81603ee298e848639f74faf48a540167a8d46e574a8a405e24a2c962
MD5 77264853e8ec474f8e2ee29ed431232f
BLAKE2b-256 209983982b5a888bfa316c0673866f8511ba7572f95860fa5c3d35182d91baf3

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1.post1-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post1-cp310-none-any.whl
Algorithm Hash digest
SHA256 e99866c9e1eda96443d48890326290d762548919936658b7c0f2a5e0a6fd9e23
MD5 53b0f1706e8794f200ee5bd8588407d9
BLAKE2b-256 bd7c51fd58c3c611ca3ebb45ed398dbb33634ecd1e946c688eccfd5ab71caa3d

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1.post1-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post1-cp39-none-any.whl
Algorithm Hash digest
SHA256 8aa4902427dc380aaa609eb004386db2f3a54da0af49272acb9dfc7ce8c31a26
MD5 9de8112a69e0d27bb8fa728a0c93a656
BLAKE2b-256 7621dced450cc0145910a22b107219cf9b5205e9ec7ef11446d079079b044e93

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1.post1-cp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post1-cp38-none-any.whl
Algorithm Hash digest
SHA256 c66ed727e2cc5e70fdb5fd277c2cea59e4b7226eb907493db6e1d40668e21fc9
MD5 c48a6202207c350804aa6aaed417a9c3
BLAKE2b-256 465effa0dfa0227f95a2056cc03c24b505b5f9741fea76b4b9ec668822af7dc8

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