A dead simple, cross-platform Python library to connect to wireless networks.
Project description
wireless
A dead simple, cross-platform Python library to connect to wireless networks.
Description
This library can control a computer’s wireless adapter to connect to a network. Environments currently supported include:
Operating System |
Network Managers |
Tested Adapters |
---|---|---|
Ubuntu 12.04, 14.04 |
nmcli |
Linksys AE3000, Intel Centrino 6250 |
Mac OS 10.10 |
networksetup |
Macbook Pro |
Setup
sudo pip install wireless
To use the nmcli on Ubuntu 14.04, the right permissions must be in place. A few options are listed here.
Usage
A typical usage looks like this:
from wireless import Wireless
wireless = Wireless()
wireless.connect(ssid='ssid', password='password')
API
Wireless([interface]) - initialize the wireless driver
connect(ssid, password) - attempts to connect to a network and returns True on success
current() - returns the name of the current network or None otherwise
interfaces() - list the available interfaces
interface(interface) - get or set the current interface
power(power=True||False) - get or set the power status of the adapter
Publishing
First, install pandoc to auto-convert Markdown syntax into reStructuredText:
sudo apt-get install pandoc
sudo pip install pypandoc
Then, following this guide, push the project to PyPI:
sudo python setup.py sdist upload -r pypi
Change History
This project uses semantic versioning.
v0.2.1 - 2014/12/01
remove dependency on pandoc
v0.2.0 - 2014/11/25
Added support for multiple network adapters with interface() and interfaces() methods
The current() method actually asks the wireless driver for the current SSID instead of returning the name of the most recently connected network
Added the power() method
v0.1.1 - 2014/11/24
Better documentation formatting for PyPI
v0.1.0 - 2014/11/22
Initial release
Contributions
Pull requests to the develop branch are welcomed!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file wireless-0.2.1.tar.gz
.
File metadata
- Download URL: wireless-0.2.1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37007173a45faa7398b1e2b0a9c19714bab75dfa33df93ec061f8501eea76e86 |
|
MD5 | bf869d7bdd962e3d9cd8a3cad1a2f354 |
|
BLAKE2b-256 | 26c6609ced007da5eb27401225a74e914de0091b1953e652d0e3305232fe4e8b |