Skip to content

Commit 0febdb5

Browse files
committed
Bumped v0.19.0
Signed-off-by: Vishal Rana <[email protected]>
1 parent cea1fdc commit 0febdb5

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

labstack/client.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,43 @@ def email_verify(self, email=None):
7777
if self._error(r):
7878
raise APIError(data['code'], data['message'])
7979
return data
80+
81+
def geocode_address(self, location=None, longitude=None, latitude=None, osm_tag=None, limit=None):
82+
json = {
83+
'location': location,
84+
'longitude': longitude,
85+
'latitude': latitude,
86+
'osm_tag': osm_tag,
87+
'limit': limit
88+
}
89+
r = requests.post(API_URL + '/geocode/address', auth=self.interceptor,
90+
json=json)
91+
data = r.json()
92+
if self._error(r):
93+
raise APIError(data['code'], data['message'])
94+
return data
95+
96+
def geocode_ip(self, ip=None):
97+
json = {'ip': ip}
98+
r = requests.post(API_URL + '/geocode/ip', auth=self.interceptor,
99+
json=json)
100+
data = r.json()
101+
if self._error(r):
102+
raise APIError(data['code'], data['message'])
103+
return data
104+
105+
def geocode_reverse(self, longitude=None, latitude=None, limit=None):
106+
json = {
107+
'longitude': longitude,
108+
'latitude': latitude,
109+
'limit': limit
110+
}
111+
r = requests.post(API_URL + '/geocode/reverse', auth=self.interceptor,
112+
json=json)
113+
data = r.json()
114+
if self._error(r):
115+
raise APIError(data['code'], data['message'])
116+
return data
80117

81118
def image_compress(self, file=None):
82119
files = {'file': open(file, 'rb')}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='labstack',
5-
version='0.18.1',
5+
version='0.19.0',
66
description='Official Python client library for the LabStack API',
77
long_description='`<https://github.com/labstack/labstack-python>`_',
88
keywords='image compress, image resize, text summary, barcode generate, barcode scan',

0 commit comments

Comments
 (0)