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 Beta (22F5037d)

Chip

Apple M2 Pro

Memory

16 GB

Test Results

Engine

Performance (ms per packet)

dpkt

0.010694_027361

scapy

0.093399_399399

pcapkit

0.199796_296296

pyshark

25.066692_025359

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.1.0.post1.tar.gz (655.0 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.1.0.post1-pp39-none-any.whl (958.7 kB view details)

Uploaded PyPy

pypcapkit-1.1.0.post1-pp38-none-any.whl (958.7 kB view details)

Uploaded PyPy

pypcapkit-1.1.0.post1-cp311-none-any.whl (958.7 kB view details)

Uploaded CPython 3.11

pypcapkit-1.1.0.post1-cp310-none-any.whl (958.7 kB view details)

Uploaded CPython 3.10

pypcapkit-1.1.0.post1-cp39-none-any.whl (958.7 kB view details)

Uploaded CPython 3.9

pypcapkit-1.1.0.post1-cp38-none-any.whl (958.7 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.1.0.post1.tar.gz
  • Upload date:
  • Size: 655.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pypcapkit-1.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 bf36ceb32da7d944f07fcc25d39606f49f3240339780bd72d201c31bf2345787
MD5 af1b6cb6c18978469209d7c680ae19ad
BLAKE2b-256 61d30a618f8c4030eaf14b11a223dce9f1667009b9e457b28c8a1e2de44cc702

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post1-pp39-none-any.whl
Algorithm Hash digest
SHA256 49539edfadb3ba86dfcee0599be02ffe002b52499cf9e945d9bd568e9e47a14e
MD5 6f29485ae0270c519fdcf1b2129d23f2
BLAKE2b-256 a58d069297aa4629ad546d08465b11ccd7ff9fa1db0db5103942cbc061a0af59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post1-pp38-none-any.whl
Algorithm Hash digest
SHA256 147a0bcd722262499208e38facaf6e3813d96e052a1c0b73eb0e8cafc9cbb500
MD5 10bed71e206da550fa61763c8a82a7f5
BLAKE2b-256 a12ba9da3a5aa0fbcf84eb3887947d9b531221bc40cb4b2ab380ffd4974c883a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post1-cp311-none-any.whl
Algorithm Hash digest
SHA256 70bde34190eedb1aaadb35011a79c12d7de554200c848424706913fd63abb617
MD5 d17219f6eb8fe84c066bbbebbd336533
BLAKE2b-256 10d6deffdcb623375bf71fb9f6755de8efa4ab000dc76acea390bdcfb4ef2ba2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post1-cp310-none-any.whl
Algorithm Hash digest
SHA256 5a76d7767cbdbf915321591bc67b61baa2b17ab7f7478db206486a14c4ac1b28
MD5 382d26c80fd13d7197dffb594ab536ff
BLAKE2b-256 f2fedecae2fd99c2fdf56d6fdbc8781e531b465519bb26cbd9804a9184d50a7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post1-cp39-none-any.whl
Algorithm Hash digest
SHA256 339d9f924da3a3256677c3a0e8819cf2d0a33032b292a1265dbe4c501ace065e
MD5 25333598d4ab490ce0222caf43ce184f
BLAKE2b-256 43795fc6767d9c09f22e05045b370ff8e97c4b2d21177eab6c1e70ec1d87c015

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.1.0.post1-cp38-none-any.whl
Algorithm Hash digest
SHA256 2a6e2f528e78def513194dd8437a23496a46a97dfd8e5df8625f08e92c2b792b
MD5 9d47be54cef0cd75c065a82d07d8f83a
BLAKE2b-256 e709319588656000e2b2cf05d6b0ef9732962188e6c92b6f9609c54df537ee25

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