py-wifi-helper
This is a Python tool/library developed for macOS 13.5, Ubuntu 22.04, and Windows 10/11, primarily providing operations for wireless interfaces. It includes functionalities such as listing available wireless interfaces, scanning for WiFi signals using a specified wireless interface, connecting a chosen wireless interface to a specific WiFi access point, retrieving information about the connected WiFi access points for the specified wireless interface, and disconnecting the specified wireless interface.
Installation
Dependencies
Windows
pip install pywifi comtypes
macOS
pip install "pyobjc-core>=9.2" "pyobjc-framework-Cocoa>=9.2" "pyobjc-framework-CoreWLAN>=9.2"
Ubuntu
Requires nmcli to be installed:
sudo apt-get install network-manager
Usage
% py-wifi-helper --help
usage: py-wifi-helper [-h] [--action {device,scan,connect,disconnect}] [--device DEVICE] [--ssid SSID] [--password PASSWORD] [--scanner-path SCANNER_PATH]
options:
-h, --help show this help message and exit
--action {device,scan,connect,disconnect}
command action
--device DEVICE interface
--ssid SSID ssid
--password PASSWORD password
--scanner-path SCANNER_PATH
Path to WiFiScanner.app (macOS only)
Windows
> py-wifi-helper
{
"version": "1.0.0",
"device": {
"default": "Intel(R) Wi-Fi 6 AX201 160MHz",
"list": [
"Intel(R) Wi-Fi 6 AX201 160MHz"
],
"error": null,
"select": "Intel(R) Wi-Fi 6 AX201 160MHz"
},
"connection": {
"default": {
"ssid": "MyWiFi",
"log": null
},
"Intel(R) Wi-Fi 6 AX201 160MHz": {
"ssid": "MyWiFi",
"log": null
}
},
"action": {
"name": "device",
"status": true,
"error": null,
"log": null
}
}
Ubuntu
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
$ sudo py-wifi-helper
{
"version": "1.0.0",
"device": {
"default": "wlxd1234567890",
"list": [
"wlxd1234567890"
],
"error": null,
"select": "wlxd1234567890"
},
"connection": {
"default": {
"ssid": null,
"log": null
},
"wlxd1234567890": {
"ssid": null,
"log": null
}
},
"action": {
"name": "device",
"status": true,
"error": null,
"log": null
}
}
macOS
Setup Location Services Permission
Starting from macOS 15+, scanning WiFi networks requires Location Services permission. You need to set up WiFiScanner.app first:
# Default setup (creates WiFiScanner.app in current directory)
py-wifi-helper-macos-setup
# Or specify a custom location
py-wifi-helper-macos-setup --target-path ~/Applications/WiFiScanner.app
After setup, you'll need to:
- Allow Location Services access when prompted
- Or manually enable Location Services for WiFiScanner in System Settings > Privacy & Security > Location Services
Basic Usage
% sw_vers
ProductName: macOS
ProductVersion: 13.5
BuildVersion: 22G74
% py-wifi-helper
{
"version": "1.0.0",
"device": {
"default": "en0",
"list": [
"en0"
],
"error": null,
"select": "en0"
},
"connection": {
"default": {
"ssid": "MyHomeWIFIAP",
"log": null
},
"en0": {
"ssid": "MyHomeWIFIAP",
"log": null
}
},
"action": {
"name": "device",
"status": true,
"error": null,
"log": null
}
}
For scanning operations, you can either use the default WiFiScanner.app location or specify a custom path:
# Use default WiFiScanner.app location
py-wifi-helper --action scan
# Use custom WiFiScanner.app location
py-wifi-helper --action scan --scanner-path ~/Applications/WiFiScanner.app
Examples
Scan for WiFi Networks
py-wifi-helper --action scan
Connect to WiFi
py-wifi-helper --action connect --ssid "MyWiFi" --password "12345678"
Disconnect from WiFi
py-wifi-helper --action disconnect
Use Specific Interface
py-wifi-helper --action scan --device "wlan0"
Notes
- Windows requires administrator privileges for some operations
- Ubuntu requires sudo for network operations
- macOS requires Location Services permission for WiFi scanning (set up using
py-wifi-helper-macos-setup)
Platform Support
- Windows 10/11 (via pywifi)
- macOS 13.5+ (via CoreWLAN)
- Ubuntu 22.04+ (via nmcli)
Release files for py-wifi-helper 2.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_wifi_helper-2.0.4.tar.gz | 35.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_wifi_helper-2.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 73.1 kB
Release files / py_wifi_helper-2.0.4.tar.gz
| Download URL | py_wifi_helper-2.0.4.tar.gz |
|---|---|
| Size | 35.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d40145ecd87704ec6b809dfc5bd5546301ecadedae1cbe54f08abf94f5de814c
|
|
BLAKE2b-256 checksum How to use checksums |
437a0d80eb122d28af48c5c7edf8cfb4c8f85ff9ad0caefdb3649dffb82a4f8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.
Transparency logRelease files / py_wifi_helper-2.0.4-py3-none-any.whl
| Download URL | py_wifi_helper-2.0.4-py3-none-any.whl |
|---|---|
| Size | 37.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e97665ce59017dd3aaba03bd152958310d965bba6f49f55605ea24d433aa1f0
|
|
BLAKE2b-256 checksum How to use checksums |
bcff9fd19ac665f9e3e39eebb58f1022d06a6c14bb2f6d15e16b69d42f482d12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.
Transparency log