A simple pcap library for Python
Project description
Simple PCAP file parser
Based on this and this PCAP Capture File Format description.
About
Simple PCAP was created to allow the user to focus as much as possible on processing packets stored in a pcap file without studying its structure. This is a very simple tool, it does not provide additional tools for analyzing packages. The library tries to provide the safest possible manipulation of pcap files.
Installation
pip install git+https://github.com/ic-it/simplepcap.git
Usage example
Simple usage
from pprint import pprint
from simplepcap.parsers import DefaultParser
with DefaultParser(file_path="./pcaps/eth-1.pcap") as parser:
pprint(parser.file_header)
for packet in parser:
pprint(packet)
Get all packets
from pprint import pprint
from simplepcap.parsers import DefaultParser
with DefaultParser(file_path="./pcaps/eth-1.pcap") as parser:
packets = list(parser) # or packets = parser.get_all_packets()
pprint(packets)
Look at the examples folder for more examples.
Documentation
Look at the docs.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
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 Distribution
File details
Details for the file simplepcap-0.1.7.tar.gz
.
File metadata
- Download URL: simplepcap-0.1.7.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3269a611214b273ec3e532c36ee7e0b01e9b4ed2d669daa9100bd870080dbbd4 |
|
MD5 | 977603bb15703100eb78f112d1be3452 |
|
BLAKE2b-256 | 37be45646b6a0a0d604cb751bc9296d1e8ffaa3cecf79b4440d0f35ee47636de |
File details
Details for the file simplepcap-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: simplepcap-0.1.7-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709c1f0008f90392ded16f47aebe1e8dd4ed3e774d167ff5ac9b87feeea5b990 |
|
MD5 | 51bab4dc6cf16bc08dee7a4a27baf5f3 |
|
BLAKE2b-256 | 21ed63da38df4d8dab984b07d880633fd83345a793105da97958b0e9a1b08150 |