Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1341d7d

Browse files
committed
Bumped v0.16.0
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parentb0401b5 commit1341d7d

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

‎labstack/client.py‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,36 @@ def image_resize(self, file=None, width=None, height=None, crop=None):
9696
ifnot200<=r.status_code<300:
9797
raiseAPIError(data['code'],data['message'])
9898
returndata
99+
100+
defpdf_compress(self,file=None,quality=None,dpi=None):
101+
files= {'file':open(file,'rb')}
102+
data= {
103+
'quality':quality,
104+
'dpi':dpi
105+
}
106+
r=requests.post(API_URL+'/pdf/compress',auth=self.interceptor,files=files,data=data)
107+
data=r.json()
108+
ifnot200<=r.status_code<300:
109+
raiseAPIError(data['code'],data['message'])
110+
returndata
99111

100-
defpdf_image(self,file=None):
112+
defpdf_image(self,file=None,extract=None):
113+
files= {'file':open(file,'rb')}
114+
data= {
115+
'extract':extract
116+
}
117+
r=requests.post(API_URL+'/pdf/image',auth=self.interceptor,files=files,data=data)
118+
data=r.json()
119+
ifnot200<=r.status_code<300:
120+
raiseAPIError(data['code'],data['message'])
121+
returndata
122+
123+
defpdf_split(self,file=None,pages=None):
101124
files= {'file':open(file,'rb')}
102-
r=requests.post(API_URL+'/pdf/image',auth=self.interceptor,files=files)
125+
data= {
126+
'pages':pages
127+
}
128+
r=requests.post(API_URL+'/pdf/split',auth=self.interceptor,files=files,data=data)
103129
data=r.json()
104130
ifnot200<=r.status_code<300:
105131
raiseAPIError(data['code'],data['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.15.0',
5+
version='0.16.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)

[8]ページ先頭

©2009-2025 Movatter.jp