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

Project details


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.5.post33.tar.gz (669.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.3.5.post33-pp310-none-any.whl (973.8 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post33-pp39-none-any.whl (973.8 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post33-pp38-none-any.whl (973.8 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post33-cp313-none-any.whl (973.8 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.5.post33-cp312-none-any.whl (973.8 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.5.post33-cp311-none-any.whl (973.8 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.5.post33-cp310-none-any.whl (973.8 kB view details)

Uploaded CPython 3.10

pypcapkit-1.3.5.post33-cp39-none-any.whl (973.8 kB view details)

Uploaded CPython 3.9

File details

Details for the file pypcapkit-1.3.5.post33.tar.gz.

File metadata

  • Download URL: pypcapkit-1.3.5.post33.tar.gz
  • Upload date:
  • Size: 669.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pypcapkit-1.3.5.post33.tar.gz
Algorithm Hash digest
SHA256 9c0a661dcf95cb49876daaf8e3ad9198845627e6bf4178d69e1d2cffade99ef4
MD5 2a4838e0d095e2e6c0c828d56e7ff79c
BLAKE2b-256 82529fa4c7f4a7f0046b97c72bca7637dd71dff600a2e4784501294c19170185

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post33-pp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post33-pp310-none-any.whl
Algorithm Hash digest
SHA256 8b97baa821d5d03c741c533a5f31aeb287d9c9ec4eaa6d79ef77571b30589060
MD5 bd63ec66b5294446cab1c4ab22a5bbb4
BLAKE2b-256 6f7a893fd4d63418445436e277b45e90fed65aa4ac66beba771da730edfcc932

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post33-pp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post33-pp39-none-any.whl
Algorithm Hash digest
SHA256 f0ab8f3e152e1a28eed9a8f34a877d6f1cc743c79b156e3a5b71445a121e1b1f
MD5 1dcd92356908bf5e49336804b5608e1b
BLAKE2b-256 4dbc1cda5d227532c0b23e01fc1717ee8a0cde03be234840046018dd951a901a

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post33-pp38-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post33-pp38-none-any.whl
Algorithm Hash digest
SHA256 4b8a8b0c26cf1e11f9aff9768fe8461cf668f9ac5f19d0589e020b719a7b8480
MD5 caf667be49058dc0edcd76318f2ff937
BLAKE2b-256 145ec6a8d02241cc769d2f3a3fd9fc0bc5b3ff711c519a06131b76d41cc4eab6

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post33-cp313-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post33-cp313-none-any.whl
Algorithm Hash digest
SHA256 36541cb5955a96d0da5bc3efa74f6457fa2ca0d45bf951fe0556c211cf1414af
MD5 7c20fcc232da6d45e39699f6cd41fe0b
BLAKE2b-256 bbeb0542e9b22dfa208f0f76e971ffb9c7f7dc96259bac7f8e9dfd59261bf3fb

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post33-cp312-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post33-cp312-none-any.whl
Algorithm Hash digest
SHA256 9d6b46e7e718dbe62710d7eda690b3d84c0cf8c74c9c1130dc84a0a0a3e46280
MD5 7f1fb8498ea21cd302ec17384d9a63a4
BLAKE2b-256 0e0b45cd969e7744e0846bc11b1af6ec256c2b3e9a436d7c86fd885f6d3c6330

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post33-cp311-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post33-cp311-none-any.whl
Algorithm Hash digest
SHA256 f46569eb65bcacf2a70627289f0ea72b6f8a5eed8b51cb43a67bb32de16358ff
MD5 eb77f73f668ee12dc2e034091140a1a2
BLAKE2b-256 fe9b7a46316360443bc16bb3e640549411c897aa2af0ea98729e661b07a7e639

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post33-cp310-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post33-cp310-none-any.whl
Algorithm Hash digest
SHA256 69b34a22424417765aa9eae1851efe07492c8a13a02f58a44c96910bcced4f08
MD5 94c4e59ecb2dd1094732dba155265bff
BLAKE2b-256 bf669b5baf5be25d8753844851cab4819b9c70365200862603833be37c8645f6

See more details on using hashes here.

File details

Details for the file pypcapkit-1.3.5.post33-cp39-none-any.whl.

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post33-cp39-none-any.whl
Algorithm Hash digest
SHA256 5f6792a649ba09807306bbc3707ec3fde51bb95759a8c70c5c6002a2a16da29a
MD5 a68bdb187da41d4688601df48abc7a99
BLAKE2b-256 216627382a073431ea7de43a0d36075d5ad3e2bb20e315d3816b04c0e7b8fec4

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