pcap-ct
=======
Python wrapper for the *pcap* library.
Overview
========
| Python |package_bold| package is a simplified object-oriented Python wrapper
for *libpcap* C library - the current tcpdump.org version, and the WinPcap
port for Windows..
|
| |package_bold| is a pure Python package, based on the low-level
`libcap <https://pypi.org/project/libpcap/>`__ package.
| It is fully compliant implementation of the original
`PyPCAP <https://github.com/pynetwork/pypcap>`__ 1.2.3 API (with some minor
improvements and bug fixes) by implementing whole its functionality in a
clean Python instead of Cython and C.
`PyPI record`_.
`Documentation`_.
About original PyPCAP:
----------------------
Borrowed from the `original website <https://pypcap.readthedocs.io>`__:
PyPCAP
------
This is a simplified object-oriented Python wrapper for libpcap -
the current tcpdump.org version, and the WinPcap port for Windows.
Example use #1::
>>> import pcap
>>> sniffer = pcap.pcap(name=None, promisc=True, immediate=True, timeout_ms=50)
>>> addr = lambda pkt, offset: '.'.join(str(ord(pkt[i])) for i in range(offset, offset + 4))
>>> for ts, pkt in sniffer:
... print('%d\tSRC %-16s\tDST %-16s' % (ts, addr(pkt, sniffer.dloff + 12), addr(pkt, sniffer.dloff + 16)))
...
Example use #2::
Listing Interfaces
>>> import pcap
>>> print ("Interfaces:\n" + '\n'.join(pcap.findalldevs()))
Windows notes
-------------
WinPcap has compatibility issues with Windows 10, therefore
it's recommended to use `Npcap <https://nmap.org/npcap/>`_
(Nmap's packet sniffing library for Windows, based on the WinPcap/Libpcap libraries,
but with improved speed, portability, security, and efficiency).
Please enable WinPcap API-compatible mode during the library installation.
Installation
============
Prerequisites:
+ Python 3.8 or higher
* https://www.python.org/
* with C libpcap 1.8.1 is a primary test environment.
* ATTENTION: currently tested only for Windows.
+ pip and setuptools
* https://pypi.org/project/pip/
* https://pypi.org/project/setuptools/
To install run:
.. parsed-literal::
python -m pip install --upgrade |package|
Development
===========
Prerequisites:
+ Development is strictly based on *tox*. To install it run::
python -m pip install --upgrade tox
Visit `Development page`_.
Installation from sources:
clone the sources:
.. parsed-literal::
git clone |respository| |package|
and run:
.. parsed-literal::
python -m pip install ./|package|
or on development mode:
.. parsed-literal::
python -m pip install --editable ./|package|
License
=======
| Copyright (c) 2016-2024 Adam Karpierz
| Licensed under the BSD license
| https://opensource.org/license/bsd-3-clause
| Please refer to the accompanying LICENSE file.
Authors
=======
* Adam Karpierz <adam@karpierz.net>
.. |package| replace:: pcap-ct
.. |package_bold| replace:: **pcap-ct**
.. |respository| replace:: https://github.com/karpierz/pcap-ct.git
.. _Development page: https://github.com/karpierz/pcap-ct
.. _PyPI record: https://pypi.org/project/pcap-ct/
.. _Documentation: https://pcap-ct.readthedocs.io/
Changelog
=========
1.3.0b2 (2024-08-13)
--------------------
- Add support for Python 3.12 and 3.13
- Drop support for Python 3.7
- Add support for PyPy 3.9 and 3.10
- Drop support for PyPy 3.7 and 3.8
- Setup (dependencies) update.
1.3.0b1 (2022-09-10)
--------------------
- | Support for libpcap.set_buffer_size() via 'buffer_size'
| (optional) pcap constructor's parameter.
- | Added 'datalink' optional parameter to pcap constructor
| (thank you very much easy-easy@Github for the patch!).
- Tox configuration has been moved to pyproject.toml
1.2.3b14 (2022-08-30)
---------------------
- Update for libpcap>=1.11.0b6
- Add support for Python 3.10 and 3.11
- Add preliminary support for PyPy 3.7, 3.8 and 3.9
- Setup update (currently based mainly on pyproject.toml).
1.2.3b12 (2022-01-19)
---------------------
- | Fixed a bug in pcap.sendpacket()
| (thank you very much EvanSonnemans@Github
| for report and bugfix!).
1.2.3b11 (2022-01-10)
---------------------
- Update for libpcap>=1.11.0b3
- Drop support for Python 3.6.
- Copyright year update.
- Setup update.
1.2.3b9 (2021-11-10)
--------------------
- Update for libpcap>=1.11.0b2
- Copyright year update.
- Fixes for Linux.
- Setup update.
1.2.3b5 (2020-10-18)
--------------------
- Add support for Python 3.9.
- Drop support for Python 3.5.
- | Fixed a critical setup of 'libpcap' package
| (thank you very much msrst@Github!).
- General update and cleanup.
- Fixed docs setup.
1.2.3b1 (2019-11-14)
--------------------
- Update for PyPCAP 1.2.3.
- Add support for Python 3.8.
- Drop support for Python 2.
- Drop support for Python 3.4.
- Update required setuptools version.
- Setup improvements and cleanup.
1.2.0b5 (2018-11-08)
--------------------
- Update required setuptools version.
- Minor setup and tests improvements.
1.2.0b4 (2018-02-26)
--------------------
- Improve and simplify setup and packaging.
1.2.0b3 (2018-02-01)
--------------------
- Update for PyPCAP 1.2.0.
1.2.0b2 (2017-10-10)
--------------------
- Minor changes.
1.2.0b1 (2017-10-05)
--------------------
- Next beta release.
- Update for PyPCAP 1.2.0rc.
1.1.6b4 (2017-10-04)
--------------------
- Fourth beta release.
1.1.6b3 (2017-08-28)
--------------------
- Third beta release.
1.1.6b2 (2017-08-28)
--------------------
- Second beta release.
1.1.6b1 (2017-08-27)
--------------------
- First beta release.
1.1.6a15 (2017-08-25)
---------------------
- Next alpha release.
1.1.6a0 (2017-06-10)
--------------------
- First alpha release.
0.0.1 (2016-09-23)
------------------
- Initial release.
Raw data
{
"_id": null,
"home_page": null,
"name": "pcap-ct",
"maintainer": "Adam Karpierz",
"docs_url": null,
"requires_python": "<4.0.0,>=3.8.10",
"maintainer_email": "adam@karpierz.net",
"keywords": "pcap-ct, pcap, libpcap, pypcap, wpcap, npcap",
"author": "Adam Karpierz",
"author_email": "adam@karpierz.net",
"download_url": "https://files.pythonhosted.org/packages/89/95/9e0a516a6f05632b64d496c3ad94e42c8cd2c5b37d81d8b57a6b70c8a5ac/pcap_ct-1.3.0b2.zip",
"platform": "any",
"description": "pcap-ct\r\n=======\r\n\r\nPython wrapper for the *pcap* library.\r\n\r\nOverview\r\n========\r\n\r\n| Python |package_bold| package is a simplified object-oriented Python wrapper\r\n for *libpcap* C library - the current tcpdump.org version, and the WinPcap\r\n port for Windows..\r\n|\r\n| |package_bold| is a pure Python package, based on the low-level\r\n `libcap <https://pypi.org/project/libpcap/>`__ package.\r\n| It is fully compliant implementation of the original\r\n `PyPCAP <https://github.com/pynetwork/pypcap>`__ 1.2.3 API (with some minor\r\n improvements and bug fixes) by implementing whole its functionality in a\r\n clean Python instead of Cython and C.\r\n\r\n`PyPI record`_.\r\n\r\n`Documentation`_.\r\n\r\nAbout original PyPCAP:\r\n----------------------\r\n\r\nBorrowed from the `original website <https://pypcap.readthedocs.io>`__:\r\n\r\nPyPCAP\r\n------\r\n\r\nThis is a simplified object-oriented Python wrapper for libpcap -\r\nthe current tcpdump.org version, and the WinPcap port for Windows.\r\n\r\nExample use #1::\r\n\r\n >>> import pcap\r\n >>> sniffer = pcap.pcap(name=None, promisc=True, immediate=True, timeout_ms=50)\r\n >>> addr = lambda pkt, offset: '.'.join(str(ord(pkt[i])) for i in range(offset, offset + 4))\r\n >>> for ts, pkt in sniffer:\r\n ... print('%d\\tSRC %-16s\\tDST %-16s' % (ts, addr(pkt, sniffer.dloff + 12), addr(pkt, sniffer.dloff + 16)))\r\n ...\r\n\r\nExample use #2::\r\n\r\n Listing Interfaces\r\n\r\n >>> import pcap\r\n >>> print (\"Interfaces:\\n\" + '\\n'.join(pcap.findalldevs()))\r\n\r\nWindows notes\r\n-------------\r\n\r\nWinPcap has compatibility issues with Windows 10, therefore\r\nit's recommended to use `Npcap <https://nmap.org/npcap/>`_\r\n(Nmap's packet sniffing library for Windows, based on the WinPcap/Libpcap libraries,\r\nbut with improved speed, portability, security, and efficiency).\r\nPlease enable WinPcap API-compatible mode during the library installation.\r\n\r\nInstallation\r\n============\r\n\r\nPrerequisites:\r\n\r\n+ Python 3.8 or higher\r\n\r\n * https://www.python.org/\r\n * with C libpcap 1.8.1 is a primary test environment.\r\n * ATTENTION: currently tested only for Windows.\r\n\r\n+ pip and setuptools\r\n\r\n * https://pypi.org/project/pip/\r\n * https://pypi.org/project/setuptools/\r\n\r\nTo install run:\r\n\r\n .. parsed-literal::\r\n\r\n python -m pip install --upgrade |package|\r\n\r\nDevelopment\r\n===========\r\n\r\nPrerequisites:\r\n\r\n+ Development is strictly based on *tox*. To install it run::\r\n\r\n python -m pip install --upgrade tox\r\n\r\nVisit `Development page`_.\r\n\r\nInstallation from sources:\r\n\r\nclone the sources:\r\n\r\n .. parsed-literal::\r\n\r\n git clone |respository| |package|\r\n\r\nand run:\r\n\r\n .. parsed-literal::\r\n\r\n python -m pip install ./|package|\r\n\r\nor on development mode:\r\n\r\n .. parsed-literal::\r\n\r\n python -m pip install --editable ./|package|\r\n\r\nLicense\r\n=======\r\n\r\n | Copyright (c) 2016-2024 Adam Karpierz\r\n | Licensed under the BSD license\r\n | https://opensource.org/license/bsd-3-clause\r\n | Please refer to the accompanying LICENSE file.\r\n\r\nAuthors\r\n=======\r\n\r\n* Adam Karpierz <adam@karpierz.net>\r\n\r\n.. |package| replace:: pcap-ct\r\n.. |package_bold| replace:: **pcap-ct**\r\n.. |respository| replace:: https://github.com/karpierz/pcap-ct.git\r\n.. _Development page: https://github.com/karpierz/pcap-ct\r\n.. _PyPI record: https://pypi.org/project/pcap-ct/\r\n.. _Documentation: https://pcap-ct.readthedocs.io/\r\n\r\nChangelog\r\n=========\r\n\r\n1.3.0b2 (2024-08-13)\r\n--------------------\r\n- Add support for Python 3.12 and 3.13\r\n- Drop support for Python 3.7\r\n- Add support for PyPy 3.9 and 3.10\r\n- Drop support for PyPy 3.7 and 3.8\r\n- Setup (dependencies) update.\r\n\r\n1.3.0b1 (2022-09-10)\r\n--------------------\r\n- | Support for libpcap.set_buffer_size() via 'buffer_size'\r\n | (optional) pcap constructor's parameter.\r\n- | Added 'datalink' optional parameter to pcap constructor\r\n | (thank you very much easy-easy@Github for the patch!).\r\n- Tox configuration has been moved to pyproject.toml\r\n\r\n1.2.3b14 (2022-08-30)\r\n---------------------\r\n- Update for libpcap>=1.11.0b6\r\n- Add support for Python 3.10 and 3.11\r\n- Add preliminary support for PyPy 3.7, 3.8 and 3.9\r\n- Setup update (currently based mainly on pyproject.toml).\r\n\r\n1.2.3b12 (2022-01-19)\r\n---------------------\r\n- | Fixed a bug in pcap.sendpacket()\r\n | (thank you very much EvanSonnemans@Github\r\n | for report and bugfix!).\r\n\r\n1.2.3b11 (2022-01-10)\r\n---------------------\r\n- Update for libpcap>=1.11.0b3\r\n- Drop support for Python 3.6.\r\n- Copyright year update.\r\n- Setup update.\r\n\r\n1.2.3b9 (2021-11-10)\r\n--------------------\r\n- Update for libpcap>=1.11.0b2\r\n- Copyright year update.\r\n- Fixes for Linux.\r\n- Setup update.\r\n\r\n1.2.3b5 (2020-10-18)\r\n--------------------\r\n- Add support for Python 3.9.\r\n- Drop support for Python 3.5.\r\n- | Fixed a critical setup of 'libpcap' package\r\n | (thank you very much msrst@Github!).\r\n- General update and cleanup.\r\n- Fixed docs setup.\r\n\r\n1.2.3b1 (2019-11-14)\r\n--------------------\r\n- Update for PyPCAP 1.2.3.\r\n- Add support for Python 3.8.\r\n- Drop support for Python 2.\r\n- Drop support for Python 3.4.\r\n- Update required setuptools version.\r\n- Setup improvements and cleanup.\r\n\r\n1.2.0b5 (2018-11-08)\r\n--------------------\r\n- Update required setuptools version.\r\n- Minor setup and tests improvements.\r\n\r\n1.2.0b4 (2018-02-26)\r\n--------------------\r\n- Improve and simplify setup and packaging.\r\n\r\n1.2.0b3 (2018-02-01)\r\n--------------------\r\n- Update for PyPCAP 1.2.0.\r\n\r\n1.2.0b2 (2017-10-10)\r\n--------------------\r\n- Minor changes.\r\n\r\n1.2.0b1 (2017-10-05)\r\n--------------------\r\n- Next beta release.\r\n- Update for PyPCAP 1.2.0rc.\r\n\r\n1.1.6b4 (2017-10-04)\r\n--------------------\r\n- Fourth beta release.\r\n\r\n1.1.6b3 (2017-08-28)\r\n--------------------\r\n- Third beta release.\r\n\r\n1.1.6b2 (2017-08-28)\r\n--------------------\r\n- Second beta release.\r\n\r\n1.1.6b1 (2017-08-27)\r\n--------------------\r\n- First beta release.\r\n\r\n1.1.6a15 (2017-08-25)\r\n---------------------\r\n- Next alpha release.\r\n\r\n1.1.6a0 (2017-06-10)\r\n--------------------\r\n- First alpha release.\r\n\r\n0.0.1 (2016-09-23)\r\n------------------\r\n- Initial release.\r\n",
"bugtrack_url": null,
"license": "BSD license ; https://opensource.org/license/bsd-3-clause",
"summary": "Python wrapper for the pcap library.",
"version": "1.3.0b2",
"project_urls": {
"Documentation": "https://pcap-ct.readthedocs.io/",
"Download": "https://pypi.org/project/pcap-ct/",
"Homepage": "https://pypi.org/project/pcap-ct/",
"Issues": "https://github.com/karpierz/pcap-ct/issues",
"Source": "https://github.com/karpierz/pcap-ct"
},
"split_keywords": [
"pcap-ct",
" pcap",
" libpcap",
" pypcap",
" wpcap",
" npcap"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e2a2907a8e4b83b8b42747f186233297b9596dcaa93487103d6e60bf7af8e9d5",
"md5": "a55e5463b2ae40f0ff25163139482ac2",
"sha256": "6ab0c127929a81ff5317011d13477060ce44bceb4793804a7ece7752fcd0878f"
},
"downloads": -1,
"filename": "pcap_ct-1.3.0b2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a55e5463b2ae40f0ff25163139482ac2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.8.10",
"size": 12876,
"upload_time": "2024-08-15T10:51:25",
"upload_time_iso_8601": "2024-08-15T10:51:25.666553Z",
"url": "https://files.pythonhosted.org/packages/e2/a2/907a8e4b83b8b42747f186233297b9596dcaa93487103d6e60bf7af8e9d5/pcap_ct-1.3.0b2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "89959e0a516a6f05632b64d496c3ad94e42c8cd2c5b37d81d8b57a6b70c8a5ac",
"md5": "f11b3cfa6951401f6c3916ad902a1013",
"sha256": "399ef8f1fa5916cd0ba92fe756207abc3a199f275f20521800527c5310b43b63"
},
"downloads": -1,
"filename": "pcap_ct-1.3.0b2.zip",
"has_sig": false,
"md5_digest": "f11b3cfa6951401f6c3916ad902a1013",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.8.10",
"size": 33840,
"upload_time": "2024-08-15T10:51:27",
"upload_time_iso_8601": "2024-08-15T10:51:27.262743Z",
"url": "https://files.pythonhosted.org/packages/89/95/9e0a516a6f05632b64d496c3ad94e42c8cd2c5b37d81d8b57a6b70c8a5ac/pcap_ct-1.3.0b2.zip",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-15 10:51:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "karpierz",
"github_project": "pcap-ct",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pcap-ct"
}