@@ -44,6 +44,15 @@ def barcode_scan(self, file=None):
44
44
raise APIError (data ['code' ], data ['message' ])
45
45
return data
46
46
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
+
47
56
def image_compress (self , file = None ):
48
57
files = {'file' : open (file , 'rb' )}
49
58
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):
65
74
if not 200 <= r .status_code < 300 :
66
75
raise APIError (data ['code' ], data ['message' ])
67
76
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
68
109
69
110
class APIError (Exception ):
70
111
def __init__ (self , code , message ):
0 commit comments