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.post3.tar.gz (671.5 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.post3-pp310-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post3-pp39-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post3-pp38-none-any.whl (976.2 kB view details)

Uploaded PyPy

pypcapkit-1.3.5.post3-cp313-none-any.whl (976.2 kB view details)

Uploaded CPython 3.13

pypcapkit-1.3.5.post3-cp312-none-any.whl (976.2 kB view details)

Uploaded CPython 3.12

pypcapkit-1.3.5.post3-cp311-none-any.whl (976.2 kB view details)

Uploaded CPython 3.11

pypcapkit-1.3.5.post3-cp39-none-any.whl (976.2 kB view details)

Uploaded CPython 3.9

File details

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

File metadata

  • Download URL: pypcapkit-1.3.5.post3.tar.gz
  • Upload date:
  • Size: 671.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypcapkit-1.3.5.post3.tar.gz
Algorithm Hash digest
SHA256 1bda2c6a9c778d6b4c3383244b4e068de204fbc0079a77d175a8d19bbb0d193a
MD5 96708cc0014e272387dfa9d00935ed7f
BLAKE2b-256 945f9cedb44eb58f6feb2601b235ade32adceb9defad99d3a512576c60c63234

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post3-pp310-none-any.whl
Algorithm Hash digest
SHA256 ade1ef7956fbffe12e585bc638c25ede8f96e17f565ba96ecffacc72898ba037
MD5 104a6cbf6b330531cdb81f6526242e27
BLAKE2b-256 04a89b3002c03a60ef0c915371b5e6d9dc5cfc48e591ac95897c211a11e3bbbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post3-pp39-none-any.whl
Algorithm Hash digest
SHA256 6cc86ca5e5b09add29b524fb5b8419eca12a6bbf35c52fa336750813c478d77d
MD5 40251c571a01706899774b459122c933
BLAKE2b-256 79cae0216edfd5cff0c258b49f200af38f35bcd0f1a41e728b655a4540f4a050

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post3-pp38-none-any.whl
Algorithm Hash digest
SHA256 725fe0680af297bc09acdea339829f114c3b18c6650b75d8a3cecc97492a1a1e
MD5 87baeb59579707a187c2cf8e0f294661
BLAKE2b-256 6a02675e020ff176cf88848be4f6258b0fc3274a9d85bd9ef849da714a92d9e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post3-cp313-none-any.whl
Algorithm Hash digest
SHA256 a34760b29f481649aa2f79d9ac3086a6cd9a10c57563485493672345c0bc5b2c
MD5 015bbf85ae12092643b1f6869e6127d7
BLAKE2b-256 22b482da2c55db66ed6842d43fa0a46115373245188789e2532339b254e323c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post3-cp312-none-any.whl
Algorithm Hash digest
SHA256 3c12bf04f79a8bf19b691312435e1f0493e6175e393a6884cddcbfa83c6cf45f
MD5 4e8e31f7ce4b88245148f1cfcf9fbd35
BLAKE2b-256 d800634d6dd5a0380cb092b0dc76e956e268da90a183b7bf7b5b9087d478ec88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post3-cp311-none-any.whl
Algorithm Hash digest
SHA256 b0a8f3fd5c6eb87d092cae6fd7269fece21ad69062d90cc7a0ec7f7cb0caeaab
MD5 3032c796993956307b4e1dce276e0dae
BLAKE2b-256 f3e706984027a0cefcf23427e37526bec685c16a597068df6ebc934faf7d69e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pypcapkit-1.3.5.post3-cp39-none-any.whl
Algorithm Hash digest
SHA256 912db1fc941018f083479a243c95a293922af6814697c015e446abacafa77d95
MD5 5d3d5ef6c54d70c6027e2e95ed3ec42b
BLAKE2b-256 5b432b400b90bc4ba2b0ad1dd8d2673484c4a43d16c3b19447299d2ea79e3ab3

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