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

Uploaded Source

Built Distributions

pypcapkit-1.3.1.post28-pp310-none-any.whl (975.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post28-pp39-none-any.whl (975.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post28-pp38-none-any.whl (975.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.post28-cp312-none-any.whl (975.6 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.1.post28-cp311-none-any.whl (975.6 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.1.post28-cp310-none-any.whl (975.6 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.1.post28-cp39-none-any.whl (975.6 kB view details)

Uploaded CPython 3.9

pypcapkit-1.3.1.post28-cp38-none-any.whl (975.6 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.3.1.post28.tar.gz
  • Upload date:
  • Size: 670.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.1.post28.tar.gz
Algorithm Hash digest
SHA256 ed4ce34c3b8d833eeeab87afe3701f59472c99cfdc33b6ea513ff63bb66493ae
MD5 175ad548689066254986da814842a8fc
BLAKE2b-256 ce884b30dab53e07ca0a894b38f1718e67c87ce67ebc1277a8453d443405312e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post28-pp310-none-any.whl
Algorithm Hash digest
SHA256 680cd15d1c8faf766c84ebb47e0778e3af72395bbd04789ba0dc1811f272f285
MD5 e8c7ac6f87dbceb0bb7e33750460ba0c
BLAKE2b-256 0574102c45d772733a51c0325ee780f9a60411de8c3f9d872ac226d247bbc562

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post28-pp39-none-any.whl
Algorithm Hash digest
SHA256 1f30fd0aefa4ecbee00cd3256af20e365dbf85077f67a3efd8afc60a207fe88c
MD5 e7e82ab1480de624b52a08ab7b694a7a
BLAKE2b-256 fa01b76ec8f1053fcbdc3c3cea38976e235f42ec976cacbdf30e1dcaa4d3b787

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post28-pp38-none-any.whl
Algorithm Hash digest
SHA256 3cb856907a63f7237272eb9aae4050a9d5739f2e1993a96393f8a80c1343e47f
MD5 7bb23f016597628abf6667209f82812c
BLAKE2b-256 b40af1d00f956aeb2bd884888caf40d38829be9ee16837304e9ca668464c483c

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post28-cp312-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post28-cp312-none-any.whl
Algorithm Hash digest
SHA256 943f0c54bd2500c2d4a54f753ebeb59cfa44cb1d29e04dd1144b97eb1b9e5a68
MD5 2b05145e4a4e71f316f31878b02da262
BLAKE2b-256 eacf088bcf5b228d409c3ac92b4f7cbf2462e3d2580fc5f6608fcf7fa4103467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post28-cp311-none-any.whl
Algorithm Hash digest
SHA256 dee314ed53421c776973ec5aeb39c0d79552b85bece0027b2df8dbda248e66b8
MD5 b4fd432ab4f39f34516f1bca8314341e
BLAKE2b-256 e7795d43cc17b88c9660d7088ec3d8cbde9260657f14683c71e972fc695ebb05

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.post28-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post28-cp310-none-any.whl
Algorithm Hash digest
SHA256 8d75de8ce4cea87ef95e867ec2bf494c1b8964e00a39ccdcccdc22172f0398e3
MD5 11eedd79354b8191eaabe0031d9df3e2
BLAKE2b-256 d39a66d7bae4cd8b0d1be550ed4bf4f99e5ce8bdb7315e8a0c0c33bfbd7954ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post28-cp39-none-any.whl
Algorithm Hash digest
SHA256 8722f2131e4d90475433d049c8d635a9750339ba4a821d7e6f8afa39d29166a1
MD5 15b32d8b6c5757135c70f4fae1580eb6
BLAKE2b-256 4975e0a36340e9637739cd58d0cba9ccc96425f520e3ae92905b632c661d14f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.1.post28-cp38-none-any.whl
Algorithm Hash digest
SHA256 bbe44716c8a8a72cd6fb2f62f665904bd131fc0c3f14adabd144c8dabae996fd
MD5 1845c4bc5a75fa2a289cf9cbc81d8f52
BLAKE2b-256 a9258e4e129aca546d4ce4f135b6fa0fb04929beb7f1c751b235c95e8b8b4706

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