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.3.post2.tar.gz (650.3 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.3.post2-pp39-none-any.whl (952.7 kB view details)

Uploaded PyPy

pypcapkit-1.0.3.post2-pp38-none-any.whl (952.7 kB view details)

Uploaded PyPy

pypcapkit-1.0.3.post2-cp311-none-any.whl (952.7 kB view details)

Uploaded CPython 3.11

pypcapkit-1.0.3.post2-cp39-none-any.whl (952.7 kB view details)

Uploaded CPython 3.9

pypcapkit-1.0.3.post2-cp38-none-any.whl (952.7 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.0.3.post2.tar.gz
  • Upload date:
  • Size: 650.3 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.3.post2.tar.gz
Algorithm Hash digest
SHA256 b6b623baad55696c40d1dfbaec70d19a65bcf8ae23d224bc2e22f1e39b7e2e55
MD5 527305e66198802d1bec7f6b0e066e0c
BLAKE2b-256 915f2ade535df0bb1d6b3557035e24012f358b243e2f7499c6dcf95785209340

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.3.post2-pp39-none-any.whl
Algorithm Hash digest
SHA256 790598cb07ef8c2c061c4ab77d7005ff6cfb73869d871f129d261da1dd2063ac
MD5 232297707aa4e395f0ff4d4e90aa54f4
BLAKE2b-256 3e0a65d52f97a447dd27a8f03b9b390094be09701f1aea1860e4d6dea5314387

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.3.post2-pp38-none-any.whl
Algorithm Hash digest
SHA256 ecf0e17e1f8a137d4f3c659a66420108d3b01be942a4431ae6bc4ad63d92c976
MD5 5c10cf218d7a748ae3f9d9b75e78e238
BLAKE2b-256 3b36062ac00e67e153459c846a5f4e8a265541e7cc491429ad7550ada3f5fbe5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.3.post2-cp311-none-any.whl
Algorithm Hash digest
SHA256 fa3b9bc9b16b3393f53f61f8a099b393571baaf8ca0c73199379edadcb248610
MD5 1d48a90c5b5100e35359d494d222c2ef
BLAKE2b-256 811063c5876cca9c71fc380f6ad48f87f125ffb6619dad15d5143f748157388a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.3.post2-cp39-none-any.whl
Algorithm Hash digest
SHA256 367f3bce75bdc95b02ecd4fca67483645287db5150c7a3e8972fa811a3666429
MD5 255e8cc8da32fd3a40e1fb9963faf7e8
BLAKE2b-256 4df855d134dd6fd22febb1cadc86d74b7bea28ec54a2cad4307fe8c6f2fc3bb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.3.post2-cp38-none-any.whl
Algorithm Hash digest
SHA256 581115831233c1b8f7b27bbbed09cc38348ac73dc04d337f4e3f949030ebda1e
MD5 8586529c455a99765349ba5c95284c89
BLAKE2b-256 d1a87e293ea1b5a1f1b0b11b6d821f47b3c4db5634337a1c5561e214f991148a

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