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

Uploaded PyPy

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

Uploaded PyPy

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

Uploaded CPython 3.11

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

Uploaded CPython 3.10

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

Uploaded CPython 3.9

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

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.0.2.post6.tar.gz
  • Upload date:
  • Size: 437.1 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.post6.tar.gz
Algorithm Hash digest
SHA256 e0a6eaddf36ccba8e16d15f98cf57f5843fe34e3476e924277aedf96dc0ab941
MD5 06b69a10ef13a8b86895abe8d7177227
BLAKE2b-256 75abf388663194857bbd9bcddd1cde716db6111f98e343dd5bb29646fce16537

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post6-pp39-none-any.whl
Algorithm Hash digest
SHA256 798be02825bca72c4da848d3bd794198a3cfd79b3889614d6df434fad6169183
MD5 2b1670dad8c76a0ce3dc92603bdc2c2d
BLAKE2b-256 f603dd9f5505da7b8c49cb74d3284a9c033d0ebd6bb4f3fb99b902a013b5b266

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post6-pp38-none-any.whl
Algorithm Hash digest
SHA256 14190975dcfc6784e4b09c56cb2c97d3d646d75f19dc42ab16d009f9fa7f6b26
MD5 f8158cf43896f4b2c192947e6a3fa697
BLAKE2b-256 4df402177d2d0941214e252a863a33ac94b20199aba66c6b96f6184913497650

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post6-cp311-none-any.whl
Algorithm Hash digest
SHA256 1515fb0447f328c086bf05c871d14c4db7c755579dfa76b365ca523922732090
MD5 60b1a1a8a7e129593b62bc3336aa7b95
BLAKE2b-256 81c37637d41996f88e18f80d3f730786627155aad28df7e7a4fbfc8c69945281

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post6-cp310-none-any.whl
Algorithm Hash digest
SHA256 e766b4e7958f9fbf1f55fc8ceca9f288bc517c2dd444f8a7182165fa70dfd074
MD5 84d1c311501cbd45f21f5d7938ac45b2
BLAKE2b-256 9f2eb580623bb76f99c54a1df8323d1f8e1e2c63a39143a3f60f32bf072a5e4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post6-cp39-none-any.whl
Algorithm Hash digest
SHA256 287603f18a54e8aedf5b63735e358aaf1a9882a6718a411a86f245bc1e50b1dd
MD5 108e9bcbddc74f48fbea2e2d75b1e8be
BLAKE2b-256 5d548ed77a7c94d10ba8a77ca8e9d82fb8470df722426d1458c995c24cf7fb69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post6-cp38-none-any.whl
Algorithm Hash digest
SHA256 e724f4fb16f45ac0f17424a9c07f0e3410ac7734e382c5a3230770397a585d73
MD5 7cbedefca08a369b06e47f57a02b45b7
BLAKE2b-256 6590366f6a5af3dc52ff4af0cd10fce7c8bae8b9266fd8a09a5cc2c0977a449a

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