Skip to content

Commit 60ba7d4

Browse files
committed
Bumped v0.12.0
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent e2f51e4 commit 60ba7d4

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
@@ -43,6 +43,18 @@ def barcode_scan(self, file=None):
4343
if not 200 <= r.status_code < 300:
4444
raise APIError(data['code'], data['message'])
4545
return data
46+
47+
def dns_lookup(self, domain=None, type=None):
48+
json = {
49+
'domain': domain,
50+
'type': type
51+
}
52+
r = requests.post(API_URL + '/dns/lookup', auth=self.interceptor,
53+
json=json)
54+
data = r.json()
55+
if not 200 <= r.status_code < 300:
56+
raise APIError(data['code'], data['message'])
57+
return data
4658

4759
def email_verify(self, email=None):
4860
json = {'email': email}
@@ -75,6 +87,22 @@ def image_resize(self, file=None, width=None, height=None, crop=None):
7587
raise APIError(data['code'], data['message'])
7688
return data
7789

90+
def pdf_extract_image(self, file=None):
91+
files = {'file': open(file, 'rb')}
92+
r = requests.post(API_URL + '/pdf/extract-image', auth=self.interceptor, files=files)
93+
data = r.json()
94+
if not 200 <= r.status_code < 300:
95+
raise APIError(data['code'], data['message'])
96+
return data
97+
98+
def pdf_to_image(self, file=None):
99+
files = {'file': open(file, 'rb')}
100+
r = requests.post(API_URL + '/pdf/to-image', auth=self.interceptor, files=files)
101+
data = r.json()
102+
if not 200 <= r.status_code < 300:
103+
raise APIError(data['code'], data['message'])
104+
return data
105+
78106
def text_sentiment(self, text=None):
79107
json = {'text': text}
80108
r = requests.post(API_URL + '/text/sentiment', auth=self.interceptor,
@@ -107,6 +135,15 @@ def text_summary(self, text=None, url=None, language=None, length=None):
107135
raise APIError(data['code'], data['message'])
108136
return data
109137

138+
def word_lookup(self, word=None):
139+
json = {'word': word}
140+
r = requests.post(API_URL + '/word/lookup', auth=self.interceptor,
141+
json=json)
142+
data = r.json()
143+
if not 200 <= r.status_code < 300:
144+
raise APIError(data['code'], data['message'])
145+
return data
146+
110147
class APIError(Exception):
111148
def __init__(self, code, message):
112149
self.code = code

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