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

Uploaded Source

Built Distributions

pypcapkit-1.3.3.post1-pp310-none-any.whl (975.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.3.post1-pp39-none-any.whl (975.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.3.post1-pp38-none-any.whl (975.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.3.post1-cp313-none-any.whl (975.6 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.3.post1-cp312-none-any.whl (975.6 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.3.post1-cp311-none-any.whl (975.6 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.3.post1-cp310-none-any.whl (975.6 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.3.post1-cp39-none-any.whl (975.6 kB view details)

Uploaded CPython 3.9

File details

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

File metadata

  • Download URL: pypcapkit-1.3.3.post1.tar.gz
  • Upload date:
  • Size: 671.0 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.3.post1.tar.gz
Algorithm Hash digest
SHA256 9d3844677db77af382de962d8254e103ad6a17b314347843f58614d0078b210d
MD5 c7454920cb044677ee34b2e7be88edd0
BLAKE2b-256 763f27243de1a84da87fcc4d635f003d0b73de9beac931973898bd59ff8887aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post1-pp310-none-any.whl
Algorithm Hash digest
SHA256 f3f4e5981d17af2ddeacfd4e037000bb1d1907a410396584f8be458aeb83a621
MD5 aa35b814c24d9d034be353f52b1af7fc
BLAKE2b-256 a9e0892a2a196eea1266f2565ab9f5eeecaf23d371d142ea5e6f56a062da8f00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post1-pp39-none-any.whl
Algorithm Hash digest
SHA256 15e7b6e68f915171b2dc4127051b7d7ab017e5d75b51bd00670218e2996b9226
MD5 f2d6f2875c71153836caf4c34c36a227
BLAKE2b-256 8c791c354e052060b92042e1dc1c49ff3f88b0ebd0529a1748d74c1653f8b54a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post1-pp38-none-any.whl
Algorithm Hash digest
SHA256 fb515e88625f60aa42805b1e7f383cc14331b0ef00a71ed5c40b4bdb428ff617
MD5 a723885cc0b97a5e1b46b14a77341906
BLAKE2b-256 5ff1a300484b4f5d30fd10cbac54d61622688a8c61a2dc46062ee695a0562325

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3.post1-pp38-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post1-cp313-none-any.whl
Algorithm Hash digest
SHA256 3a04b8091dbe7e8914ce97f7e166d9cf3387c4b51c13e1196fef6a294b4571ff
MD5 4a3b6e1ec320e9757772e47d7a30ea43
BLAKE2b-256 e1677b9dc78264f64862c16a6e1ee09a281dae5689e1e7ac127cbdf9000da4a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post1-cp312-none-any.whl
Algorithm Hash digest
SHA256 069165a39b0f41c2dc8fc7390644a7ee6e7d9e86c5fac1edf4cc91fa43dd6581
MD5 b2ef1a7c8d165f41edd28d467760d510
BLAKE2b-256 12a8f2dede174e3323ccd40b7964e52c9560c53b70a9fbd93e4d6beb38c7b742

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3.post1-cp312-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post1-cp311-none-any.whl
Algorithm Hash digest
SHA256 f03609f63492fdc44baa46b3330de7b7d465e66a48e2ab5b1d03099186f81053
MD5 497e0fa7db8d27f617be5a44ed9359b2
BLAKE2b-256 c1ed997b2a6fef62bdfa9ef7eefc7c85efd0507f512500503d8f77087855d03c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post1-cp310-none-any.whl
Algorithm Hash digest
SHA256 91f2936b22036b5a85c615a1b768fb6338b8ec8b6fadd081a3e0318cdb3424bf
MD5 d5e3bcdfde77cb3d138894eaca1f69cd
BLAKE2b-256 dde4f6a61eb3503ef4840a40abcea044f0ad7c088a69d70c2868a97a165875a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3.post1-cp310-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post1-cp39-none-any.whl
Algorithm Hash digest
SHA256 e849e78c7e04e6cfe8d834f7b2ed53e14ef7a7bf10bfb339035818135ee8401d
MD5 ee52cb0d1b325a1042f6fd7f0aade7b9
BLAKE2b-256 fdce1aabbb287cb9934b7f6e299f7f3b3857f72179994dbcd700389d3f753a90

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