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.post1.tar.gz (671.9 kB view details)

Uploaded Source

Built Distributions

pypcapkit-1.3.5.post1-pp310-none-any.whl (976.4 kB view details)

Uploaded PyPy

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

Uploaded PyPy

pypcapkit-1.3.5.post1-pp38-none-any.whl (976.4 kB view details)

Uploaded PyPy

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

Uploaded CPython 3.13

pypcapkit-1.3.5.post1-cp312-none-any.whl (976.4 kB view details)

Uploaded CPython 3.12

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

Uploaded CPython 3.11

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

Uploaded CPython 3.10

pypcapkit-1.3.5.post1-cp39-none-any.whl (976.4 kB view details)

Uploaded CPython 3.9

File details

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

File metadata

  • Download URL: pypcapkit-1.3.5.post1.tar.gz
  • Upload date:
  • Size: 671.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5.post1.tar.gz
Algorithm Hash digest
SHA256 9a85d4583fee4c318db269907ba18d54781f203c438b53f297fd70a7b03ad8f8
MD5 4c988bac438e031eb9ec2c57448c3813
BLAKE2b-256 eebe63927680ca7287d221fecc7e311e6c2d7d15bc204c2ccd9f566e7d0ef57b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post1-pp310-none-any.whl
Algorithm Hash digest
SHA256 098a0acb6111842b648cef297e246504b4dcd78d5cfb214001a55d904645df0a
MD5 1eaf9751646f246c984c66351b0de493
BLAKE2b-256 6923d8c853c314d4336c14cdb102f4ab7701a05093dc621a49a66aebc020ec61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post1-pp39-none-any.whl
Algorithm Hash digest
SHA256 9a267e1ab85ca481b764932b729831a93f43280f41460edfe83ed7e57dd79a3c
MD5 bbf9f7708257a487e5d68be6d0f44b4f
BLAKE2b-256 75f9bdef36077ad47b798806ee481e9c79d016e547fdf6eef852da37b9beb4dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post1-pp38-none-any.whl
Algorithm Hash digest
SHA256 cd17583849d1b1e502071c410509328caae9dada229051aa688456f11f0a31ee
MD5 cf977c880ef90b968564e0f6ebbf0072
BLAKE2b-256 5de82768603f632a0e8b913f8a5102e90517ba723fa0ad7867a933a47d3e4347

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post1-cp313-none-any.whl
Algorithm Hash digest
SHA256 25a4c0044e07bf9d5fe4c6281ffea04907e0fd59f650c569fa6cbb4b7fb281c2
MD5 eda22d8a7e966ac8c951d41e4d55cce2
BLAKE2b-256 efe8c1ea7f50debf0808ea236c788626a636b89f4d626e3d27765cf985c97282

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post1-cp312-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post1-cp312-none-any.whl
Algorithm Hash digest
SHA256 723577ed5d6ce8f2c86540883544635994f08e948ee8441a6a376dec542b5f5b
MD5 482636f2044fdb8a930665cedfa7ddd5
BLAKE2b-256 3776f3a8da7d1546826df872e65c23c436d751cfc3f705e18b98d1312c15abc7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post1-cp311-none-any.whl
Algorithm Hash digest
SHA256 95c9481e09e2689a7d5359bd3c0bb3d77b3600ce9559164e4e0ac7259d0797cb
MD5 7f6ced6204bcdaa8add5309fc02f609f
BLAKE2b-256 53c29603ea6990b645c17f0b780844492675a83856da92fee4fe454c89bf3afd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post1-cp310-none-any.whl
Algorithm Hash digest
SHA256 7e9e87a50dc79655d444849dbba3b90cc40212b9c7f66d2ed02832b27baaceff
MD5 d62d9a65a81bb8535ec20b6039728e25
BLAKE2b-256 c093f604c52bd1054cdb93d8a40cc92f56e9b1a2d2bb03affad921add6abfd30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post1-cp39-none-any.whl
Algorithm Hash digest
SHA256 fdef11d39c7d0fb0cb36fd539336670f3d2d2e959fccf79b72c8f9638e2ad9bb
MD5 48eaa69cfc1c00061885528c732f32d9
BLAKE2b-256 483f90da56cb3b51a84775aa881bafaf50bbf3422561cc5071b794a018280a63

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page