Cpywpa
Introduction
Cpywpa is another simple tool to control wpa_supplicant for Python. However, rather than using d-Bus, it wrote with Cython so it can directly use OFFICIAL C interface.
Installation
First, make sure you have the latest pip
python3 -m pip install --upgrade pip
Then you can install Cpywpa with this command
python3 -m pip install Cpywpa
Here is the dependent packages and they will be installed during installation.
| package name | version |
|---|---|
| setuptools | None |
| wheel | None |
| Cython | None |
How to use
⚠ NOTE ⚠
While only root user can access wpa_supplicant interface, all codes below are running with sudo or by root user.
- Get current network status
from Cpywpa import NetworkManager
from pprint import pprint
manager = NetworkManager()
pprint(manager.getStatus())
- List known network
from Cpywpa import NetworkManager
from pprint import pprint
manager = NetworkManager()
pprint(manager.listNetwork())
- Scan network around and get scan results
from Cpywpa import NetworkManager
from pprint import pprint
from time import sleep
manager = NetworkManager()
# you can use scan() to scan and get scan results
# use scan_time to set sleep time
pprint(manager.scan(scan_time=8))
# or use onlyScan() to scan and use scanResults() to get results
manager.onlyScan()
sleep(10)
pprint(manager.scanResults())
- Connect to a network
from Cpywpa import NetworkManager
manager = NetworkManager()
# connect to a known network
# Syize is my wifi name
manager.connect('Syize')
# connect to a new network
manager.connect('Syize', passwd='wifi-password')
- Add a network but don't connect
from Cpywpa import NetworkManager
manager = NetworkManager()
manager.addNetwork('Syize', 'wifi-password')
- Delete a network
from Cpywpa import NetworkManager
manager = NetworkManager()
manager.removeNetwork('Syize')
For more information, please head to GitHub
Metadata
Release files for Cpywpa 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Cpywpa-1.0.1.tar.gz | 97.1 kB | Without provenance | Details for Cpywpa-1.0.1.tar.gz |
Release files / Cpywpa-1.0.1.tar.gz
| Download URL | Cpywpa-1.0.1.tar.gz |
|---|---|
| Size | 97.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be3e2a7d7ff275c41c2d22bb7d5503993bdfdde50bd0103a6d3dc48a01d123f2
|
|
BLAKE2b-256 checksum How to use checksums |
48e1fd11edfbb56cd77d435bad82a9d10e66d48694f4511bc56c856ff733bf7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Security for Cpywpa 1.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.