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.2.0.tar.gz (662.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.2.0-pp39-none-any.whl (966.3 kB view details)

Uploaded PyPy

pypcapkit-1.2.0-pp38-none-any.whl (966.3 kB view details)

Uploaded PyPy

pypcapkit-1.2.0-cp311-none-any.whl (966.3 kB view details)

Uploaded CPython 3.11

pypcapkit-1.2.0-cp310-none-any.whl (966.3 kB view details)

Uploaded CPython 3.10

pypcapkit-1.2.0-cp39-none-any.whl (966.3 kB view details)

Uploaded CPython 3.9

pypcapkit-1.2.0-cp38-none-any.whl (966.3 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.2.0.tar.gz
  • Upload date:
  • Size: 662.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3e86012edc34ee413e4e670ffa66a1151f446edf2d5a924faa364733a8ea14e2
MD5 f685328567ee1aca4ba5b0315d47e60f
BLAKE2b-256 7745fab3aac03b03ffbffd7922ee0fe00f083d93f0f5bd357f82151bcd99a423

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.0-pp39-none-any.whl
  • Upload date:
  • Size: 966.3 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.0-pp39-none-any.whl
Algorithm Hash digest
SHA256 29c0928fd489e53e6cb8efc328b54ba599b7b28c3e4a0029ba496ef5be895ec3
MD5 2ff80ad928d8399b04cd3402bc75c005
BLAKE2b-256 fa4e8f1541a7259f7900591eb439a9382960b10f665e3e96f815d14fb661f437

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.0-pp38-none-any.whl
  • Upload date:
  • Size: 966.3 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.0-pp38-none-any.whl
Algorithm Hash digest
SHA256 deb9f07d0d65a5c1e53079f000bf475e781ea3528527a8e90f7c4b8e5c4650fb
MD5 71715d5455520fcee9a8de54ffd0b92b
BLAKE2b-256 43663b17300119d48d606f078b7745f7e1f38a5607a2d6e02339ef09aac4cbb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.0-cp311-none-any.whl
  • Upload date:
  • Size: 966.3 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.0-cp311-none-any.whl
Algorithm Hash digest
SHA256 f2d747f3187262ca766bc97b69d21e12acb52394728feb0ebbdca0eefd25557e
MD5 59364f9df3d87662f6c2eb0d494e43d4
BLAKE2b-256 2fa425cea7eefd0744c109ee3682d6db25ff104eb473f1e3df74b801a2b50733

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pypcapkit-1.2.0-cp310-none-any.whl
  • Upload date:
  • Size: 966.3 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pypcapkit-1.2.0-cp310-none-any.whl
Algorithm Hash digest
SHA256 943ce0c355ae5d9808ec7d8b659d1193e80f24a3cd6144289fac786edbbaecda
MD5 f0cae3fc72f170c8884cfbd50e88b4c7
BLAKE2b-256 7bb94de5ab4adffe8531579da396f5027f23e97c4902ce050c9542b6d095b29f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pypcapkit-1.2.0-cp39-none-any.whl
Algorithm Hash digest
SHA256 9bbe5582db17fc3e4d747f1601d5ca241332131b7addbf5144dcd38e7876b362
MD5 dbe243dd2a1a429f0781030b033818e8
BLAKE2b-256 bfa448a6da9b237369c2272310a3e62c5dc0d786f6ece8bdebf9456c839dfeef

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.0-cp38-none-any.whl.

File metadata

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

File hashes

Hashes for pypcapkit-1.2.0-cp38-none-any.whl
Algorithm Hash digest
SHA256 c1e7d3df11088f820870e01546e0d4c068f105ed0ef389c1ced5d75ffb2de1f1
MD5 351e54624f9f82a450bbadb0afb63f0b
BLAKE2b-256 5cf4e60cea86731859dd0ff66d1dd41a467202bda196ac694d8a5bc9f3729019

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