wpa_pyfi provides a command line wrapper for iwlist and /etc/wpa_supplicant/wpa_supplicant.conf that makes it easier to connect the WiFi networks from the command line, specifically on a a Raspberry Pi Device. The wpa_pyfi command is also implemented as a library that can be used from Python.
$ pip install wpa_pyfi $ wpa_pyfi --help
Note
The documentation for wpa_pyfi lives at https://wpa_pyfi.readthedocs.org/en/latest/.
Wpa_pyfi is based off of the archived wifi library originally created by Rocky Meza: https://github.com/rockymeza/wifi.git