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

This version

1.1.0

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.0.tar.gz (654.8 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.0-pp39-none-any.whl (958.4 kB view details)

Uploaded PyPy

pypcapkit-1.1.0-pp38-none-any.whl (958.4 kB view details)

Uploaded PyPy

pypcapkit-1.1.0-cp311-none-any.whl (958.4 kB view details)

Uploaded CPython 3.11

pypcapkit-1.1.0-cp310-none-any.whl (958.4 kB view details)

Uploaded CPython 3.10

pypcapkit-1.1.0-cp39-none-any.whl (958.4 kB view details)

Uploaded CPython 3.9

pypcapkit-1.1.0-cp38-none-any.whl (958.4 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.1.0.tar.gz
  • Upload date:
  • Size: 654.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 eaec214a5f492b0cb2d9bdb50fe5c1089a071759646aaf3aa07a8aaf3846cbb8
MD5 eb1e38ed0ea2deeec461dff199b904e3
BLAKE2b-256 782652a2a21e11d92e08b3888add4a0aed277d1d8426606493ed650b62f7331b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.1.0-pp39-none-any.whl
  • Upload date:
  • Size: 958.4 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0-pp39-none-any.whl
Algorithm Hash digest
SHA256 988697e918ed6be9b407ddf4e1671a19dcb7d922b41f0c3b583caf1731e140ee
MD5 d540b381636984ece5b3130c13ee5ba5
BLAKE2b-256 eb1e8e6721d28f9b6c2e981d0155e23b621b9927c8dde2981a2bc111ff3ec1bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.1.0-pp38-none-any.whl
  • Upload date:
  • Size: 958.4 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0-pp38-none-any.whl
Algorithm Hash digest
SHA256 3fa03bfef46bafd9e6334268b70230d97d8d80ed465982dcec424ef1776865a8
MD5 1203a69cddcb4ec91709e4f01a8e72c1
BLAKE2b-256 c0ed974b8120e918a20e86b90787f781c4bf152bd949a087bb1976d5f04cfe91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.1.0-cp311-none-any.whl
  • Upload date:
  • Size: 958.4 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0-cp311-none-any.whl
Algorithm Hash digest
SHA256 a3064e929c549ca4345aeb45c20fe547ddeb5899e19e7c24f65af7033de01f85
MD5 bdc346d7979af4d787e4c16cddd00eb6
BLAKE2b-256 a1bcee9154d41ca53a77b6f51d5d5875eb53992154f489ea0def1355405b29b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.1.0-cp310-none-any.whl
  • Upload date:
  • Size: 958.4 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0-cp310-none-any.whl
Algorithm Hash digest
SHA256 2599edf6630d576dc52699f051d23a6a76c1ffb53e6819afa1c419c3e11a1212
MD5 112f0f729095e7237cfe137c0db0a44d
BLAKE2b-256 d3c020dd4d6b664222b217e00e51399ad8c91aa4c7511d57438561fb60c8e085

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.1.0-cp39-none-any.whl
  • Upload date:
  • Size: 958.4 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0-cp39-none-any.whl
Algorithm Hash digest
SHA256 fd044c90a1d96d8c990d6a17963e805e3f668e8c609f9fb8dedaded2e9ad7774
MD5 41b1159ed9e1e19bfad892dcf2b88654
BLAKE2b-256 f8904dcf01f99b1cadaf3b59203ffbf47859b6c68d909c348fc93d04770cafc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.1.0-cp38-none-any.whl
  • Upload date:
  • Size: 958.4 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0-cp38-none-any.whl
Algorithm Hash digest
SHA256 935c30c2fb69ec773acc9c93b414e9ef8f6cad7383c529b12553cb6ff301a9a3
MD5 acde19e077fe9f8928a8b44feb662ea7
BLAKE2b-256 0febdd5a3d4785f6bbe810ebc6e463eae9d6e2d6fe87578a68d05726419f16d6

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