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.5.post5.tar.gz (671.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.5.post5-pp310-none-any.whl (976.4 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post5-pp39-none-any.whl (976.4 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post5-pp38-none-any.whl (976.3 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post5-cp313-none-any.whl (976.4 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.5.post5-cp311-none-any.whl (976.4 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.5.post5-cp310-none-any.whl (976.4 kB view details)

Uploaded CPython 3.10

File details

Details for the file pypcapkit-1.3.5.post5.tar.gz.

File metadata

  • Download URL: pypcapkit-1.3.5.post5.tar.gz
  • Upload date:
  • Size: 671.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pypcapkit-1.3.5.post5.tar.gz
Algorithm Hash digest
SHA256 17d1908c6661be22d1db9a7031c5ffcc3d8f91f93e0ac170fc9b381c39d18333
MD5 d01df30c7bf55198a250cc0e9d44000b
BLAKE2b-256 4608270e3ec27517a5a8bff06b95ce0ec419a830afb3cc982dbaaab4bd44c015

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post5-pp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post5-pp310-none-any.whl
Algorithm Hash digest
SHA256 f7b8103aaa76d731faf5409a62f1ac68c006f3731b2a85ba98f5884a0ddcc9fc
MD5 dcbb0d77c06b8170eb4bfc359d4bae9d
BLAKE2b-256 9e4accf1e78f5decff3c90e5936099979b38f7303316355020ba792f99f16a98

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post5-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post5-pp39-none-any.whl
Algorithm Hash digest
SHA256 920cd7d0a2d25a960386eff6bca6aa9f6d64b979f6a2b630b731c09cefa15b04
MD5 bf43bda62ff558ff03d919e8b6bcacac
BLAKE2b-256 ff443941fd7749628b2b7ba412bef4b104ffce131526e566f44aa0902fe4dc03

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post5-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post5-pp38-none-any.whl
Algorithm Hash digest
SHA256 fd8a0dad1daa47f4b8e028831a13e9a2f4596853f5478bb20eabad2a6b565c3d
MD5 3811ae3b199adbca50b79c51465d4e9e
BLAKE2b-256 5d545e4f4c4f0144206644de4ac0f354868831365e8dd1c443024c339ccdd8f8

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post5-cp313-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post5-cp313-none-any.whl
Algorithm Hash digest
SHA256 a55985ddb1b815c85f86a30b38796e06d00f89d3242b2ef97eadb75c6bf9c48c
MD5 06a6e65d80ae28aaef2f45f8c08ac4da
BLAKE2b-256 8f54f953c2f6063c31a4dd139ca4e2b4f92c314ff486fec05e7d914e5592dca3

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post5-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post5-cp311-none-any.whl
Algorithm Hash digest
SHA256 4b00ba6a99cc02050bda762100436506d3ee6e9c377d9e92bdad23c83df259b9
MD5 2a822632c9f7e52126214d849b938a1c
BLAKE2b-256 a5dbdaad1aa306360fc06f6c8346218dcc4f4362a2969552c625c8f4181e8c62

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post5-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post5-cp310-none-any.whl
Algorithm Hash digest
SHA256 70ca2c4d3ca59c14d43575f3ee1cb407993d4f5884de454e31d0f11402269c86
MD5 5b704d6399ff685bc31972e36bfbe548
BLAKE2b-256 1df468211d56403bd572cfbbbfa6b74307cb3c2e0ee8a8d2856266ccd5b779f7

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