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.1.post1.tar.gz (663.1 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.1.post1-pp39-none-any.whl (966.8 kB view details)

Uploaded PyPy

pypcapkit-1.2.1.post1-pp38-none-any.whl (966.8 kB view details)

Uploaded PyPy

pypcapkit-1.2.1.post1-cp311-none-any.whl (966.8 kB view details)

Uploaded CPython 3.11

pypcapkit-1.2.1.post1-cp310-none-any.whl (966.8 kB view details)

Uploaded CPython 3.10

pypcapkit-1.2.1.post1-cp39-none-any.whl (966.8 kB view details)

Uploaded CPython 3.9

pypcapkit-1.2.1.post1-cp38-none-any.whl (966.8 kB view details)

Uploaded CPython 3.8

File details

Details for the file pypcapkit-1.2.1.post1.tar.gz.

File metadata

  • Download URL: pypcapkit-1.2.1.post1.tar.gz
  • Upload date:
  • Size: 663.1 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.1.post1.tar.gz
Algorithm Hash digest
SHA256 f7fa2c33e3fbba50fe5b9fadfda8af11b47e0ecf3fe469fd9c82b3741ed83813
MD5 5b1c14d72bccb13e6d666ab5f5aafbc3
BLAKE2b-256 5bea2020e715f8f4c361903ad4c7828280be7b44b2c51c3af812af5e0fb904f3

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post1-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post1-pp39-none-any.whl
Algorithm Hash digest
SHA256 534d30b95405f980ace3be883da03ae58fcd33ff03165be6eea62bcf9d598cd9
MD5 41940716331abd8d3d5877ebcbde7c55
BLAKE2b-256 662e6fdd8adb1f0ff5c95185323767c8ab5d1be99d67f15891b43a79d17e7114

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post1-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post1-pp38-none-any.whl
Algorithm Hash digest
SHA256 e22e4e78e996e63f55a008f337f906dace080cda381dae1c400fcc9c49610292
MD5 0e3e83f50bfae3f16343b8623dc1872b
BLAKE2b-256 59cbffb0b31145fe7ef4c9df30c5fe2b94e8dc60fe094eff7697f97a705ed32d

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post1-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post1-cp311-none-any.whl
Algorithm Hash digest
SHA256 2769d89510a6571226b2762beeccacf3d0e7d5b2959156772f960a663d2f77b7
MD5 8c26412a88962d3a8f2bbe9126af924a
BLAKE2b-256 caa3c22183c92e6bdc1e6fe37538110ecc83bc7abaf16b3ceccc72698609fb3f

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post1-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post1-cp310-none-any.whl
Algorithm Hash digest
SHA256 7072c2bb21b6916cb1f27b99485dca6abeecb77bda3eb35b314a18f6ce16d878
MD5 c631aed1fbca0f750db9e8b3ddac18bc
BLAKE2b-256 f17280ed571d9b20d7f0cf551bb53f543ab2a8af159bdfffa96c05b318d097bf

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post1-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post1-cp39-none-any.whl
Algorithm Hash digest
SHA256 ef8f0944cfa260cb094b5a032acca34f22e88d4e6bcee597baf46db27f9fd3ac
MD5 3caf64314fa17bb0e27a834d2bb03f3f
BLAKE2b-256 bbe853abbd278d94d579d1246a0765cabf90a6ff740ccdb5dc7c13ccd62a73cc

See more details on using hashes here.

File details

Details for the file pypcapkit-1.2.1.post1-cp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.2.1.post1-cp38-none-any.whl
Algorithm Hash digest
SHA256 a5ddc7d5c413617d2cabfe70d158c0717b7242ab869898accddcac06fc41b0fd
MD5 45e44435eb0986f84a3900e6103bef44
BLAKE2b-256 e165fd1d5112f8ecf584eab68070d08435c19bdba5f1cf708e4c000b964d5aee

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