slimkrazy/python-google-places — pull request #27 by commadelimited (2014-09-11 20:10:24+00:00)
Title: Add Places Autocomplete functionality

This pull request adds Places Autocomplete functionality to this library. It includes a new method on the `GooglePlaces` class: `autocomplete`, a new new `GoogleAutocompleteSearchResult`, as well as a new `Prediction` class to handle responses from the autocomplete endpoint. Finally, it includes an additional passing unit test (with fixture data).

Here's a quick demo setup:

```
from googleplaces import (
GooglePlaces,
types,
lang
)

API_KEY =

google_places = GooglePlaces(API_KEY)

# query_result = google_places.autocomplete(
# input='Cuba',
# language=lang.SPANISH,
# types=types.AC_TYPE_CITIES,
# location=dict(lat=40.7310523, lng=-73.99348)
# )

# query_result = google_places.autocomplete(
# input='Hattie',
# location=dict(lat=36.1528232, lng=-86.7838999)
# )

# nearby search demo
# query_result = google_places.nearby_search(
# location='Nashville, TN', keyword='Fish and Chips',
# radius=20000, types=[types.TYPE_FOOD])

```