pywifi
pywifi provides a cross-platform Python module for manipulating wireless interfaces.
- Easy to use
- Supports Windows and Linux
Prerequisites
On Linux, you will need to run wpa_supplicant to manipulate the wifi devices, and then pywifi can communicate with wpa_supplicant through socket.
On Windows, the Native Wifi component comes with Windows versions greater than Windows XP SP2.
Installation
After installing the prerequisites listed above for your platform, you can use pip to install from source:
cd pywifi/
pip install .
Documentation
For the details of pywifi, please refer to Documentation.
Example
import pywifi
wifi = pywifi.PyWiFi()
iface = wifi.interfaces()[0]
iface.disconnect()
time.sleep(1)
assert iface.status() in\
[const.IFACE_DISCONNECTED, const.IFACE_INACTIVE]
profile = pywifi.Profile()
profile.ssid = 'testap'
profile.auth = const.AUTH_ALG_OPEN
profile.akm.append(const.AKM_TYPE_WPA2PSK)
profile.cipher = const.CIPHER_TYPE_CCMP
profile.key = '12345678'
iface.remove_all_network_profiles()
tmp_profile = iface.add_network_profile(profile)
iface.connect(tmp_profile)
time.sleep(30)
assert iface.status() == const.IFACE_CONNECTED
iface.disconnect()
time.sleep(1)
assert iface.status() in\
[const.IFACE_DISCONNECTED, const.IFACE_INACTIVE]
(C) Jiang Sheng-Jhih 2019, MIT License.
Release files for pywifi 1.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pywifi-1.1.12.tar.gz | 13.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pywifi-1.1.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.8 kB
Release files / pywifi-1.1.12.tar.gz
| Download URL | pywifi-1.1.12.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6da15de5d573635a461a95919920788b6f61748e1bd93a5e3504f456cf2e8bcc
|
|
BLAKE2b-256 checksum How to use checksums |
b483af4c284db4a9c87af92525f1d755426e9dc04aef80be8c54b0ae6628105d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.5
|
Release files / pywifi-1.1.12-py3-none-any.whl
| Download URL | pywifi-1.1.12-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1b79d9ff054eef1aca4ab97f2641650d001d6740bfa7666a7d9506bcfb8459b
|
|
BLAKE2b-256 checksum How to use checksums |
8955170a52685eeefeab36bfaf26bdca629263a0a28efffc3b556b2cc86ab966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.5
|