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

Uploaded PyPy

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

Uploaded PyPy

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

Uploaded CPython 3.11

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

Uploaded CPython 3.10

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

Uploaded CPython 3.9

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

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.1.1.post2.tar.gz
  • Upload date:
  • Size: 657.1 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.post2.tar.gz
Algorithm Hash digest
SHA256 783b052f16dd267981075faf312bd6586cee9adcab9034a6ab8044dc9a62eeb6
MD5 6db1a899e62f984cff04f18f2ad948ed
BLAKE2b-256 f4a3e0b32554b9709232ba7a94be994869f45aab92192f8aaf79caf21f6000e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post2-pp39-none-any.whl
Algorithm Hash digest
SHA256 f6852f492bec5e4240f1f5753625a1894f96214341ced02ce992f97bc37c0d03
MD5 26c2a202dde1e4a0ffd09e8d2dcab80e
BLAKE2b-256 ff1d4af52dcbe771995f1dab228906fc8b8d3825cb9e01d62c3329cff53ec4c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post2-pp38-none-any.whl
Algorithm Hash digest
SHA256 43a854d4980a927d9e38c31ad7334b7890c8762d2f1a90ce99d468fecc4afd71
MD5 a5857cc650869d455e3f526c93c2e517
BLAKE2b-256 fba9319b92d46e78bf4df4e9231355f74ddfdedb26c46fe99cdf313f762c03b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post2-cp311-none-any.whl
Algorithm Hash digest
SHA256 8645d09b92c33762c657f97345e29d88fa54adc6649717471a6cef1316cc4a4f
MD5 64087a8f1e602ab29cba0fd446a1b437
BLAKE2b-256 af31f8fc47a979528fc90bc9f6b23b6dab82b817fbd3a2e217dbca8cf940f0aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post2-cp310-none-any.whl
Algorithm Hash digest
SHA256 eba811abdd7effacde766cf8a9105b6b98e5c7adcb5096e9407f18d4a495d822
MD5 56d9823347477d6356e29eb0fd8f410e
BLAKE2b-256 9d73c716aad789e2da5c07f13c8e30708affe845fb1d284f901440df2860321f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post2-cp39-none-any.whl
Algorithm Hash digest
SHA256 5e5888a7373182a626cf750923277cad035477442e5d8edf6fa41acd54b89b56
MD5 e430bbd86549c8238bb1d8f5400dc84d
BLAKE2b-256 4a505fde050a7c668213120d933a63a385688522174fbcc5b10a81410ab51690

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.1.post2-cp38-none-any.whl
Algorithm Hash digest
SHA256 c0b624c43f80733d49ea2e62ae6989c07a97b6e3dbdb31cb4277fcf5bf53ff73
MD5 943897e66a1f47f64ec339b8cefb2477
BLAKE2b-256 606be9e565d0076cbcfffe45ff0f356f94754118790ae35495bfe7a793266ca4

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