Skip to main content

Simple PCAP file parser

SimplePCAP. Logo Author: @mellin_venera
lint IC-IT License Python 3.10+ Documentation Status PyPI

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

From PyPI

pip install simplepcap

From GitHub

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.

Metadata

Release files for simplepcap 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplepcap 0.1.9
File Size Uploaded Provenance Actions
simplepcap-0.1.9.tar.gz 13.3 kB Without provenance Details for simplepcap-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simplepcap 0.1.9
File Interpreter ABI Platform Actions
simplepcap-0.1.9-py3-none-any.whl Python 3 none any Details for simplepcap-0.1.9-py3-none-any.whl

Total release size: 25.9 kB

Release files / simplepcap-0.1.9.tar.gz

Download URL simplepcap-0.1.9.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
83bfe6233ed3865f21f343c6b4dba6f4c030d7500b918414ac54c90bc51b2c45
BLAKE2b-256 checksum
How to use checksums
ba2d0bb23bd98a64f4b4e74375d594a904980b247b0840427527e7baa910cdb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.5

Release files / simplepcap-0.1.9-py3-none-any.whl

Download URL simplepcap-0.1.9-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9b0dab9ebb8b36066797c454e9a0878eebb98082d87b6aad97e3286e1c1f91a
BLAKE2b-256 checksum
How to use checksums
da0a394ed89d224db44c001830f52ebb1515e46fabdeaf554b96d5b12918f1d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.5

Security for simplepcap 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page