The pgsql function get_addressdata() does a lookup of a lot of data that is already available in Python.