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.post4.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.post4-pp39-none-any.whl (733.8 kB view details)

Uploaded PyPy

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

Uploaded PyPy

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

Uploaded CPython 3.11

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

Uploaded CPython 3.10

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

Uploaded CPython 3.9

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

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.0.2.post4.tar.gz
  • Upload date:
  • Size: 437.1 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.post4.tar.gz
Algorithm Hash digest
SHA256 808486227d3a1de1f4d0062abae2714bfee608af2e37ce34d066a35b4f7e4b34
MD5 5d6f73bc29cdc2dc7121efe89e469adb
BLAKE2b-256 0f0df285ddbe81d1639a4884a72607dced5c5b52018408a47c78171073ff1f9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post4-pp39-none-any.whl
Algorithm Hash digest
SHA256 539b3632817301197a202897cf1193cbaace2aca25d8b3510c4cb504d2523169
MD5 a77d20347afceb1c402aa47275481f11
BLAKE2b-256 be19e774f2bfd4549d35bcd25562049ec7f29362b8560b290e2b5599bafd1fbe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post4-pp38-none-any.whl
Algorithm Hash digest
SHA256 d85ad2b830841d97874ec6b9c92516c56c5b158ff1c2809ec4551c4f6fda8905
MD5 57e142dc00d2563e492aa86d7c9137f5
BLAKE2b-256 a55ee37b7e408a4d78d525e9b5294c95750ebd9d1cea08250c11b479a1b2cb37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post4-cp311-none-any.whl
Algorithm Hash digest
SHA256 a0e9899b1470b3e9e08d83de683318ab4145e168949867423716c09f70d04c8d
MD5 53090121129e328b47b6450c94080fa0
BLAKE2b-256 df79007c6ac753bfa260d69e4749554fbc305521c823d7092800d4abe67acef3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post4-cp310-none-any.whl
Algorithm Hash digest
SHA256 c20a69a12845cd5a985b09f04884b787133848822619e1444f0fa0c3b7bd939c
MD5 6a8e3d42bc20d7519256c38f30b3657c
BLAKE2b-256 950e78ec7d99892280f516b285b17c71afd9a2bf98c0ff746ed95c86e36bd2a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post4-cp39-none-any.whl
Algorithm Hash digest
SHA256 06122aa83a2f6861f505fa0d1597f6f5a543d11d6226ab320544de581a40012a
MD5 3f6b9701be6fd4af88e04b53e3d28e18
BLAKE2b-256 48ecf9874c01bbdcd97a8e29d453e35613c106068f38407b7d09839834146d87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.0.2.post4-cp38-none-any.whl
Algorithm Hash digest
SHA256 7c018d2df27db688e40796fc7bd950b7925048cb1a6a37c3dd6f95c7689b5071
MD5 d77b3c593623f38737b44870d8a2a860
BLAKE2b-256 fc1badd72170998af99ee53dcd5c91938de0aa0b1601ee466066a14fd244b6be

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