{"id":13775423,"url":"https://github.com/allfro/pcappy","last_synced_at":"2025-05-11T07:32:43.307Z","repository":{"id":5035472,"uuid":"6194837","full_name":"allfro/pcappy","owner":"allfro","description":"A pure Python libpcap wrapper!","archived":false,"fork":false,"pushed_at":"2015-06-12T20:00:45.000Z","size":204,"stargazers_count":53,"open_issues_count":5,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-17T10:40:00.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"CyanogenMod/android_hardware_qcom_wlan","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allfro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-12T18:57:37.000Z","updated_at":"2024-10-03T05:11:18.000Z","dependencies_parsed_at":"2022-09-21T14:12:37.250Z","dependency_job_id":null,"html_url":"https://github.com/allfro/pcappy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allfro%2Fpcappy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allfro%2Fpcappy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allfro%2Fpcappy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allfro%2Fpcappy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allfro","download_url":"https://codeload.github.com/allfro/pcappy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253534084,"owners_count":21923515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:38.482Z","updated_at":"2025-05-11T07:32:38.714Z","avatar_url":"https://github.com/allfro.png","language":"Python","funding_links":[],"categories":["\u003ca id=\"8bc2e181f74ba67ec93fd2a13d95cc0c\"\u003e\u003c/a\u003elibpcap"],"sub_categories":["\u003ca id=\"b239f12aca7aa942b45836032cbef99a\"\u003e\u003c/a\u003e转换"],"readme":"# PcapPy\n\nPcapPy is a Python wrapper for libpcap purely written in Python. That's right! No need to compile anything using ugly\nwrapper frameworks like Cython, Pyrex or SWIG (yuck!). Using the pure power of ctypes, PcapPy will give you that warm\nfuzzy feeling at night.\n\n# Installation\n\nSimple:\n\n`sudo easy_install pcappy`\n\nWinning!\n\n# Example\n\nSure why not:\n\n```python\n#!/usr/bin/env python\n\nfrom pcappy import PcapPyOffline, open_offline\nfrom sys import argv\n\nif not argv[1:]:\n    print 'usage: %s \u003cdump.pcap\u003e' % argv[0]\n    exit(-1)\n\n# Open the file\np = open_offline(argv[1])\n\n# or this instead: p = PcapPyOffline(argv[1])\n\n\n# Parse only HTTP traffic\np.filter = 'tcp and port 80'\n\n\ndef gotpacket(d, hdr, data):\n    print d, hdr, repr(data)\n    d['count'] += 1\n\n# pass in some random parameters to loop()'s callback. Can be any python object you want!\nd = {'label': 'HTTP', 'count': 0}\n\n# Parameters are count, callback, user params\np.loop(-1, gotpacket, d)\n```\n\nNow run it:\n\n`python example.py dump.pcap`\n\nEt Voila! You're off to the races!\n\n# Questions?\n\nWe've got answers: drop me a line @ndouba or \u003c ndouba at gmail dot com \u003e on twitter!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallfro%2Fpcappy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallfro%2Fpcappy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallfro%2Fpcappy/lists"}