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.2.2.tar.gz (663.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.2.2-pp39-none-any.whl (966.9 kB view details)

Uploaded PyPy

pypcapkit-1.2.2-pp38-none-any.whl (966.9 kB view details)

Uploaded PyPy

pypcapkit-1.2.2-cp310-none-any.whl (966.9 kB view details)

Uploaded CPython 3.10

pypcapkit-1.2.2-cp39-none-any.whl (966.9 kB view details)

Uploaded CPython 3.9

pypcapkit-1.2.2-cp38-none-any.whl (966.9 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.2.2.tar.gz
  • Upload date:
  • Size: 663.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.2.tar.gz
Algorithm Hash digest
SHA256 536e48f46dd5b247c93e49e83977fddae76db7869636d160fa3a8e798207d01f
MD5 51287b3c0cafd53fb0f3ca38f89ea472
BLAKE2b-256 9e6398192d6c7f39927014df64f863668b3edfbb4115140522430887ad83d835

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.2-pp39-none-any.whl
  • Upload date:
  • Size: 966.9 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.2-pp39-none-any.whl
Algorithm Hash digest
SHA256 09d92ec9251340b09dd986288197b3d0f6da26c4df8bd072f12ba76582fbdad1
MD5 e31b5589b582a3afbd120ebdd336d50c
BLAKE2b-256 8baa6d1ee8bb423c0a848ca2f5f1bfc4f2b0da5fc34c05f4a91be42f350d1bbf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.2-pp38-none-any.whl
  • Upload date:
  • Size: 966.9 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.2-pp38-none-any.whl
Algorithm Hash digest
SHA256 53389eb7533b3d1cc624ee65966e124b1a3a46098090422adf99f24bf0ad793f
MD5 416be84c817bc7d7db0e10d41ea5e819
BLAKE2b-256 ddf0b00a0c817ecbc657d406e667db5a782aa7901ebfd9d38857130f38fc705a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.2-cp310-none-any.whl
  • Upload date:
  • Size: 966.9 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.2-cp310-none-any.whl
Algorithm Hash digest
SHA256 c4c03e3f99cefcdceb4ff57ecf5c617f939bbc471e38d8263a5b17e214faa81b
MD5 04f5de3cbc2361dc6b036686b44caf21
BLAKE2b-256 c70c8b416fd0beb1d43b6306ea62303513286d8f0a6bd5ffba7b60e078f51f95

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.2-cp39-none-any.whl
  • Upload date:
  • Size: 966.9 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.2-cp39-none-any.whl
Algorithm Hash digest
SHA256 1a10f1d8679d60bc3c07ff78154c30241bb958730004f04ec6159f6ba673573a
MD5 4db67781ff37cd18170cbb6c9d3bef28
BLAKE2b-256 389e57d4e09b1a5f4d43dd7d88a2b2252926ee7c4713a675b8f588e88b5025c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.2-cp38-none-any.whl
  • Upload date:
  • Size: 966.9 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.2-cp38-none-any.whl
Algorithm Hash digest
SHA256 a1ce8b131b69dae9c85953a53b39aa1733cbb8e8c9f11bf7f16920dda60f7500
MD5 ceaac030151098a2ef92345b7be359f1
BLAKE2b-256 220cb508f972f330bb8919ddaaf398690098ffef58e2332508ff1997deaff5f9

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