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

Uploaded Source

Built Distributions

pypcapkit-1.3.3.post2-pp310-none-any.whl (976.3 kB view details)

Uploaded PyPy

pypcapkit-1.3.3.post2-pp39-none-any.whl (976.3 kB view details)

Uploaded PyPy

pypcapkit-1.3.3.post2-pp38-none-any.whl (976.3 kB view details)

Uploaded PyPy

pypcapkit-1.3.3.post2-cp313-none-any.whl (976.3 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.3.post2-cp312-none-any.whl (976.3 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.3.post2-cp311-none-any.whl (976.3 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.3.post2-cp310-none-any.whl (976.3 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.3.post2-cp39-none-any.whl (976.3 kB view details)

Uploaded CPython 3.9

File details

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

File metadata

  • Download URL: pypcapkit-1.3.3.post2.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.3.post2.tar.gz
Algorithm Hash digest
SHA256 c36a1972cafe6804ea31804fef2fef62626b868caee89c6e2c17c42569e4c025
MD5 5382ac7bf79002b0ebbf711bc535f6e1
BLAKE2b-256 3a3d26235b5e204da979fc1eb9bf2c6eabc7c9062fda50288030d4c865479352

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.3.post2-pp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post2-pp310-none-any.whl
Algorithm Hash digest
SHA256 e814525809df449e7cc42af1adfa0865342eebee8012ff949f67d2b35e16a964
MD5 cebfd3cb694fa1c3aba63a54748f4cf6
BLAKE2b-256 ef3d134fe9a6a2aaaa09db9bb278148bd3f70cb92f81a082181cb75f62f340c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post2-pp39-none-any.whl
Algorithm Hash digest
SHA256 3daf9c7ffbfd07281fc1eb650cd40e0feeff16e1f7d26fe153c4d1eaf7898e67
MD5 eca3898f9155e0ecdfdeadd8a13a2b37
BLAKE2b-256 4d467a8734a2a1ffcb72ead31094f7044750b5290493f36ec6307f11300d70d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post2-pp38-none-any.whl
Algorithm Hash digest
SHA256 b456a4356ca6f0cc04d7fed0749e65f6bcabf5824db1d12519a72cae2213996a
MD5 7b20b0ef650787752762675368de38a0
BLAKE2b-256 fc863abdad7b2884835b34b097619f10442325a2fdc50099e1a9beeb5e466dac

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.3.post2-cp313-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post2-cp313-none-any.whl
Algorithm Hash digest
SHA256 1f7a9d49bfedbadeb7959eb7fe05697cae0a2455ed70042c6cfba0a687ae1b80
MD5 0a301ed67e66e6a5524106176fa491c5
BLAKE2b-256 cb881abdad7f2819ac0829b8c0f40ed389cf0c35fdff5e00fad1151d61628fc8

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.3.post2-cp312-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post2-cp312-none-any.whl
Algorithm Hash digest
SHA256 0ae7ce29612978efa6f3e0e76098b8950e7125cc27b2fd7686e5116424b3d23a
MD5 5349b7b5a13cb1a8a9b7f67dc4384d82
BLAKE2b-256 fa96523b776246a0a8c0eaaafc70c1e1b62ea41bde5761ac00357b93219b3ec3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post2-cp311-none-any.whl
Algorithm Hash digest
SHA256 de71527f3bf24968384b93ba5dc3b0d9c4a7a1eaa32bdd2ebfe2c7032d5a4417
MD5 923cf0981dd470980f089e600f9c305d
BLAKE2b-256 9058aa35801abafaab0620e98729877b78a9635710bd6ebd81f28d9aeb8e0dc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post2-cp310-none-any.whl
Algorithm Hash digest
SHA256 04881910d5fd5e98ce36dd7f59d7092a271f5eac264c7bd9822d04d97c249cd8
MD5 b309a71a3f665d7963c0cd09e0960504
BLAKE2b-256 a572e477a1e0d9f8fc988a5e52639d256ad74c2589e0f8c8528ae1e455fec32d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.3.post2-cp39-none-any.whl
Algorithm Hash digest
SHA256 d93f26d4e688e8d087c2956ad32686037d72cfad46f4fd5a44bbf0a6bb6154a5
MD5 1077e1d52dd378eeecd00c63ccf1bd0b
BLAKE2b-256 52a6bf48d7cc83c9736dba4df09943b588206908121b493fd188720e6718d123

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