diff --git a/geouk/resources.py b/geouk/resources.py index 300f24e..5a848a1 100644 --- a/geouk/resources.py +++ b/geouk/resources.py @@ -69,32 +69,40 @@ def random(cls, client, lat, lon, d): return None @classmethod - def search(cls, client, q): + def search(cls, client, q, exclude_ireland=False): """ Fetch a list of places that match the given query string. """ + params = {'q': q} + if exclude_ireland: + params['exclude_ireland'] = True + # Fetch the matching places r = client( 'get', 'places/search', - params={'q': q} + params=params ) return [cls(client, p) for p in r] @classmethod - def typeahead(cls, client, q): + def typeahead(cls, client, q, exclude_ireland=False): """ Return a list of place names and postcodes starting with the query string's first 2 characters """ + params = {'q': q} + if exclude_ireland: + params['exclude_ireland'] = True + # Fetch the typeahead results r = client( 'get', 'places/typeahead', - params={'q': q} + params=params ) return r diff --git a/setup.py b/setup.py index 754e079..a1b87db 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.0.5', + version='0.0.6', description=( 'The GeoUK Python library provides a pythonic interface to the GeoUK ' 'API.',