pytap2


Namepytap2 JSON
Version 2.3.0 PyPI version JSON
download
home_pagehttps://github.com/johnthagen/pytap2
SummaryObject-oriented wrapper around the Linux Tun/Tap device
upload_time2023-04-28 12:44:19
maintainer
docs_urlNone
authorJohn Hagen
requires_python>=3.8
licenseMIT
keywords pytap tun tap networking
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ``pytap2`` - Object oriented interface to Linux Tun/Tap devices
===============================================================

.. image:: https://github.com/johnthagen/pytap2/workflows/python/badge.svg
    :target: https://github.com/johnthagen/pytap2/actions

.. image:: https://codeclimate.com/github/johnthagen/pytap2/badges/gpa.svg
   :target: https://codeclimate.com/github/johnthagen/pytap2

.. image:: https://codeclimate.com/github/johnthagen/pytap2/badges/issue_count.svg
   :target: https://codeclimate.com/github/johnthagen/pytap2

.. image:: https://codecov.io/github/johnthagen/pytap2/coverage.svg
    :target: https://codecov.io/github/johnthagen/pytap2

.. image:: https://img.shields.io/pypi/v/pytap2.svg
    :target: https://pypi.python.org/pypi/pytap2

.. image:: https://img.shields.io/pypi/status/pytap2.svg
    :target: https://pypi.python.org/pypi/pytap2

.. image:: https://img.shields.io/pypi/pyversions/pytap2.svg
    :target: https://pypi.python.org/pypi/pytap2/

Fork of `PyTap <https://pypi.python.org/pypi/PyTap/>`_ that supports Python 3.

Requirements
------------

The ``ifconfig`` command line utility must be installed for ``pytap2`` to operate.

To install ``ifconfig`` on Debian/Ubuntu:

.. code:: shell-session

    $ sudo apt install net-tools

To install ``ifconfig`` on RHEL/Rocky Linux/Fedora:

.. code:: shell-session

    $ sudo yum install net-tools

Installation
------------

You can install, upgrade, and uninstall ``pytap2`` with these commands:

.. code:: shell-session

    $ pip install pytap2
    $ pip install --upgrade pytap2
    $ pip uninstall pytap2

Usage
-----

Using as a context manager automatically brings up the device and closes it at the
end of the ``with`` block.

.. code:: python

    from pytap2 import TapDevice

    with TapDevice() as device:
        device.ifconfig(mtu=1300)
        device.write(b'0000')

Or manually call ``up()`` and ``close()``.

.. code:: python

    from pytap2 import TapDevice

    device = TapDevice()
    device.up()
    device.ifconfig(mtu=1300)
    device.write(b'0000')
    device.close()

The ``fileno()`` method is defined, so that the device object can be passed directly
to `select() <https://docs.python.org/library/select.html#select.select>`_.

Releases
--------

2.3.0 - 2023-04-28
^^^^^^^^^^^^^^^^^^

- Drop Python 3.7 and support Python 3.11
- Support Mypy type checking for users

2.2.0 - 2021-11-06
^^^^^^^^^^^^^^^^^^

- Drop Python 3.6 and support Python 3.10.
- Document dependency on ``ifconfig``

2.1.0 - 2020-12-30
^^^^^^^^^^^^^^^^^^

- Drop Python 3.5 and support Python 3.9.
- Switch to GitHub Actions for CI.

2.0.0 - 2020-03-29
^^^^^^^^^^^^^^^^^^

- Drop Python 2.7.

1.6.0 - 2019-12-15
^^^^^^^^^^^^^^^^^^

- Drop Python 3.4 and support Python 3.8.
- Include license file.

1.5.0 - 2018-07-09
^^^^^^^^^^^^^^^^^^

Support Python 3.7.

1.4.0 - 2017-10-24
^^^^^^^^^^^^^^^^^^

Allow disabling packet information header (``IFF_NO_PI``) and default ``read()`` to read entire
MTU worth of data plus the packet information header if present.

1.3.0 - 2017-07-31
^^^^^^^^^^^^^^^^^^

Add ``fileno()`` method to support ``select()`` calls.

1.2.0 - 2017-06-19
^^^^^^^^^^^^^^^^^^

Context manager support added.

1.1.0 - 2017-06-17
^^^^^^^^^^^^^^^^^^

Allow ``read()`` to be called with a specific number of bytes to read.


1.0.0 - 2017-06-16
^^^^^^^^^^^^^^^^^^

Initial release that supports Python 2 and 3.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/johnthagen/pytap2",
    "name": "pytap2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "pytap,tun,tap,networking",
    "author": "John Hagen",
    "author_email": "johnthagen@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7d/4a/b554c4bd7c38a3a407ecb50627088e1147ff11ca02f66af36b8c3fbc6c91/pytap2-2.3.0.tar.gz",
    "platform": null,
    "description": "``pytap2`` - Object oriented interface to Linux Tun/Tap devices\r\n===============================================================\r\n\r\n.. image:: https://github.com/johnthagen/pytap2/workflows/python/badge.svg\r\n    :target: https://github.com/johnthagen/pytap2/actions\r\n\r\n.. image:: https://codeclimate.com/github/johnthagen/pytap2/badges/gpa.svg\r\n   :target: https://codeclimate.com/github/johnthagen/pytap2\r\n\r\n.. image:: https://codeclimate.com/github/johnthagen/pytap2/badges/issue_count.svg\r\n   :target: https://codeclimate.com/github/johnthagen/pytap2\r\n\r\n.. image:: https://codecov.io/github/johnthagen/pytap2/coverage.svg\r\n    :target: https://codecov.io/github/johnthagen/pytap2\r\n\r\n.. image:: https://img.shields.io/pypi/v/pytap2.svg\r\n    :target: https://pypi.python.org/pypi/pytap2\r\n\r\n.. image:: https://img.shields.io/pypi/status/pytap2.svg\r\n    :target: https://pypi.python.org/pypi/pytap2\r\n\r\n.. image:: https://img.shields.io/pypi/pyversions/pytap2.svg\r\n    :target: https://pypi.python.org/pypi/pytap2/\r\n\r\nFork of `PyTap <https://pypi.python.org/pypi/PyTap/>`_ that supports Python 3.\r\n\r\nRequirements\r\n------------\r\n\r\nThe ``ifconfig`` command line utility must be installed for ``pytap2`` to operate.\r\n\r\nTo install ``ifconfig`` on Debian/Ubuntu:\r\n\r\n.. code:: shell-session\r\n\r\n    $ sudo apt install net-tools\r\n\r\nTo install ``ifconfig`` on RHEL/Rocky Linux/Fedora:\r\n\r\n.. code:: shell-session\r\n\r\n    $ sudo yum install net-tools\r\n\r\nInstallation\r\n------------\r\n\r\nYou can install, upgrade, and uninstall ``pytap2`` with these commands:\r\n\r\n.. code:: shell-session\r\n\r\n    $ pip install pytap2\r\n    $ pip install --upgrade pytap2\r\n    $ pip uninstall pytap2\r\n\r\nUsage\r\n-----\r\n\r\nUsing as a context manager automatically brings up the device and closes it at the\r\nend of the ``with`` block.\r\n\r\n.. code:: python\r\n\r\n    from pytap2 import TapDevice\r\n\r\n    with TapDevice() as device:\r\n        device.ifconfig(mtu=1300)\r\n        device.write(b'0000')\r\n\r\nOr manually call ``up()`` and ``close()``.\r\n\r\n.. code:: python\r\n\r\n    from pytap2 import TapDevice\r\n\r\n    device = TapDevice()\r\n    device.up()\r\n    device.ifconfig(mtu=1300)\r\n    device.write(b'0000')\r\n    device.close()\r\n\r\nThe ``fileno()`` method is defined, so that the device object can be passed directly\r\nto `select() <https://docs.python.org/library/select.html#select.select>`_.\r\n\r\nReleases\r\n--------\r\n\r\n2.3.0 - 2023-04-28\r\n^^^^^^^^^^^^^^^^^^\r\n\r\n- Drop Python 3.7 and support Python 3.11\r\n- Support Mypy type checking for users\r\n\r\n2.2.0 - 2021-11-06\r\n^^^^^^^^^^^^^^^^^^\r\n\r\n- Drop Python 3.6 and support Python 3.10.\r\n- Document dependency on ``ifconfig``\r\n\r\n2.1.0 - 2020-12-30\r\n^^^^^^^^^^^^^^^^^^\r\n\r\n- Drop Python 3.5 and support Python 3.9.\r\n- Switch to GitHub Actions for CI.\r\n\r\n2.0.0 - 2020-03-29\r\n^^^^^^^^^^^^^^^^^^\r\n\r\n- Drop Python 2.7.\r\n\r\n1.6.0 - 2019-12-15\r\n^^^^^^^^^^^^^^^^^^\r\n\r\n- Drop Python 3.4 and support Python 3.8.\r\n- Include license file.\r\n\r\n1.5.0 - 2018-07-09\r\n^^^^^^^^^^^^^^^^^^\r\n\r\nSupport Python 3.7.\r\n\r\n1.4.0 - 2017-10-24\r\n^^^^^^^^^^^^^^^^^^\r\n\r\nAllow disabling packet information header (``IFF_NO_PI``) and default ``read()`` to read entire\r\nMTU worth of data plus the packet information header if present.\r\n\r\n1.3.0 - 2017-07-31\r\n^^^^^^^^^^^^^^^^^^\r\n\r\nAdd ``fileno()`` method to support ``select()`` calls.\r\n\r\n1.2.0 - 2017-06-19\r\n^^^^^^^^^^^^^^^^^^\r\n\r\nContext manager support added.\r\n\r\n1.1.0 - 2017-06-17\r\n^^^^^^^^^^^^^^^^^^\r\n\r\nAllow ``read()`` to be called with a specific number of bytes to read.\r\n\r\n\r\n1.0.0 - 2017-06-16\r\n^^^^^^^^^^^^^^^^^^\r\n\r\nInitial release that supports Python 2 and 3.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Object-oriented wrapper around the Linux Tun/Tap device",
    "version": "2.3.0",
    "split_keywords": [
        "pytap",
        "tun",
        "tap",
        "networking"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d21214dc51cc7191ec3e80cedb4bdc92509145b4fe1f4d4ec1892cb12c268ade",
                "md5": "f586b13c516ff85a1e250f3e26dc46ff",
                "sha256": "a1edc287cf25c61f8fa8415fb6b61e50ac119ef5cd758ce15f2105d2c69f24ef"
            },
            "downloads": -1,
            "filename": "pytap2-2.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f586b13c516ff85a1e250f3e26dc46ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5828,
            "upload_time": "2023-04-28T12:44:17",
            "upload_time_iso_8601": "2023-04-28T12:44:17.059471Z",
            "url": "https://files.pythonhosted.org/packages/d2/12/14dc51cc7191ec3e80cedb4bdc92509145b4fe1f4d4ec1892cb12c268ade/pytap2-2.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d4ab554c4bd7c38a3a407ecb50627088e1147ff11ca02f66af36b8c3fbc6c91",
                "md5": "57d7be09c42967adbdf9269fefa2743e",
                "sha256": "5a90d7b7c7107a438e53c7b27c1baadffe72889ada6024c02d19801fece2c383"
            },
            "downloads": -1,
            "filename": "pytap2-2.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "57d7be09c42967adbdf9269fefa2743e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6327,
            "upload_time": "2023-04-28T12:44:19",
            "upload_time_iso_8601": "2023-04-28T12:44:19.435087Z",
            "url": "https://files.pythonhosted.org/packages/7d/4a/b554c4bd7c38a3a407ecb50627088e1147ff11ca02f66af36b8c3fbc6c91/pytap2-2.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-28 12:44:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "johnthagen",
    "github_project": "pytap2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pytap2"
}
        
Elapsed time: 0.52081s