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.post34.tar.gz (669.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.3.5.post34-pp310-none-any.whl (973.9 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post34-pp39-none-any.whl (973.9 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post34-pp38-none-any.whl (973.8 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post34-cp313-none-any.whl (973.9 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.5.post34-cp310-none-any.whl (973.9 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.5.post34-cp39-none-any.whl (973.9 kB view details)

Uploaded CPython 3.9

File details

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

File metadata

  • Download URL: pypcapkit-1.3.5.post34.tar.gz
  • Upload date:
  • Size: 669.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pypcapkit-1.3.5.post34.tar.gz
Algorithm Hash digest
SHA256 3a8c9b362b13d6c12c73fa77d83a94e4b160337a6a56b8abe6e1b0c62bb1a245
MD5 b005e91ad1518b9e5d2880fc2e0f42e3
BLAKE2b-256 1153ecc45b632276eb71cacc047f8e06d494de4a8126dee30b77441ee9960a95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post34-pp310-none-any.whl
Algorithm Hash digest
SHA256 c00bd83f0d45add9797832f57660799916d37c3090b83973b1093bf84895115a
MD5 f70b3864f1aae69ec4d03116d59bc696
BLAKE2b-256 940b4aff40fa9f7ff4735d96d208e12e6853adc2a251f56c0dca28cc40317a50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post34-pp39-none-any.whl
Algorithm Hash digest
SHA256 a6ce97af67e805a71f44ba6f50cbc6eec9b9aa7ea0fbf7f675587a128f2598c5
MD5 4e36765d0c1a6cdcda25c2696800ad63
BLAKE2b-256 8e04409b4e73e201262faf8e52b86b2a910046f832543d468f6dbf5a7956359f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post34-pp38-none-any.whl
Algorithm Hash digest
SHA256 159b8b7fe8acdd895b1c2b7bdfc143afe386e806ec6c9a40cfeaed07665505e0
MD5 110b2f9740486c130d6b58f7ce59f3fb
BLAKE2b-256 943095e4b6c56570573593a875dc0b7b7e8670808f2c55fc1d9684e8034e201c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post34-cp313-none-any.whl
Algorithm Hash digest
SHA256 2e9932d0e337bf3d9b9df66613407a559954259fc481b94d5db05281d16d084b
MD5 1ce44efaed4286b9b5e440ef176ac21f
BLAKE2b-256 4e79d17ad8a5bbea61829f719a03636b94e3b2da786396777a36178e8388a533

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post34-cp310-none-any.whl
Algorithm Hash digest
SHA256 679605eff054ba2b390b698a35793736b1ed082ebbc306f352ab35ea753d1aad
MD5 929ff1f2f0c292ed81cbf286072ae88b
BLAKE2b-256 c02170c83d924dbceac1c7457adb3b55b704863f66aa746691beb97af1435917

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post34-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post34-cp39-none-any.whl
Algorithm Hash digest
SHA256 078986ca49a01ad84930211f7cd9a5a0533d1cd505971678c21b9b0d993c7c71
MD5 3083256e54d6e7685e04bb9db06f4246
BLAKE2b-256 277cbc71b50b83eb47fb77b81d5e6a236b96fff003c40b12afab4b8d38abca8f

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