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 uses streaming strategy to read input files. That is to read frame by frame, decrease occupation on memory, as well as enhance efficiency in some way.

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 Beta (22F5037d)

Chip

Apple M2 Pro

Memory

16 GB

Test Results

Engine

Performance (ms per packet)

dpkt

0.010694_027361

scapy

0.093399_399399

pcapkit

0.199796_296296

pyshark

25.066692_025359

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

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.0.2.post7.tar.gz (437.2 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.0.2.post7-pp39-none-any.whl (733.8 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post7-pp38-none-any.whl (733.8 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post7-cp311-none-any.whl (733.8 kB view details)

Uploaded CPython 3.11

pypcapkit-1.0.2.post7-cp310-none-any.whl (733.8 kB view details)

Uploaded CPython 3.10

pypcapkit-1.0.2.post7-cp39-none-any.whl (733.8 kB view details)

Uploaded CPython 3.9

pypcapkit-1.0.2.post7-cp38-none-any.whl (733.8 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.0.2.post7.tar.gz.

File metadata

  • Download URL: pypcapkit-1.0.2.post7.tar.gz
  • Upload date:
  • Size: 437.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.0.2.post7.tar.gz
Algorithm Hash digest
SHA256 40bb6bf7f7a653fc3e572f740c8691eb0e811c9e337a3bfa3f14c5adadc4ec9b
MD5 5fb1c045c52149d5f572d782a1174d3b
BLAKE2b-256 06948a3b932897a0df9945d693f2613f1f7e10ac36c9316ca44eba428794fe23

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post7-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post7-pp39-none-any.whl
Algorithm Hash digest
SHA256 9c81ff9b94b395829d4ea4abbb4f5d52ecdc61b859f60baffe2985538ff92c23
MD5 a40c58e30848c7b89e504971d4934dae
BLAKE2b-256 0fd83d9242e4a46caf600f23dbf107ddc7a328517ad76a99de76c926a8ac27fc

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post7-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post7-pp38-none-any.whl
Algorithm Hash digest
SHA256 244b2151d5cd39359c8e463bb6e1b1686abe3020ff967fb66e11be20a2742bc4
MD5 96e595b7765cac2aef60152768d5cce5
BLAKE2b-256 dda5f6eb7e7be10c3b763556256dcf1df37f239b0c178e9496f39dce747f6a29

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post7-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post7-cp311-none-any.whl
Algorithm Hash digest
SHA256 f244cccaf34e581852094583774e33ee6f9df33ae21f72a296701816a46d00e8
MD5 0313461b711c6060e2aada5c31bbdf72
BLAKE2b-256 f37554d077e6e5023925a753b746d486308448a1527d24248504f3cbf2a7dd2c

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post7-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post7-cp310-none-any.whl
Algorithm Hash digest
SHA256 549d974c8186e53aa964e8162d52b66939c8cb96b9add075139c32bfca220426
MD5 9d346ab7600b00aa74b17d2dc136fa1d
BLAKE2b-256 97ac65df6deb07a0d10a120c956fea40a02d183c5acb0ed8a81a78f3366b1f3b

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post7-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post7-cp39-none-any.whl
Algorithm Hash digest
SHA256 0ddc4c66fc60ecf668efb94e26ad5ba1e6fa6c40d5b46941e57d0432493936d4
MD5 45219fca91acd7e53758098fbe6fc4d7
BLAKE2b-256 f69e671cde7be3b148a8d2c4a76c37dabd57c58ed0b8ea84b24e434333a03ade

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post7-cp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post7-cp38-none-any.whl
Algorithm Hash digest
SHA256 d71ed64696b84b351a429a53aaeebd4f31ce82f17bd5703fe967922151355e2f
MD5 79d5464f8d442167532563cf2efa745e
BLAKE2b-256 74341d87e85d8f98e1970e8743002ff8ca8d1720a329bd491fcb772e6901714b

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