Skip to main content

pywifi

Build Status PyPI version

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)

Source distribution for pywifi 1.1.12
File Size Uploaded
pywifi-1.1.12.tar.gz 13.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pywifi 1.1.12
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.1.12 This release

2 release files

1.1.11

2 release files

1.1.10

1 release file

1.1.9

1 release file

1.1.8

1 release file

1.1.7

1 release file

1.1.6

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.9.9

1 release file

0.9.8

1 release file

0.9.7

1 release file

0.9.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page