Skip to content

Commit

Permalink
Trailing whitespace fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pilona authored and DenisCarriere committed Feb 28, 2015
1 parent 4bb3a22 commit bb607d5
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 59 deletions.
24 changes: 12 additions & 12 deletions geocoder/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,36 +132,36 @@ def bing(location, **kwargs):

def yahoo(location, **kwargs):
"""Yahoo Provider
:param ``location``: Your search location you want geocoded.
"""
return get(location, provider='yahoo', **kwargs)

def geolytica(location, **kwargs):
"""Geolytica (Geocoder.ca) Provider
:param location: Your search location you want geocoded.
"""
return get(location, provider='geolytica', **kwargs)

def opencage(location, **kwargs):
"""Opencage Provider
:param ``location``: Your search location you want geocoded.
:param ``key``: (optional) use your own API Key from OpenCage.
"""
return get(location, provider='opencage', **kwargs)

def arcgis(location, **kwargs):
"""ArcGIS Provider
:param ``location``: Your search location you want geocoded.
"""
return get(location, provider='arcgis', **kwargs)

def here(location, **kwargs):
"""HERE Provider
:param location: Your search location you want geocoded.
:param app_code: (optional) use your own Application Code from HERE.
:param app_id: (optional) use your own Application ID from HERE.
Expand All @@ -173,7 +173,7 @@ def here(location, **kwargs):

def nokia(location, **kwargs):
"""HERE Provider
:param location: Your search location you want geocoded.
:param app_code: (optional) use your own Application Code from HERE.
:param app_id: (optional) use your own Application ID from HERE.
Expand All @@ -185,15 +185,15 @@ def nokia(location, **kwargs):

def tomtom(location, **kwargs):
"""TomTom Provider
:param location: Your search location you want geocoded.
:param key: (optional) use your own API Key from TomTom.
"""
return get(location, provider='tomtom', **kwargs)

def mapquest(location, **kwargs):
"""MapQuest Provider
:param location: Your search location you want geocoded.
:param key: (optional) use your own API Key from MapQuest.
:param method: (default=geocode) Use the following:
Expand All @@ -204,7 +204,7 @@ def mapquest(location, **kwargs):

def osm(location, **kwargs):
"""OSM Provider
:param location: Your search location you want geocoded.
:param url: Custom OSM Server URL location (ex: http://nominatim.openstreetmap.org/search)
"""
Expand Down Expand Up @@ -236,23 +236,23 @@ def ip(location, **kwargs):

def canadapost(location, **kwargs):
"""CanadaPost Provider
:param ``location``: Your search location you want geocoded.
:param ``key``: (optional) use your own API Key from CanadaPost Address Complete.
"""
return get(location, provider='canadapost', **kwargs)

def postal(location, **kwargs):
"""CanadaPost Provider
:param ``location``: Your search location you want geocoded.
:param ``key``: (optional) use your own API Key from CanadaPost Address Complete.
"""
return get(location, provider='canadapost', **kwargs)

def geonames(location, **kwargs):
"""GeoNames Provider
:param ``location``: Your search location you want geocoded.
:param ``username``: (required) needs to be passed with each request.
"""
Expand Down
2 changes: 1 addition & 1 deletion geocoder/arcgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ def bbox(self):

if __name__ == '__main__':
g = Arcgis('453 Booth, Ottawa, ON')
g.debug()
g.debug()
20 changes: 10 additions & 10 deletions geocoder/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ class Base(object):
def __repr__(self):
if self.address:
return "<[{0}] {1} - {2} [{3}]>".format(
self.status,
self.provider.title(),
self.method.title(),
self.status,
self.provider.title(),
self.method.title(),
self.address
)
else:
return "<[{0}] {1} - {2}>".format(
self.status,
self.provider.title(),
self.status,
self.provider.title(),
self.method.title()
)

Expand All @@ -62,9 +62,9 @@ def _connect(self, **kwargs):
self.proxies = kwargs.get('proxies', '')
try:
r = self.rate_limited_get(
self.url,
params=self.params,
headers=self.headers,
self.url,
params=self.params,
headers=self.headers,
timeout=self.timeout,
proxies=self.proxies
)
Expand Down Expand Up @@ -198,7 +198,7 @@ def _get_bbox(self, south, west, north, east):
# GeoJSON bbox
self.westsouth = [west, south]
self.eastnorth = [east, north]

if bool(south and east and north and west):
bbox = {
'northeast': [north, east],
Expand Down Expand Up @@ -295,7 +295,7 @@ def geojson(self):
def wkt(self):
if self.ok:
return 'POINT({x} {y})'.format(x=self.x, y=self.y)
return ''
return ''

@property
def latlng(self):
Expand Down
4 changes: 2 additions & 2 deletions geocoder/bing.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _exceptions(self):
def lat(self):
coord = self.parse['point']['coordinates']
if coord:
return coord[0]
return coord[0]

@property
def lng(self):
Expand Down Expand Up @@ -149,4 +149,4 @@ def bbox(self):
if __name__ == '__main__':
#g = Bing('1552 Payette dr, Ottawa ON')
g = Bing('Ottawa ON')
g.debug()
g.debug()
2 changes: 1 addition & 1 deletion geocoder/bing_reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ def ok(self):

if __name__ == '__main__':
g = BingReverse([45.4049053, -75.7077965])
g.debug()
g.debug()
8 changes: 4 additions & 4 deletions geocoder/canadapost.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Canadapost(Base):
"""
provider = 'canadapost'
method = 'geocode'

def __init__(self, location, **kwargs):
self.url = 'https://ws1.postescanada-canadapost.ca/AddressComplete'
self.url += '/Interactive/RetrieveFormatted/v2.00/json3ex.ws'
Expand All @@ -64,7 +64,7 @@ def __init__(self, location, **kwargs):
if not self.key:
self._retrieve_key()
self._retrieve_id()

# Define parameters
self.params = {
'Key': self.key,
Expand Down Expand Up @@ -115,7 +115,7 @@ def _retrieve_id(self, last_id=''):
items = None
self.status_code = 404
self.error = 'ERROR - URL Connection'

if items:
items = items[0]
item_id = items['Id']
Expand Down Expand Up @@ -174,4 +174,4 @@ def country(self):

if __name__ == '__main__':
g = Canadapost("453 Booth Street, Ottawa")
g.debug()
g.debug()
6 changes: 3 additions & 3 deletions geocoder/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def cli():
for item in input:
item = item.strip()
g = get(item, provider=args.provider)

if args.geojson:
output = g.geojson
elif args.osm:
Expand All @@ -45,5 +45,5 @@ def cli():
params = {'indent': 4}
else:
params = {}
args.outfile.write("{}\n".format(json.dumps(output, **params)))

args.outfile.write("{}\n".format(json.dumps(output, **params)))
4 changes: 2 additions & 2 deletions geocoder/elevation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ def feet(self):
@property
def elevation(self):
return self.parse.get('elevation')

@property
def resolution(self):
return self.parse.get('resolution')

if __name__ == '__main__':
g = Elevation([45.123, -76.123])
g.debug()
g.debug()
12 changes: 6 additions & 6 deletions geocoder/freegeoip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class FreeGeoIP(Base):
"""
FreeGeoIP.net
=============
freegeoip.net provides a public HTTP API for software developers to
search the geolocation of IP addresses. It uses a database of IP addresses
that are associated to cities along with other relevant information like
freegeoip.net provides a public HTTP API for software developers to
search the geolocation of IP addresses. It uses a database of IP addresses
that are associated to cities along with other relevant information like
time zone, latitude and longitude.
You're allowed up to 10,000 queries per hour by default. Once this
limit is reached, all of your requests will result in HTTP 403,
forbidden, until your quota is cleared.
You're allowed up to 10,000 queries per hour by default. Once this
limit is reached, all of your requests will result in HTTP 403,
forbidden, until your quota is cleared.
API Reference
-------------
Expand Down
2 changes: 1 addition & 1 deletion geocoder/geolytica.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ def address(self):

if __name__ == '__main__':
g = Geolytica('1552 Payette dr., Ottawa')
g.debug()
g.debug()
4 changes: 2 additions & 2 deletions geocoder/geonames.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def lat(self):
@property
def lng(self):
return self.parse.get('lng')

@property
def address(self):
return self.parse.get('name')
Expand Down Expand Up @@ -116,4 +116,4 @@ def population(self):

if __name__ =='__main__':
g = Geonames('Ottawa, Ontario')
g.debug()
g.debug()
2 changes: 1 addition & 1 deletion geocoder/google_reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def ok(self):

if __name__ == '__main__':
g = GoogleReverse([45.4049053, -75.7077965])
g.debug()
g.debug()
4 changes: 2 additions & 2 deletions geocoder/here.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Here(Base):
"""
HERE Geocoding REST API
=======================
Send a request to the geocode endpoint to find an address
using a combination of country, state, county, city,
Send a request to the geocode endpoint to find an address
using a combination of country, state, county, city,
postal code, district, street and house number.
API Reference
Expand Down
4 changes: 2 additions & 2 deletions geocoder/here_reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class HereReverse(Base):
"""
HERE Geocoding REST API
=======================
Send a request to the geocode endpoint to find an address
using a combination of country, state, county, city,
Send a request to the geocode endpoint to find an address
using a combination of country, state, county, city,
postal code, district, street and house number.
API Reference
Expand Down
2 changes: 1 addition & 1 deletion geocoder/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _check_for_list(self, location):
lng = self._convert_float(location[1])
condition_1 = isinstance(lat, float)
condition_2 = isinstance(lng, float)

# Check if input are Floats
if bool(condition_1 and condition_2):
condition_3 = lat <= 90 and lat >= -90
Expand Down
4 changes: 2 additions & 2 deletions geocoder/mapquest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Mapquest(Base):
MapQuest
========
The geocoding service enables you to take an address and get the
associated latitude and longitude. You can also use any latitude
and longitude pair and get the associated address. Three types of
associated latitude and longitude. You can also use any latitude
and longitude pair and get the associated address. Three types of
geocoding are offered: address, reverse, and batch.
API Reference
Expand Down
6 changes: 3 additions & 3 deletions geocoder/mapquest_reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class MapquestReverse(Mapquest, Base):
MapQuest
========
The geocoding service enables you to take an address and get the
associated latitude and longitude. You can also use any latitude
and longitude pair and get the associated address. Three types of
associated latitude and longitude. You can also use any latitude
and longitude pair and get the associated address. Three types of
geocoding are offered: address, reverse, and batch.
API Reference
-------------
http://www.mapquestapi.com/geocoding/
"""
provider = 'mapquest'
method = 'reverse'
Expand Down
4 changes: 2 additions & 2 deletions geocoder/opencage.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OpenCage(Base):
[x] addr:state
[x] addr:country
[x] addr:postal
Attributes (27/29)
------------------
[x] DMS
Expand Down Expand Up @@ -89,7 +89,7 @@ def _exceptions(self):
licenses = self.parse['licenses']
if licenses:
self.parse['licenses'] = licenses[0]

@property
def lat(self):
return self.parse['geometry'].get('lat')
Expand Down

0 comments on commit bb607d5

Please sign in to comment.