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.post28.tar.gz (668.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.post28-pp310-none-any.whl (973.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post28-pp39-none-any.whl (973.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post28-pp38-none-any.whl (973.6 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post28-cp313-none-any.whl (973.6 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.5.post28-cp312-none-any.whl (973.6 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.5.post28-cp311-none-any.whl (973.6 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.5.post28-cp310-none-any.whl (973.6 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.5.post28-cp39-none-any.whl (973.6 kB view details)

Uploaded CPython 3.9

File details

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

File metadata

  • Download URL: pypcapkit-1.3.5.post28.tar.gz
  • Upload date:
  • Size: 668.8 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.post28.tar.gz
Algorithm Hash digest
SHA256 dbaf6b9d77d1d3de959c383dcc1ee9828131842351e4676bb320b76bccf62ef2
MD5 99b8a3e5ce59117e2c8314777d5a9940
BLAKE2b-256 2cfa2d947d8d4168290f4c563ce053a15c467fa90cb93e2d39e6f265831623a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post28-pp310-none-any.whl
Algorithm Hash digest
SHA256 479aa5f52675da7831eb1353f7b5bcd5bd0ac36c78bc873c7b45a4a0f3d30a03
MD5 bd3ca757d50e7c77de327d091322750e
BLAKE2b-256 42112f7bd7527c115145763a6b8bbea5f019ae86dabc2b48b705eaf956a2f14d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post28-pp39-none-any.whl
Algorithm Hash digest
SHA256 f4f502d5924d24bd48adbefa0b30e71e126b8078a133a18f6734d07165e16974
MD5 99b27b90af3f773285ce9e51113756c2
BLAKE2b-256 dfff7d75f0b3437d1c95e67ed5b6f042da21087a05d7231f988108dc61ed5d57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post28-pp38-none-any.whl
Algorithm Hash digest
SHA256 a82401508bb6cfa5663439d8cd42a580247c0c702328c98b28fb434124b956e0
MD5 78ad9fe5f6241f455919903c84748bff
BLAKE2b-256 21e00b54a7a9caf77a40204011f38585d574aadc3bac7b5062fbec11b7185c8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post28-cp313-none-any.whl
Algorithm Hash digest
SHA256 4c5157cd70fd3f530a86c6ee485904df57b8397f20b14b9fb0303aa0b452dcbe
MD5 14d18441468ddfb334a4974967fe1d4f
BLAKE2b-256 c32a27c5c8efdf7db8cae86b915ef8eeeafb12e9f47b768b3711b9d607765fa3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post28-cp312-none-any.whl
Algorithm Hash digest
SHA256 a3e34e1886b3f277805ae3bb8d1effe20873bb8b5474ae5842c039c33addee48
MD5 b1ba15c6d8c9bbfba63f40b99d8540f2
BLAKE2b-256 e8c6c7cb13e0c2f00e46a61a6216348a9205046166bc708a86ee8d5280bf950a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post28-cp311-none-any.whl
Algorithm Hash digest
SHA256 7619f3989cf01264ec0a17268848c85d1e50964525fe366ea51abb5631eea484
MD5 f69fd6827f3f79a941d2933f0bcddea9
BLAKE2b-256 e3a80e8caa252fab2e756f7065b00ea5d566c4e0ae7b75fd5f68ac2fb4357a01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post28-cp310-none-any.whl
Algorithm Hash digest
SHA256 0c13680ccb530879bee4cc1467d57541ea530b3d754e2a4be1a495840904b30e
MD5 702ec9a04b47d013c59cf3bb4727fb75
BLAKE2b-256 7478aacbae607e0005ee01c49912b48943899172a6696f44df975e3ac9d59241

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post28-cp39-none-any.whl
Algorithm Hash digest
SHA256 269e2da2671fa61a8172ac5d1e90321e8eeedda6deeeb989df14064c54c2325f
MD5 5760610bbfcdf47cad2a93745219dfed
BLAKE2b-256 cbb80d499da3a2cd5c5bd90f8523f1a80179fe4cc6ab4edcf9e33ad1c8360a64

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