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

Uploaded PyPy

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

Uploaded PyPy

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

Uploaded CPython 3.11

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

Uploaded CPython 3.10

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

Uploaded CPython 3.9

pypcapkit-1.0.2.post2-cp38-none-any.whl (733.8 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.0.2.post2.tar.gz
  • Upload date:
  • Size: 437.1 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.post2.tar.gz
Algorithm Hash digest
SHA256 dca84f47acf57fc47ec3969d47ca2ef9b81f62b6603dfdb5af49e78a69aa54a2
MD5 1f84843f9c89cd0e664fbceb20adfc7e
BLAKE2b-256 026a6613b4073959915875c635087282feff307a8b013b12490f5e5cbeb2047a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post2-pp39-none-any.whl
Algorithm Hash digest
SHA256 68b4630ed0358f026445917973b27bc9c91543c2869b925add2b57536fa1bb00
MD5 7fae1f07dbef60875d5a934d24d22ff4
BLAKE2b-256 d22cda4a1d93ed3a6c9f5a1b81bce4c21ecd5655be31077d27a2ebb32f3f81d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post2-pp38-none-any.whl
Algorithm Hash digest
SHA256 89b6774850836eabf196535a0ba0074e09d96418ee73f4531691af9955c4840d
MD5 3e2803cc44c256db7b596960dec7c873
BLAKE2b-256 e8abbdbc839c863fd07d17334f87d5abaea024b896c8166764e65671f4bb2c21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post2-cp311-none-any.whl
Algorithm Hash digest
SHA256 6c0e8742c92a4515595118efa20a70453bbf54dddddbfe117a51f8ef9b383a02
MD5 e4e241b4acaa9fe46c50bb5673086068
BLAKE2b-256 c8c073210c1e91ea6594c5a869eb0f897b3a2c75aa7fbab913ba466b7a1beee5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post2-cp310-none-any.whl
Algorithm Hash digest
SHA256 bcd6448d72146384d406ffbde0f48a24a50378c39cc611fc44861a555838c94f
MD5 36f9cce3e7a69d4d6cc5fff4c5c2b8f9
BLAKE2b-256 0c10bd7057fa34a7dfd83c5a9f26cdca37572a8a67e65386d43ff2a3fb3f113e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post2-cp39-none-any.whl
Algorithm Hash digest
SHA256 2e85cc3ea16ca5f7f96cc0c25f3d6edcfd65713be6e3fe0c42d798feda8a6f26
MD5 67633b094bfdda0f3ed284f1e4956983
BLAKE2b-256 df6cf6b54e324f0cc6e434af79e93d68660f584e2e108c4e36934e20b9dcc685

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post2-cp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post2-cp38-none-any.whl
Algorithm Hash digest
SHA256 fa51e2f8cec25fb9967ac745c2242bb000727a4e7c0bbf649e6749ec4c6a7e1c
MD5 48c136c2a3b7809e34617cdf94173bfe
BLAKE2b-256 241d1d2ec6b3e2668f26de46386a1882ec2071d9c814372105b017d392d76a3d

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