I'm sure there must be an easier way (over DBus) than this, but there is a python-wifi package in the repo's which should do what you need? Example usage here.