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.1.1.tar.gz (655.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.1.1-pp39-none-any.whl (958.8 kB view details)

Uploaded PyPy

pypcapkit-1.1.1-pp38-none-any.whl (958.8 kB view details)

Uploaded PyPy

pypcapkit-1.1.1-cp311-none-any.whl (958.8 kB view details)

Uploaded CPython 3.11

pypcapkit-1.1.1-cp310-none-any.whl (958.8 kB view details)

Uploaded CPython 3.10

pypcapkit-1.1.1-cp39-none-any.whl (958.8 kB view details)

Uploaded CPython 3.9

pypcapkit-1.1.1-cp38-none-any.whl (958.8 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.1.1.tar.gz.

File metadata

  • Download URL: pypcapkit-1.1.1.tar.gz
  • Upload date:
  • Size: 655.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.1.tar.gz
Algorithm Hash digest
SHA256 7e47ceb08cbd4de1b73f9f6c4b68dee33b830e087f8df76f427732691e82f094
MD5 88293d5aef1d8e50d543be44d8469bbe
BLAKE2b-256 504f22d8d4a3a0199b4ceda275ae5472c1167d905cbfb41a16b541770ec5c506

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1-pp39-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.1.1-pp39-none-any.whl
  • Upload date:
  • Size: 958.8 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.1-pp39-none-any.whl
Algorithm Hash digest
SHA256 e76bf155e0da6918fccf107a5d3ff3bd2a832ad49c5abbdd4a54341eb4b2ce7a
MD5 fcc47732f39ce12c322a2a152a301f6d
BLAKE2b-256 3db000fb9a14d1433affd3097f3b554168197495826a1d99304bd4d740e5b783

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1-pp38-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.1.1-pp38-none-any.whl
  • Upload date:
  • Size: 958.8 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.1-pp38-none-any.whl
Algorithm Hash digest
SHA256 8ae64968965ac1c909200f5a3c109531952bbe69988508d190f5f05d49f53630
MD5 6d83beeaf9bc984ab896b4798e8d198e
BLAKE2b-256 cf1559530d30ef0874068f40a0823bf2add3aa5d38b8428c79f63edc03097b0d

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1-cp311-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.1.1-cp311-none-any.whl
  • Upload date:
  • Size: 958.8 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.1-cp311-none-any.whl
Algorithm Hash digest
SHA256 2bf86efc03bc18c5f1e8e0532e92cff6ea492e95f11df50c4210d6f2e28ff859
MD5 716b484e86a2b1cd88b98c015ea2655a
BLAKE2b-256 3158b6edfed9ecea2f8fb80fc4eb5b66cf2d9464b5a06377b06d705295741886

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1-cp310-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.1.1-cp310-none-any.whl
  • Upload date:
  • Size: 958.8 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.1-cp310-none-any.whl
Algorithm Hash digest
SHA256 88d7b4abce459d834d929719165ab8ae1d6d84a07833fcae0c9265987bb4f7b7
MD5 cb75dc940e6a9e1e8f2cc6760df5a9e5
BLAKE2b-256 9ecb38253a2302ea4b6deae0f410b9d0b2a951be4be3c46ffac9360d16f9daca

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1-cp39-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.1.1-cp39-none-any.whl
  • Upload date:
  • Size: 958.8 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.1-cp39-none-any.whl
Algorithm Hash digest
SHA256 0103fe8e81aff7bd593db20787042dd0079b9008ad06a11252c44f2cf681b70f
MD5 5b0e684b0a28948961746240da964262
BLAKE2b-256 9b0a3a8b46618077c01afaaad0976030d3166f4b54794aee399c06d3ed636830

See more details on using hashes here.

File details

Details for the file pypcapkit-1.1.1-cp38-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.1.1-cp38-none-any.whl
  • Upload date:
  • Size: 958.8 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.1-cp38-none-any.whl
Algorithm Hash digest
SHA256 a130551095742a067bdeaeb44a0e8bc85a7ceb1219e73b51a2c02da429fc2a90
MD5 c33d189cfee0f2cf63e1f2605a087aca
BLAKE2b-256 480fa90deb01115202f729fff3694f4af8a71c297edbb7d1bff542ff7870f811

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