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.3.tar.gz (647.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.3-pp39-none-any.whl (949.6 kB view details)

Uploaded PyPy

pypcapkit-1.0.3-pp38-none-any.whl (949.6 kB view details)

Uploaded PyPy

pypcapkit-1.0.3-cp311-none-any.whl (949.6 kB view details)

Uploaded CPython 3.11

pypcapkit-1.0.3-cp310-none-any.whl (949.6 kB view details)

Uploaded CPython 3.10

pypcapkit-1.0.3-cp38-none-any.whl (949.6 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.0.3.tar.gz
Algorithm Hash digest
SHA256 753a97a436c8086703241bad383145d96f3e7e3713c6e6f2ac85b78fad0216c4
MD5 ab29d7f85a211cce0883e03bf57f10d9
BLAKE2b-256 1d712c6af78dd4a7df047e72d105bac883057fe65d22eeb213593a1c316cddd9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.0.3-pp39-none-any.whl
Algorithm Hash digest
SHA256 122f4133ae4193e26cf7a49093f075031fe3bb3db729d55887b14bb5a0811a32
MD5 383185e95ba1a2a8faec223969eeba80
BLAKE2b-256 f69975d2077469713de4667d678e735214c5bc2f77fc5ece376e4f8e2e84ff9d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.0.3-pp38-none-any.whl
Algorithm Hash digest
SHA256 dc0ddc0760d54238eb5c8029c4c13ad602afc57bc6950fcf9f3ed52a4a0d4058
MD5 4d8c22cda610d8345cc58fa7f5b97507
BLAKE2b-256 9efd466dda3180b802b5bdac114f3008ff05d156ac9441dda1c1ff1f17cadfa6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.0.3-cp311-none-any.whl
  • Upload date:
  • Size: 949.6 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.0.3-cp311-none-any.whl
Algorithm Hash digest
SHA256 fa806369d9039a56e183da0ea4c7b3cef34dbecc4e905d180c856183bea3c029
MD5 45e8c8a7690704a4093259959409e7e6
BLAKE2b-256 a0f1cd7f786e7a00c90b8720e8c7ace9082e67b9fe67f10ee03429b20b80e076

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.0.3-cp310-none-any.whl
  • Upload date:
  • Size: 949.6 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.0.3-cp310-none-any.whl
Algorithm Hash digest
SHA256 732203609cfc02259b1c14b12c006411f948311f87d854461657647d6c1b320a
MD5 805c043c162ce0cfc64a83208485f18a
BLAKE2b-256 6d178e47009e5782eab9a93b3473c2fae47fbc8b6ffc1ce2cf0630d128464da6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.0.3-cp38-none-any.whl
  • Upload date:
  • Size: 949.6 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.0.3-cp38-none-any.whl
Algorithm Hash digest
SHA256 d41681b51d0c16325a5302b56a2ce410686286f4c9e828439cdba1c53d715b70
MD5 9b05626795d3074eee478734d3722845
BLAKE2b-256 8db3fdf6a491af14725d2e39f1a95aca3ff69498130164f86d60c0b6724d5f5d

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