@@ -44,6 +44,15 @@ def barcode_scan(self, file=None):
4444raise APIError (data ['code' ],data ['message' ])
4545return 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+
4756def image_compress (self ,file = None ):
4857files = {'file' :open (file ,'rb' )}
4958r = 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):
6574if not 200 <= r .status_code < 300 :
6675raise APIError (data ['code' ],data ['message' ])
6776return 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
69110class APIError (Exception ):
70111def __init__ (self ,code ,message ):