Skip to content

Commit e2f51e4

Browse files
committed
Bumped v0.11.0
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent 701228d commit e2f51e4

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

labstack/client.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ def barcode_scan(self, file=None):
4444
raise APIError(data['code'], data['message'])
4545
return data
4646

47+
def email_verify(self, email=None):
48+
json = {'email': email}
49+
r = requests.post(API_URL + '/email/verify', auth=self.interceptor,
50+
json=json)
51+
data = r.json()
52+
if not 200 <= r.status_code < 300:
53+
raise APIError(data['code'], data['message'])
54+
return data
55+
4756
def image_compress(self, file=None):
4857
files = {'file': open(file, 'rb')}
4958
r = requests.post(API_URL + '/image/compress', auth=self.interceptor, files=files)
@@ -65,6 +74,38 @@ def image_resize(self, file=None, width=None, height=None, crop=None):
6574
if not 200 <= r.status_code < 300:
6675
raise APIError(data['code'], data['message'])
6776
return data
77+
78+
def text_sentiment(self, text=None):
79+
json = {'text': text}
80+
r = requests.post(API_URL + '/text/sentiment', auth=self.interceptor,
81+
json=json)
82+
data = r.json()
83+
if not 200 <= r.status_code < 300:
84+
raise APIError(data['code'], data['message'])
85+
return data
86+
87+
def text_spell_check(self, text=None):
88+
json = {'text': text}
89+
r = requests.post(API_URL + '/text/spell-check', auth=self.interceptor,
90+
json=json)
91+
data = r.json()
92+
if not 200 <= r.status_code < 300:
93+
raise APIError(data['code'], data['message'])
94+
return data
95+
96+
def text_summary(self, text=None, url=None, language=None, length=None):
97+
json = {
98+
'text': text,
99+
'url': url,
100+
'language': language,
101+
'length': length
102+
}
103+
r = requests.post(API_URL + '/text/summary', auth=self.interceptor,
104+
json=json)
105+
data = r.json()
106+
if not 200 <= r.status_code < 300:
107+
raise APIError(data['code'], data['message'])
108+
return data
68109

69110
class APIError(Exception):
70111
def __init__(self, code, message):

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.10.1',
5+
version='0.11.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)