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.2.post1.tar.gz (663.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.2.post1-pp39-none-any.whl (967.0 kB view details)

Uploaded PyPy

pypcapkit-1.2.2.post1-pp38-none-any.whl (967.0 kB view details)

Uploaded PyPy

pypcapkit-1.2.2.post1-cp311-none-any.whl (967.0 kB view details)

Uploaded CPython 3.11

pypcapkit-1.2.2.post1-cp310-none-any.whl (967.0 kB view details)

Uploaded CPython 3.10

pypcapkit-1.2.2.post1-cp39-none-any.whl (967.0 kB view details)

Uploaded CPython 3.9

pypcapkit-1.2.2.post1-cp38-none-any.whl (967.0 kB view details)

Uploaded CPython 3.8

File details

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

File metadata

  • Download URL: pypcapkit-1.2.2.post1.tar.gz
  • Upload date:
  • Size: 663.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.2.post1.tar.gz
Algorithm Hash digest
SHA256 1e9110c36fc80712cf6ea2a18b12d0b336f60b389f572a8f8dc6b5af76ac5501
MD5 f0725630715d00484e78d159f7b5a1a4
BLAKE2b-256 b1fb196ea3653d4a09f1818acb0a94a0892bb0a49fe8761756d38c955346e5d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.2.post1-pp39-none-any.whl
Algorithm Hash digest
SHA256 39204ecc0c8fb27bc53efd7239bef8b8798749f720a141667658f222cfdf708b
MD5 4ec08133c872900995996720156a5e93
BLAKE2b-256 155a643ac2dc390f380464807e766c52c2f6f3f294d7653a378aca4f85d6269b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.2.post1-pp38-none-any.whl
Algorithm Hash digest
SHA256 1a95b6a24b458db1c9cb96d0ff950d2b17871563002afdaca09d022d3285f073
MD5 a044c1d9e5010299baacf280ccb892ee
BLAKE2b-256 4f35d95befb91f5dc8b05bb881768a2f0d1cea69a32dbabc947db13ded9fecc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.2.post1-cp311-none-any.whl
Algorithm Hash digest
SHA256 c862fd0b58763c771e5a73fc5402dd98c4d4c1c665fbb590b80741986fbf0ffb
MD5 fdf71c81d73ca45771f43d35a6dccbbf
BLAKE2b-256 2a9b83ab64e01980d79fea038dfb73051cd88b55a71a1abb28f5ae5d55ab66df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.2.post1-cp310-none-any.whl
Algorithm Hash digest
SHA256 9c5c1f3232eb08f9e1ee6b4bb27e112d8ade5053b0b08388f03fefbc3d2d627b
MD5 2ffaa2ca82db85ffba27d8e8c0ad6974
BLAKE2b-256 0003b31746a3c58381dbd55284cc4135026f172e5c44570bbb2a8ee4f2f700ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.2.post1-cp39-none-any.whl
Algorithm Hash digest
SHA256 6e02dacc9bc9b508b24876d79b2124b2e6c6d43562b5a935f85a73379e96a753
MD5 e5e1d6062d33c3f6e8ef38517840802d
BLAKE2b-256 5b6debeeb9a083e1ec371c69d3e956b6fb92b5c98c173474c39d269e64323840

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.2.2.post1-cp38-none-any.whl
Algorithm Hash digest
SHA256 29e8112b74e77cebe017d533f458266ee7dbf139711fcbd602aebd0138b753a2
MD5 1a46b1b7099c4ec4de22ce2988a43fc0
BLAKE2b-256 98c1700c104708b16730190577c7daa12013338ea3b0d9b7754101870b985428

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