Object-oriented wrapper around the Linux Tun/Tap device for Python 2 and 3
Project description
Fork of PyTap that supports Python 3.
Installation
You can install, upgrade, and uninstall pytap2 with these commands:
$ 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.
from pytap2 import TapDevice
with TapDevice() as device:
device.ifconfig(mtu=1300)
device.write(b'0000')
Or manually call up() and close().
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().
Releases
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytap2-2.1.0.tar.gz
.
File metadata
- Download URL: pytap2-2.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf511384935f6eefcda015c739dfc76ace0d40e92e9f88b033172ff5c8b2eb61 |
|
MD5 | d9af8cf6d65036148e548662b028e906 |
|
BLAKE2b-256 | 7fa6da631bbd123515ee1304b10ba3906700d491a1f28ea8f5f847af1a4f4519 |
Provenance
File details
Details for the file pytap2-2.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytap2-2.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23f43fefce0795318b15b9ca3878f09d60349c63d083050bd549d8a2d0b79660 |
|
MD5 | 0178b929bfaea6570d8e6ee3fe7aa0f8 |
|
BLAKE2b-256 | ec1b81e9e2f99874546f0686a5f1ab1b977a19b105e0863754d9da31903639ce |