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

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.1.dev2.tar.gz (670.6 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.1.dev2-pp39-none-any.whl (975.0 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.dev2-pp38-none-any.whl (975.0 kB view details)

Uploaded PyPy

pypcapkit-1.3.1.dev2-cp311-none-any.whl (975.0 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.1.dev2-cp310-none-any.whl (975.0 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.1.dev2-cp39-none-any.whl (975.0 kB view details)

Uploaded CPython 3.9

pypcapkit-1.3.1.dev2-cp38-none-any.whl (975.0 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.3.1.dev2.tar.gz.

File metadata

  • Download URL: pypcapkit-1.3.1.dev2.tar.gz
  • Upload date:
  • Size: 670.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pypcapkit-1.3.1.dev2.tar.gz
Algorithm Hash digest
SHA256 a9a9bc2b8f41b6b625a8c228ab808fc7e85ad7bfc39717ce113729a3aff97746
MD5 7636773e0c77ce9612c955b735282160
BLAKE2b-256 080c4dab290ba718ae75494a2ccf7604eb767ee3af94d5523a4bc688f045eae2

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev2-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev2-pp39-none-any.whl
Algorithm Hash digest
SHA256 dbcc908bd952dccc3aae861ccc63d04bd8b5ebc0a267ff948e825488daea5c38
MD5 be2d9ae64736a19ac53005fdf6c9147f
BLAKE2b-256 f0af24ec5f7f9f80fcb0a0320c9c40b99693d968a33c884bd8e363a718472654

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev2-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev2-pp38-none-any.whl
Algorithm Hash digest
SHA256 6bfb0bc89c3f21ebf950b47e2b8e4b7954c8e081369e6621dc3c52f13c71dd27
MD5 1afe00cad2d67505886c244dae48f7b8
BLAKE2b-256 8d29a4678d7ce05eacf9a0f3d97ce04ba2b6f7d71c61248c73e5cc7e0c2c83b0

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev2-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev2-cp311-none-any.whl
Algorithm Hash digest
SHA256 a8e9bb3f16c6c9d15c81da27468d77afd70554fe385a49e6a1d9b8d7d5157651
MD5 e021c79c3372a440b914aeee8ae54b5b
BLAKE2b-256 6744f660e34d354f2a5e4d867b5c478c4649ad2f32bd684b90ae0915a22ddfb7

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev2-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.1.dev2-cp310-none-any.whl
Algorithm Hash digest
SHA256 4b58355c57d1503e3b00c2adce1fcca883a08c1869fa2d4d1886ee4472be8da3
MD5 fb30803970575a325418d22ccc16c28e
BLAKE2b-256 cba7a4bb681ca9533de5cea8b7c6736c51b3aa986620043f6f1d0c394495dc10

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev2-cp39-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.1.dev2-cp39-none-any.whl
  • Upload date:
  • Size: 975.0 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pypcapkit-1.3.1.dev2-cp39-none-any.whl
Algorithm Hash digest
SHA256 857eea216f86509be1e82eca20e37fc7c1d9e2ebc472cabd92c7632fdca9a208
MD5 40c692de30a38597a77338aeeff27c52
BLAKE2b-256 e657474f241513c68f0cd461f8f65036a5cea135f17fa6c747f9aa9961275e16

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.1.dev2-cp38-none-any.whl.

File metadata

  • Download URL: pypcapkit-1.3.1.dev2-cp38-none-any.whl
  • Upload date:
  • Size: 975.0 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pypcapkit-1.3.1.dev2-cp38-none-any.whl
Algorithm Hash digest
SHA256 d304d00c4e3f6b0cd402d0efdb52678859a40d5d441c0e6e14b6c70abac25b34
MD5 7aea0ea4397bff36751c3893497ab2cf
BLAKE2b-256 6c012c43ecb3ecbc37fbd8b8a823b91fac5f25bd7aded4be32f914b85c053119

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