Skip to main content

A very simple PCAP library

Project description

Copyright (c) 2017 Salah Gherdaoui

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Description: Python PCAP Library
===================

.. image:: https://gitlab.com/salah.gherdaoui/pcaplib/badges/master/build.svg
.. image:: https://gitlab.com/salah.gherdaoui/pcaplib/badges/master/coverage.svg


``pcaplib`` is a very simple and lightweight library for reading and writing PCAP files

Reader example::

import pcaplib
pcap_reader = pcaplib.Reader('capture.pcap')
for ts in pcap_reader:
print(packet)

(1494608771, 459378, 6, 6, b'\\x00\\x0c)\\xaa4\\xc9')
(1494608771, 459556, 6, 6, b'\\x00\\x0c)\\xaa4\\xc9')




Writer example::

import pcaplib

pkt_list = [
(1494608771, 459378, 6, 6, b'\\x00\\x0c)\\xaa4\\xc9'),
(1494608771, 459556, 6, 6, b'\\x00\\x0c)\\xaa4\\xc9'),
]

pcap_writer = pcaplib.Writer('capture.pcap', pkt_list)
pcap_writer.writer()

Platform: UNKNOWN
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Networking :: Monitoring
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Internet :: Log Analysis
Requires-Python: >=3.4

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pcaplib-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pcaplib-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file pcaplib-1.0.0.tar.gz.

File metadata

  • Download URL: pcaplib-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pcaplib-1.0.0.tar.gz
Algorithm Hash digest
SHA256 36a4c8ae21b9276e1b11b9947a9464694f782303dc32f8efb691f385db371565
MD5 0b3d4af00facbea1863a257cce7e82b2
BLAKE2b-256 3b9086ceec6899e818d171257bb879d36a5b52d59b3aa2c17a7a448b6263d730

See more details on using hashes here.

File details

Details for the file pcaplib-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pcaplib-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 190dca79cfa3f0e53bf103cac8e2bc366fb8d81f9ca28033ca50bbcb9950423c
MD5 16c3304c2ed0e3235fbaaeb979ba1f36
BLAKE2b-256 8dc97ac8e0d3d7f8aab1703064d3c1c8cdedaf0ba910e3b56ded6a7a1da6720e

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