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.post1.tar.gz (436.6 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.post1-pp39-none-any.whl (733.7 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post1-pp38-none-any.whl (733.7 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post1-pp37-none-any.whl (737.2 kB view details)

Uploaded PyPy

pypcapkit-1.0.2.post1-cp311-none-any.whl (733.7 kB view details)

Uploaded CPython 3.11

pypcapkit-1.0.2.post1-cp310-none-any.whl (733.7 kB view details)

Uploaded CPython 3.10

pypcapkit-1.0.2.post1-cp39-none-any.whl (733.7 kB view details)

Uploaded CPython 3.9

pypcapkit-1.0.2.post1-cp38-none-any.whl (733.7 kB view details)

Uploaded CPython 3.8

pypcapkit-1.0.2.post1-cp37-none-any.whl (737.2 kB view details)

Uploaded CPython 3.7

File details

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

File metadata

  • Download URL: pypcapkit-1.0.2.post1.tar.gz
  • Upload date:
  • Size: 436.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pypcapkit-1.0.2.post1.tar.gz
Algorithm Hash digest
SHA256 c723378e1130d86c0cec136c71437902928cd4df017d2ca31f5e51a59bc94819
MD5 523f717d9e313b55ae0abb0f2b11a3a8
BLAKE2b-256 3279ecee13f12ccd3086a53e34ab4e831745864e76c81a65b4d4a8af88bd0889

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post1-pp39-none-any.whl
Algorithm Hash digest
SHA256 83cc99de0a4a6889a1b0465045cc06aef5dc3a574d5c9375802ec2959a44a322
MD5 45e66f53b8a22956f9661d68ec0a3bcd
BLAKE2b-256 0754d4efb1c338c69bac05f56d34dda0c797a64b4f4a9eec20bc78fecbcc8ce7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post1-pp38-none-any.whl
Algorithm Hash digest
SHA256 48740183216aa548cfdfc55072bf1ec82b7698b0920bba7f2ad1b9bb0c3f81e7
MD5 b45d8654a1958d26fe1318a1a866f14b
BLAKE2b-256 b06d008c1b8a700a7f4fc8989d289d2d9c5f55c678e63f7e5b044666f0a7ca26

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post1-pp37-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post1-pp37-none-any.whl
Algorithm Hash digest
SHA256 6fab924e1e8782a8368b225245baa96a3e85f664958284e5b0aedd3b39a827f0
MD5 440e69ac67f821ef033c9163e5e31f2f
BLAKE2b-256 558c17af7712fdf0a08b80d02893d38969c69b59e00257c87134fb9fab43dc05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post1-cp311-none-any.whl
Algorithm Hash digest
SHA256 be41491220f4eee62359541f9e58bc7cc39419310aeb8aa80fde95a086c9fdad
MD5 5152f9e92630290496979de171300f7c
BLAKE2b-256 a5f0eb7170b5c63ed5f17463da5563d3c350275568de93e5ffb740a67bd74d80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post1-cp310-none-any.whl
Algorithm Hash digest
SHA256 c3d4148a93b6d8c3a203e33deea1f1cafc59ff310cc7ad44fafa01012f5946f9
MD5 acd44e3770684665e2e27e0d47e7dda2
BLAKE2b-256 dbb5d706cc7e5f6a4254fe5ab6b88dfe52c15bf919bb4203ccdf2ea7633b03da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post1-cp39-none-any.whl
Algorithm Hash digest
SHA256 35c94c25a608e11c8d18b33ae365f9d78f7e6f7b36b0e2a8b705777614723607
MD5 60a2f8f49cc8aa99e464cf2c0e496fab
BLAKE2b-256 810f30dca4af74ea2a381f5c593f814b51d97ad1e4f49a04baa4304c3f964f45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post1-cp38-none-any.whl
Algorithm Hash digest
SHA256 d34645a9fa71c5c6be8eca47c9b36d842377b34ece44820a338fa834137b85a7
MD5 0e2308f7a469ba911efeebdffb857b7a
BLAKE2b-256 8ff1a6b7c85d59bf0f07b0126315a485b61b386f6262b20126650073558a5f7d

See more details on using hashes here.

File details

Details for the file pypcapkit-1.0.2.post1-cp37-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post1-cp37-none-any.whl
Algorithm Hash digest
SHA256 f906af6ad4e6d1cc9f47101e8f9cb2a17ab347a2137b000144886351f1811835
MD5 3adfb636a26b994149b9ae2eda39e263
BLAKE2b-256 4094361bff85102ed40e2c724ffc989fa312b35011054c546a5f42b277fe9471

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