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 is designed to be much more comprehensive, which means it is able to provide more detailed information about the packet, as well as a more Pythonic interface for users to interact with.

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

Project details


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.3.1.post21.tar.gz (670.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.3.1.post21-pp310-none-any.whl (975.5 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post21-pp39-none-any.whl (975.5 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post21-pp38-none-any.whl (975.5 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post21-cp311-none-any.whl (975.5 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.1.post21-cp39-none-any.whl (975.5 kB view details)

Uploaded CPython 3.9

pypcapkit-1.3.1.post21-cp38-none-any.whl (975.5 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.3.1.post21.tar.gz.

File metadata

  • Download URL: pypcapkit-1.3.1.post21.tar.gz
  • Upload date:
  • Size: 670.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pypcapkit-1.3.1.post21.tar.gz
Algorithm Hash digest
SHA256 2448dcd857eff9e5b183f1755e11515a8b4d95840a35960e66c3d686e8415743
MD5 da0e1843e09d03339b070479723cacc8
BLAKE2b-256 d87e9362564d346b5eed2196ad152566b69249e1c76f90737720adaf0d982856

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post21-pp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post21-pp310-none-any.whl
Algorithm Hash digest
SHA256 2e935d5328d033cd4cc1bcc17340eeac82229f25522f35309c8b772137e3cfb0
MD5 395e298adff6be26d14396bed2693321
BLAKE2b-256 8bd08f4a572a0fc0ae6f375ee096a3102746b45b14fb953b4a954f80e17291e7

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post21-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post21-pp39-none-any.whl
Algorithm Hash digest
SHA256 6776e1c7fa9e72fcae45fa450f48eae60e90842adc0f7c0150f11445807eb8ce
MD5 0623c29efdda14c40170c3a94864e12f
BLAKE2b-256 8d8f6d152982b5d69da6b8fd90cb1f6a1a499541c8fe438465ce71c86ab7cde9

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post21-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post21-pp38-none-any.whl
Algorithm Hash digest
SHA256 9e22f7de9edf86d6c617c11243d60fbe4d7ae0198cfc896cbdec4f71cac1dca3
MD5 d1c10dccbfc9f06ce038d8216129f4da
BLAKE2b-256 27ff8718d1b6d8255aa0e8e25bc7da057047715e9f2e9d8c5bf71017cfda44b4

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post21-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post21-cp311-none-any.whl
Algorithm Hash digest
SHA256 ea72daf5e588f8db005f2b24e5a75fa4c08772495db52c27495e7c7922502f05
MD5 4ba69cb763bc749ab76380be9fe4a39b
BLAKE2b-256 64950f5ca17bbed1d2edecd4f8110625c4cf520aa5b3e19011606ad73caa8948

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post21-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post21-cp39-none-any.whl
Algorithm Hash digest
SHA256 bfdbbd671039c4e62e95774ca04ed031d2e21ccf9156f87ef83b3d2c56d09ed8
MD5 374e9b454058840a59d89f92bac908c2
BLAKE2b-256 9fca27381daec39e54799bb19bfc58f26b48dbac9d50709f088a04adb4c96439

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post21-cp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post21-cp38-none-any.whl
Algorithm Hash digest
SHA256 26dc8f227bf33658a47bd87691e4df3163229f0a0ca0fb8f2f61923868463e1a
MD5 84b18ae17b816394f9bf5a33c47be060
BLAKE2b-256 913330273a0b41634cebcc2390a555f9c5d7da2318ffe518926ae42184299a66

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