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.4.tar.gz (671.6 kB view details)

Uploaded Source

Built Distributions

pypcapkit-1.3.4-pp310-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.4-pp39-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.4-pp38-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.4-cp313-none-any.whl (976.2 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.4-cp312-none-any.whl (976.2 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.4-cp311-none-any.whl (976.2 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.4-cp310-none-any.whl (976.2 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.4-cp39-none-any.whl (976.2 kB view details)

Uploaded CPython 3.9

File details

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

File metadata

  • Download URL: pypcapkit-1.3.4.tar.gz
  • Upload date:
  • Size: 671.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4.tar.gz
Algorithm Hash digest
SHA256 92b7801dc45a7433dd562ec70300cdd1729fa83581c39572bdef015cad945481
MD5 83044bdd9d46ab226b360af27b05d4ad
BLAKE2b-256 36ef5223bf8f453f0b4fecf54637ea5e9428a6badd66f0a6f69950a60bd4fd7c

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.4-pp310-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.4-pp310-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4-pp310-none-any.whl
Algorithm Hash digest
SHA256 f2bb36823ef4d189c9069137ea77f1fccae9178472d56d62756d18d605c591ed
MD5 e9ac4936b0983f669074ffb9ad6c7022
BLAKE2b-256 2f7e9a2ef4d1b1601c6ed3546be9b7ca77ee13137d11308551413bb87b7eedbf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.3.4-pp39-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4-pp39-none-any.whl
Algorithm Hash digest
SHA256 892006ca3e6b3c1ee403e47df0c3a9b49c225053663d2c1aa7467e06076eb22e
MD5 7ec1ffc61554c09ba503e17b4f48c269
BLAKE2b-256 cf4088ca4dd402624531109652870835b85b5f41153698a08545dd87b2496fa0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.3.4-pp38-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4-pp38-none-any.whl
Algorithm Hash digest
SHA256 8e255174bc5da76d3d6eb859f98557d2ae5bdd63d3cf2f5063b69ee4c0c647ba
MD5 e97f7145c6be663262e8a98da8955bb0
BLAKE2b-256 e525acd7d5338b17598a5b42340e6ca8a93ee7ca556ce9165a236fa94a2492a9

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.4-cp313-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.4-cp313-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.13
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4-cp313-none-any.whl
Algorithm Hash digest
SHA256 27d660f40a36a7a671347e8640f81d336d12c15ca24e90a5775c1a856281f343
MD5 7f71b83282bba281f7b10e98b2ae6723
BLAKE2b-256 992f0b6735ee7836340da5e4dabb109fbbad89b52ff1d2e6a412c586b0c9772c

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.4-cp312-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.4-cp312-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.12
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4-cp312-none-any.whl
Algorithm Hash digest
SHA256 f83b38783a095cf1dcf3fbafe09b7f238989d5dcf9905f6f591fe8b8a98deeca
MD5 31a57b2ee3d6ad281ef517d7be0dafc6
BLAKE2b-256 6bb45262308b26730e421c63fdcd74a435107c6d743761a34c91aa4d8bda9723

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.3.4-cp311-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4-cp311-none-any.whl
Algorithm Hash digest
SHA256 1fa8b109a9d70a55e0670d6f6c57bbdfc0ab7bd6b03b507058d6458ae01b802d
MD5 e1cf0c069b3d2fc6bf351f0c246b98c6
BLAKE2b-256 7b73f0fde5dd9dedb838144e3f5909bcca39bf55cfe6c3db633f927b6a9ec69d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.3.4-cp310-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4-cp310-none-any.whl
Algorithm Hash digest
SHA256 64a77b6fbcaf728854274cdf135e8af0c396ccc74dbe366b58265c68cc6f6bba
MD5 e2d69b0603094dbbbd9b5cb2d09ef6ea
BLAKE2b-256 d08d6e490360744b4745d1738ac856bcd4ebcf1a7c779694b82b820d9513b672

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.3.4-cp39-none-any.whl
  • Upload date:
  • Size: 976.2 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.4-cp39-none-any.whl
Algorithm Hash digest
SHA256 f650cf628e9ae9dbd082f7ae5e2a9e5ee778fe9e2512fb3e3167e572a59e1e3d
MD5 3323f484385d333496af7521fb967768
BLAKE2b-256 663be2036ab9bdd665174323ec4cca0698e933c72b2b4ab323d88015b59bd3b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page