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
Built Distributions
File details
Details for the file pypcapkit-1.3.1.post27.tar.gz
.
File metadata
- Download URL: pypcapkit-1.3.1.post27.tar.gz
- Upload date:
- Size: 670.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec16ff3016689b7bc4c7f214ef6c4695e8bbb501a4c05fc367eea18383a88273 |
|
MD5 | 5972d112bf312a8523391eb10d663fdd |
|
BLAKE2b-256 | ae8b039ef0c10c9b0d560fa1b381b91cdee8bb1cc4a1c2178b18198df17952d5 |
File details
Details for the file pypcapkit-1.3.1.post27-pp310-none-any.whl
.
File metadata
- Download URL: pypcapkit-1.3.1.post27-pp310-none-any.whl
- Upload date:
- Size: 975.6 kB
- Tags: PyPy
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a158c78725c389f24b63af5f39229178195fafac6c6bafc062d907df9ee94f29 |
|
MD5 | aac90dfa3f8397ba1fa99f85aba5b325 |
|
BLAKE2b-256 | f50c96ef8a4101d05f3151f38b2f3c7a8688506f14f1936d0b056221204153d2 |
File details
Details for the file pypcapkit-1.3.1.post27-pp39-none-any.whl
.
File metadata
- Download URL: pypcapkit-1.3.1.post27-pp39-none-any.whl
- Upload date:
- Size: 975.6 kB
- Tags: PyPy
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d808dffc06e7360079e573f12de7e511c41b75375ac6e0db486215daed28523c |
|
MD5 | 8c2af030c477ad0eac1b5b00faab3d3c |
|
BLAKE2b-256 | 23c57894828b747fd0a94aef451bc94d80ec66c4518e1d58b0ebd0d6c49e16d3 |
File details
Details for the file pypcapkit-1.3.1.post27-cp312-none-any.whl
.
File metadata
- Download URL: pypcapkit-1.3.1.post27-cp312-none-any.whl
- Upload date:
- Size: 975.6 kB
- Tags: CPython 3.12
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc7b2822ba9f7420b3d1704197171b7306a77f26a0e1942ba715fc982be03d0b |
|
MD5 | 6892ffa483b4cac554fec77acfb7258c |
|
BLAKE2b-256 | e1913e8fe2628ef0fabe078c04512ed130b4e10be9b62dd142654bbf2a45f78a |
File details
Details for the file pypcapkit-1.3.1.post27-cp311-none-any.whl
.
File metadata
- Download URL: pypcapkit-1.3.1.post27-cp311-none-any.whl
- Upload date:
- Size: 975.6 kB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 925e23eba562d92941f1e09f1373e1d94fd109ca29bd488c759aa99bcc02cebc |
|
MD5 | 719abe50d1f99c4bbdc7a3bc841db023 |
|
BLAKE2b-256 | dbc765d26b8fdbb7fac3956a026cc9bec283ba9527b43ad016c793ec587e3637 |
File details
Details for the file pypcapkit-1.3.1.post27-cp310-none-any.whl
.
File metadata
- Download URL: pypcapkit-1.3.1.post27-cp310-none-any.whl
- Upload date:
- Size: 975.6 kB
- Tags: CPython 3.10
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3f9cf25056a998de11b229609d2e8cd888c9ed69829e810dd8fb82b2fc894b9 |
|
MD5 | 80571a470f99033de956db71b482bd86 |
|
BLAKE2b-256 | 2b77fa51f247ca900d81527fed1819443e010b9ea094226b335f1b5ba96328e1 |
File details
Details for the file pypcapkit-1.3.1.post27-cp39-none-any.whl
.
File metadata
- Download URL: pypcapkit-1.3.1.post27-cp39-none-any.whl
- Upload date:
- Size: 975.6 kB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5989cbdc59617f6e7746ec9d7ffdfb88bbe66c08d8aa9ff634cb0e121084426b |
|
MD5 | e9d85288e15b179cc8fdbfaa8be15a46 |
|
BLAKE2b-256 | 2bcff7b839cc39c56c8eb1ff837709faadd114d80b1a12efc88407954eb960e7 |
File details
Details for the file pypcapkit-1.3.1.post27-cp38-none-any.whl
.
File metadata
- Download URL: pypcapkit-1.3.1.post27-cp38-none-any.whl
- Upload date:
- Size: 975.6 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98cccee1615343f5c57a3aa7a36cd699f16ee6510586064284a4d2563833c778 |
|
MD5 | b2c29c05436cd9af94f4cad7f43c3675 |
|
BLAKE2b-256 | 2dc86eee7b147c4fbe7ac75392eb94fc17b4453f7a6552f3ab97fd9afcbb7f07 |