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

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.5.post6.tar.gz (672.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.5.post6-pp310-none-any.whl (976.4 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post6-pp39-none-any.whl (976.4 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post6-pp38-none-any.whl (976.4 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post6-cp313-none-any.whl (976.4 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.5.post6-cp312-none-any.whl (976.4 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.5.post6-cp311-none-any.whl (976.4 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.5.post6-cp310-none-any.whl (976.4 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.5.post6-cp39-none-any.whl (976.4 kB view details)

Uploaded CPython 3.9

File details

Details for the file pypcapkit-1.3.5.post6.tar.gz.

File metadata

  • Download URL: pypcapkit-1.3.5.post6.tar.gz
  • Upload date:
  • Size: 672.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pypcapkit-1.3.5.post6.tar.gz
Algorithm Hash digest
SHA256 11180931f16ddd1ba36300a2d3eec3f1cc6a53c8832764bb672db3d28ee5c059
MD5 e060e02beffbeb8265a29758deaa16cb
BLAKE2b-256 1eabf26b4ea56da367b2093327c64d58bdd1a535181ef7bc11a1c5c9e838359d

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post6-pp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post6-pp310-none-any.whl
Algorithm Hash digest
SHA256 0881d7719c58cae28ef91baa0125f2d1e895b7e01947c4f5f06c38d8dfb79fa4
MD5 c303997680a2a08df9a37d0781b64929
BLAKE2b-256 0d5371554cbe889c96b95619f5d99ed5a4fc0e70fbc45dad280ccc8425a1ffb5

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post6-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post6-pp39-none-any.whl
Algorithm Hash digest
SHA256 11ffdd392e44b52c56382e3f641e8b7b538bf4a690fce21be1448845f3e2210a
MD5 99d216b95984169fe73ee46d5e106a40
BLAKE2b-256 f678ac34d52e8f23fa24d3eee81401869fe4c602f769f65752e8ca770625e476

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post6-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post6-pp38-none-any.whl
Algorithm Hash digest
SHA256 e72bee0a6211c9142654a04d0ff1d02bc88b63ba295e50ee323f57d5a9966787
MD5 e4ee80e6886b4b4527bc47590ad10845
BLAKE2b-256 7ec67ffb8f98d98a5bf59de443acdd551ba511a2db80f9128c690295219e6ca3

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post6-cp313-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post6-cp313-none-any.whl
Algorithm Hash digest
SHA256 a20f72a192d469a30d961dbc282049443ffff79f4bb61be5cec94cc254f94297
MD5 2542febd00ce7950a14b29f726c8a469
BLAKE2b-256 8b406a56f24ee61ee8f8320e4ca4de785b25060eb2b485a05daeb813f2e761d5

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post6-cp312-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post6-cp312-none-any.whl
Algorithm Hash digest
SHA256 5cb53a1cb17d103a27e382e0d78700ea959d4010745edb55b9ed4529ea02e60f
MD5 f33da35548b1b3321b5d6dd5b0081145
BLAKE2b-256 7ea522169d0502576de369568b9e776e63fc003b3c3c40f2cd308d0882ac7c3f

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post6-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post6-cp311-none-any.whl
Algorithm Hash digest
SHA256 8f7881e5f0b14e3d7dfabd5dbf74f3dde23946cf99b40cc30b4b82cea24d602d
MD5 81e58d3a5cc2ec4f8dcaeaed70f73e32
BLAKE2b-256 e975bb83739fd33df16e4ca89b9067af5ee0b09150c6a4d78cd7dc080cf69313

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post6-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post6-cp310-none-any.whl
Algorithm Hash digest
SHA256 7fca0c7af18e2763fdb4ae3ad4f884eaac30a44589245a415915b3f2f0737237
MD5 36173e1b434c0218432b6d82c5d17b84
BLAKE2b-256 c6de2250da3c22f081492614133aed808eae411ddb3d2b2fcb40e4ae68d1e7df

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post6-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post6-cp39-none-any.whl
Algorithm Hash digest
SHA256 293bbd624f458601df0759d5617090274f89a647bf6c6ac157f8597a415b8d57
MD5 1a8fc53a7660ce54bf13028fc04a9568
BLAKE2b-256 166c628ce2ea84e06453f269f52b616004dff265d89dd4d45818a9e87a790b59

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