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 is designed to be much more comprehensive, which means it is able to provide more detailed information about the packet, as well as a more Pythonic interface for users to interact with.

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

Project details


Release history Release notifications | RSS feed

This version

1.3.3

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.3.3.tar.gz (670.9 kB view details)

Uploaded Source

Built Distributions

pypcapkit-1.3.3-pp310-none-any.whl (975.5 kB view details)

Uploaded PyPy

pypcapkit-1.3.3-pp38-none-any.whl (975.5 kB view details)

Uploaded PyPy

pypcapkit-1.3.3-cp312-none-any.whl (975.5 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.3-cp311-none-any.whl (975.5 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.3-cp39-none-any.whl (975.5 kB view details)

Uploaded CPython 3.9

pypcapkit-1.3.3-cp38-none-any.whl (975.5 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.3.3.tar.gz
  • Upload date:
  • Size: 670.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.3.tar.gz
Algorithm Hash digest
SHA256 18618e3fba96cc76e04d64a5104cb448c641204d8be65846feb5afd36897c5ef
MD5 396350e1a6f17f7c0b6f55dcc603ae06
BLAKE2b-256 7f2db350f2b55231f2345aca4665d55dbb7b43ebdd9d0089f33ad0b43c7a83c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3.tar.gz:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

Details for the file pypcapkit-1.3.3-pp310-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.3-pp310-none-any.whl
  • Upload date:
  • Size: 975.5 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.3-pp310-none-any.whl
Algorithm Hash digest
SHA256 8b230c4fa706583f700ddf1be794db02cf0d98a3c5e28382fab2f1510c4dcf73
MD5 22a71fe3480e7473f343d550d477eb31
BLAKE2b-256 db0b4162ff420aa005acb14f3a915e080c8022e3e6611bb5dad09c526aba09cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3-pp310-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

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

File metadata

  • Download URL: pypcapkit-1.3.3-pp38-none-any.whl
  • Upload date:
  • Size: 975.5 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.3-pp38-none-any.whl
Algorithm Hash digest
SHA256 a146cbd160c31c66f7bd5d43f3490a348946de489fd127bedc47bb0d9bd324de
MD5 116611d385e496e0623ddbbc85aca581
BLAKE2b-256 90d0c39a60ffaa9fb036b7799b255d8abe4e4f259f1b2c3dba3ca1f47475f192

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3-pp38-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

Details for the file pypcapkit-1.3.3-cp312-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.3-cp312-none-any.whl
  • Upload date:
  • Size: 975.5 kB
  • Tags: CPython 3.12
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.3-cp312-none-any.whl
Algorithm Hash digest
SHA256 517a311f894b505cd3dfe252713d27b6af4d93cc7e42530cee3f5c132086c71e
MD5 8d1e459adba762c89a09e2d3c28b97d4
BLAKE2b-256 0cdd88aac68df5aaa201a67b7964e382672ad6ac6d983dcd56055646d64a4ee8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3-cp312-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

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

File metadata

  • Download URL: pypcapkit-1.3.3-cp311-none-any.whl
  • Upload date:
  • Size: 975.5 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.3-cp311-none-any.whl
Algorithm Hash digest
SHA256 f346c0c920fcf0af866d197c2fc69a73d6aab7223a9b32576ab85dd973920d65
MD5 1d59c4adc349e7890ac9b83e66108c8a
BLAKE2b-256 e71d972dc5a9414666f56c586f3202d494d7ec7cf52f156ed5374d4bb6c35046

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3-cp311-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

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

File metadata

  • Download URL: pypcapkit-1.3.3-cp39-none-any.whl
  • Upload date:
  • Size: 975.5 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.3-cp39-none-any.whl
Algorithm Hash digest
SHA256 63ddec0ff28e18dfca8926f83e379f4b84ad6e8fb994586de711f8d15f649785
MD5 43788a16e7daaedc02587841a80a4851
BLAKE2b-256 a427083a13df3394b3fba68ce7cc3f8a584a4e2f369dc4171649ceeca20d55bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3-cp39-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

File details

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

File metadata

  • Download URL: pypcapkit-1.3.3-cp38-none-any.whl
  • Upload date:
  • Size: 975.5 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.3-cp38-none-any.whl
Algorithm Hash digest
SHA256 9a800960456ead7fd9b2ed900168c1c4f7f11d871d37e373290f6cffc44d5814
MD5 a669e5303d3d089255667ac2e6979da4
BLAKE2b-256 41649da2180547fa89eb1e102d44f69066bd972171a61a338d2c666536ba0a83

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypcapkit-1.3.3-cp38-none-any.whl:

Publisher: create-release.yml on JarryShaw/PyPCAPKit

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page