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 Beta (22F5037d)

Chip

Apple M2 Pro

Memory

16 GB

Test Results

Engine

Performance (ms per packet)

dpkt

0.010694_027361

scapy

0.093399_399399

pcapkit

0.199796_296296

pyshark

25.066692_025359

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.0.2.post5.tar.gz (437.2 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.0.2.post5-pp39-none-any.whl (733.8 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post5-pp38-none-any.whl (733.8 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post5-cp311-none-any.whl (733.8 kB view details)

Uploaded CPython 3.11

pypcapkit-1.0.2.post5-cp310-none-any.whl (733.8 kB view details)

Uploaded CPython 3.10

pypcapkit-1.0.2.post5-cp39-none-any.whl (733.8 kB view details)

Uploaded CPython 3.9

File details

Details for the file pypcapkit-1.0.2.post5.tar.gz.

File metadata

  • Download URL: pypcapkit-1.0.2.post5.tar.gz
  • Upload date:
  • Size: 437.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pypcapkit-1.0.2.post5.tar.gz
Algorithm Hash digest
SHA256 682566f0f2db1ed97c2a7fff49a1a67bb7843eb22fdb22796e4a596f81e4f4b1
MD5 86124c9a391ab7a279850df63b29174f
BLAKE2b-256 190dbb9e9013cd0826c6cff6098b0fff035d53a1d60dc5d2d89af8b34b650f8f

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post5-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post5-pp39-none-any.whl
Algorithm Hash digest
SHA256 dd86c251c0b333b5f740d3454e25f3e96176de5d6367c5bf964e268ca72f8694
MD5 11796aaced85dfd5cb59b2c07d6e5711
BLAKE2b-256 2f9fb53079f139a8d10ada58c3609b2164055372f8c192d380dffe81af6aca15

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post5-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post5-pp38-none-any.whl
Algorithm Hash digest
SHA256 a39eb229255a68e3ce9cab0e07d8c6cd4f9342148ec80ddeef01f1b9bba9afb1
MD5 18fd88b170f3f36e54cec429f41b0eb2
BLAKE2b-256 cda6fd16de4c9fdd723ce260ddd05902d16493fdfa3f720d2866bbc99cd5a9dc

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post5-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post5-cp311-none-any.whl
Algorithm Hash digest
SHA256 bf99c1f33214f159e8d69723b8b15d3d208b9088edc769ae96cf31d9b2f0bea8
MD5 32749ecb729190d0c751b3c73f613db7
BLAKE2b-256 309bea7084090fc2e5ec7f07db41a375cf0ec7875f7ecefa0b290f6aa38479b7

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post5-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post5-cp310-none-any.whl
Algorithm Hash digest
SHA256 06ae4a680c5ffc49dbed1d03b89085bf37295cfe2af7c0c239236230fc12798a
MD5 717c7dc88e9fd110e9187626034132cc
BLAKE2b-256 32b1464a37f6709e9c941b98de7e31d624d8fa7f9a135540e9e8040870c0ab56

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post5-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post5-cp39-none-any.whl
Algorithm Hash digest
SHA256 e5337efe55c19b2977d676877207beeb786210fbf7e729012dfdc1f730b78354
MD5 0eb5a7d64715609bb850659f70bb20cd
BLAKE2b-256 6d91255b8de33e13b81131c462311edef8eb814818836d094a6c38855a084b40

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