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

This version

1.3.0

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.0.tar.gz (669.0 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.3.0-pp39-none-any.whl (973.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.0-pp38-none-any.whl (973.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.0-cp311-none-any.whl (973.2 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.0-cp310-none-any.whl (973.2 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.0-cp39-none-any.whl (973.2 kB view details)

Uploaded CPython 3.9

pypcapkit-1.3.0-cp38-none-any.whl (973.2 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.0.tar.gz
Algorithm Hash digest
SHA256 69d9e3703902b5f95ff8fbe0fa9f28b8b5bda9933789fa0ca8fac5cdc90ae600
MD5 ff84e311bf83b6127d9dcc73cfd4de1a
BLAKE2b-256 966f037270ea213d1c3275d7ffbc8349772e345e348d5f1d4c649f742fdf4aa0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.0-pp39-none-any.whl
Algorithm Hash digest
SHA256 74695eeb1caba8d51e968984f9031a9faf89e32a6d6f3b1887ebb9493d9afc64
MD5 0d9ecad657a05f648da82e6f5a32ee09
BLAKE2b-256 c1ab173660a58186f5554e2e5c5f9b91787f82bf43f8095b9d928f9a2a379fb0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.0-pp38-none-any.whl
Algorithm Hash digest
SHA256 157c28d71ae4543587106053e4eaed0eaec567416e467e0aa5df1e781bc5ae47
MD5 440ff822eb006a093587d4700180afc3
BLAKE2b-256 61e6c3ceb794f4fde8e96c770595e743ac88e0cbe578217e7e7cc15f36059a8c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.0-cp311-none-any.whl
Algorithm Hash digest
SHA256 241fe2ce2572461a96373521c9e610696a65d497a21653b3971abe851f541fa7
MD5 46bf4a749272ac0ddabe87aa849f967b
BLAKE2b-256 495702fcb93176d082ae05828e62624989b38f62a585cd622c3d500f96b80ff0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.0-cp310-none-any.whl
Algorithm Hash digest
SHA256 33897efbb39e7c723ad64632211931b712306600cd38a482e963cd91dc3ead1f
MD5 61ae0fff83e0ef4cfc6822a43122e942
BLAKE2b-256 9ea9065ff7811656ab2ee2f064127db0c3d499efa44d4f5a639660bb53b256e6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.0-cp39-none-any.whl
Algorithm Hash digest
SHA256 55ad8d6c56c28cb99d4695243a8768a23d2d1c59106884e458c9bf15cc4586bc
MD5 2ed082dc3781bb12465b99fee4aaa0b1
BLAKE2b-256 600848995aa657e9fda4fb2320768b14f7a55ebbac49fefdd6704a48ffe78881

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.3.0-cp38-none-any.whl
Algorithm Hash digest
SHA256 141a5f022e5316d00a15f053ab024b38a4a8061ae8a0f522bbcf3ead8f94b7e1
MD5 0221d580af6792265a5350de9540e0b9
BLAKE2b-256 1e4310e37d3435f98a1f3c2c0273f0064a1717e596198b9ae3b9e63351f2a7ee

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