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.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

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.2.1.post2.tar.gz (663.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.2.1.post2-pp39-none-any.whl (967.0 kB view details)

Uploaded PyPy

pypcapkit-1.2.1.post2-pp38-none-any.whl (967.0 kB view details)

Uploaded PyPy

pypcapkit-1.2.1.post2-cp311-none-any.whl (967.0 kB view details)

Uploaded CPython 3.11

pypcapkit-1.2.1.post2-cp310-none-any.whl (967.0 kB view details)

Uploaded CPython 3.10

pypcapkit-1.2.1.post2-cp39-none-any.whl (967.0 kB view details)

Uploaded CPython 3.9

pypcapkit-1.2.1.post2-cp38-none-any.whl (967.0 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.2.1.post2.tar.gz.

File metadata

  • Download URL: pypcapkit-1.2.1.post2.tar.gz
  • Upload date:
  • Size: 663.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.1.post2.tar.gz
Algorithm Hash digest
SHA256 ec7872849d625bff30a9c8a01a4b734fa6dcb44223031a721cc69f6347bf7d12
MD5 a4e37d8d2f0d13b763c97f04540365e0
BLAKE2b-256 badb27089107d42efec50eff28cfb9634ec2d82e42d09a9e28d8d34550ab437a

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post2-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post2-pp39-none-any.whl
Algorithm Hash digest
SHA256 0acddb8770a43c7e87401aa002e08bd7d5ed7b6cf19152070fd267c488702ef6
MD5 a76ab5ead3707128942e070a2146cc05
BLAKE2b-256 b3ef5db54ddfa619b2165d90d49270039cde9850078b267cc729c9d2c3d188fd

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post2-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post2-pp38-none-any.whl
Algorithm Hash digest
SHA256 0972833184b49684c13807d28b0823363489c30e3cef8fcf0c16f85e9c9e93a6
MD5 0ac8b61ae6370f0278000473023c19fc
BLAKE2b-256 1b20402b39184e364309c0a1bb963b3b0b823627a570bccd67e8373e5f3e8b49

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post2-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post2-cp311-none-any.whl
Algorithm Hash digest
SHA256 893e19ee50a18db8bc037fcf1ad2a1db63944d0667b1eec21934b462bcfd13ef
MD5 b258e684b920b251801716f69b38819c
BLAKE2b-256 c2581ec2b76447b8e8f42a541d61dbef55670678d721d3d2a327548db0c5b191

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post2-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post2-cp310-none-any.whl
Algorithm Hash digest
SHA256 0671d486b47ba8dbc80caafd5276f850a4ff8c1bbc386abd4b94240f29767c64
MD5 58b3ccbf0beafa96e4f8bba603ef0a6b
BLAKE2b-256 f6d6dbf9ad563e80bf3b2a5854298abbfab883e9cb21aa66a0b672081263a552

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post2-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post2-cp39-none-any.whl
Algorithm Hash digest
SHA256 7836132703456a0250c7943e985e37decd1cf7bb62e2222db2584a7140ad7cea
MD5 2c3d07d40867a9c78664a5eb2cc831a8
BLAKE2b-256 3320e96e689c172351633103c4e46f49e31b93c32a82ddc8b28c4ec0a29e825f

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post2-cp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post2-cp38-none-any.whl
Algorithm Hash digest
SHA256 43e212388f156841734c3002460de19de5b73a8ee3a4783b36e7b7b02b2816ae
MD5 1ed27ed080d8e1cf13958487cb1226cd
BLAKE2b-256 17176157a2d748450c710006139a39d3382ca55091c2790fc313863d006b7d07

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