Skip to content

Commit fe3fd03

Browse files
committed
20220822 update : support rotate row and column.
1 parent ce3047c commit fe3fd03

File tree

6 files changed

+173
-9
lines changed

6 files changed

+173
-9
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![PyPI](https://img.shields.io/pypi/v/asposecellscloud) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/asposecellscloud) ![PyPI - Downloads](https://img.shields.io/pypi/dm/asposecellscloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-python)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-python/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-python/22.7)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![PyPI](https://img.shields.io/pypi/v/asposecellscloud) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/asposecellscloud) ![PyPI - Downloads](https://img.shields.io/pypi/dm/asposecellscloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-python)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-python/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-python/22.8)
22

33

44
# Python SDK for Spreadsheet Processing in Cloud
@@ -21,11 +21,10 @@ Python Cloud SDK wraps Aspose.Cells REST API so you could seamlessly integrate M
2121
- Convert worksheets to PDF, XPS & SVG formats.
2222
- Inter-convert files to popular Excel formats.
2323

24-
## Feature & Enhancements in Version 22.7
25-
26-
- Add 4 kinds of Save Option.
27-
- Add the checkExcelRestriction parameter for multiple APIs.
24+
## Feature & Enhancements in Version 22.8
2825

26+
- Support transposing Excel Rows to Columns.
27+
2928
## Read & Write Spreadsheet Formats
3029

3130
**Microsoft Excel:** XLS, XLSX, XLSB, XLSM, XLT, XLTX, XLTM

asposecellscloud/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
8383
self.host = host
8484
self.cookie = cookie
8585
# Set default User-Agent.
86-
self.user_agent = 'Swagger-Codegen/22.5/python'
86+
self.user_agent = 'Swagger-Codegen/22.8/python'
8787

8888
@property
8989
def user_agent(self):

asposecellscloud/apis/light_cells_api.py

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,3 +2048,130 @@ def post_reverse_with_http_info(self, file, rotate_type, format, **kwargs):
20482048
_preload_content=params.get('_preload_content', True),
20492049
_request_timeout=params.get('_request_timeout'),
20502050
collection_formats=collection_formats)
2051+
2052+
def post_rotate(self, file, rotate_type, format, **kwargs):
2053+
"""
2054+
This method makes a synchronous HTTP request by default. To make an
2055+
asynchronous HTTP request, please define a `callback` function
2056+
to be invoked when receiving the response.
2057+
>>> def callback_function(response):
2058+
>>> pprint(response)
2059+
>>>
2060+
>>> thread = api.post_rotate(file, text, color, callback=callback_function)
2061+
2062+
:param callback function: The callback function
2063+
for asynchronous request. (optional)
2064+
:param file file: File to upload (required)
2065+
:param str rotate_type: (required)
2066+
:param str format: (required)
2067+
:param str type:checkExcelRestriction
2068+
:return: FilesResult
2069+
If the method is called asynchronously,
2070+
returns the request thread.
2071+
"""
2072+
kwargs['_return_http_data_only'] = True
2073+
self.check_access_token()
2074+
if kwargs.get('callback'):
2075+
return self.post_rotate_with_http_info(file, rotate_type, format, **kwargs)
2076+
else:
2077+
(data) = self.post_rotate_with_http_info(file, rotate_type, format, **kwargs)
2078+
return data
2079+
2080+
def post_rotate_with_http_info(self, file, rotate_type, format, **kwargs):
2081+
"""
2082+
This method makes a synchronous HTTP request by default. To make an
2083+
asynchronous HTTP request, please define a `callback` function
2084+
to be invoked when receiving the response.
2085+
>>> def callback_function(response):
2086+
>>> pprint(response)
2087+
>>>
2088+
>>> thread = api.post_rotate_with_http_info(file, rotateType, format, callback=callback_function)
2089+
2090+
:param callback function: The callback function
2091+
for asynchronous request. (optional)
2092+
:param file file: File to upload (required)
2093+
:param str rotateType: (required)
2094+
:param str format: (required)
2095+
:param str type:checkExcelRestriction
2096+
:return: FilesResult
2097+
If the method is called asynchronously,
2098+
returns the request thread.
2099+
"""
2100+
2101+
all_params = ['file', 'rotate_type', 'format','check_excel_restriction']
2102+
all_params.append('callback')
2103+
all_params.append('_return_http_data_only')
2104+
all_params.append('_preload_content')
2105+
all_params.append('_request_timeout')
2106+
2107+
params = locals()
2108+
for key, val in iteritems(params['kwargs']):
2109+
if key not in all_params:
2110+
raise TypeError(
2111+
"Got an unexpected keyword argument '%s'"
2112+
" to method post_replace" % key
2113+
)
2114+
params[key] = val
2115+
del params['kwargs']
2116+
# verify the required parameter 'file' is set
2117+
if ('file' not in params) or (params['file'] is None):
2118+
raise ValueError("Missing the required parameter `file` when calling `post_reverse`")
2119+
# verify the required parameter 'rotateType' is set
2120+
if ('rotate_type' not in params) or (params['rotate_type'] is None):
2121+
raise ValueError("Missing the required parameter `text` when calling `post_reverse`")
2122+
# verify the required parameter 'format' is set
2123+
if ('format' not in params) or (params['format'] is None):
2124+
raise ValueError("Missing the required parameter `newtext` when calling `post_reverse`")
2125+
2126+
2127+
collection_formats = {}
2128+
2129+
path_params = {}
2130+
2131+
query_params = []
2132+
if 'format' in params:
2133+
query_params.append(('format', params['format']))
2134+
if 'rotate_type' in params:
2135+
query_params.append(('rotateType', params['rotate_type']))
2136+
if 'check_excel_restriction' in params:
2137+
query_params.append(('checkExcelRestriction', params['check_excel_restriction']))
2138+
2139+
header_params = {}
2140+
2141+
form_params = []
2142+
local_var_files = {}
2143+
if 'file' in params:
2144+
2145+
if isinstance(params['file'],dict):
2146+
for filename , filecontext in params['file'].items():
2147+
local_var_files[filename] = filecontext
2148+
else:
2149+
local_var_files['File'] = params['file']
2150+
2151+
2152+
body_params = None
2153+
# HTTP header `Accept`
2154+
header_params['Accept'] = self.api_client.\
2155+
select_header_accept(['application/json'])
2156+
2157+
# HTTP header `Content-Type`
2158+
header_params['Content-Type'] = self.api_client.\
2159+
select_header_content_type(['multipart/form-data'])
2160+
2161+
# Authentication setting
2162+
auth_settings = []
2163+
2164+
return self.api_client.call_api('/cells/rotate', 'POST',
2165+
path_params,
2166+
query_params,
2167+
header_params,
2168+
body=body_params,
2169+
post_params=form_params,
2170+
files=local_var_files,
2171+
response_type='FilesResult',
2172+
auth_settings=auth_settings,
2173+
callback=params.get('callback'),
2174+
_return_http_data_only=params.get('_return_http_data_only'),
2175+
_preload_content=params.get('_preload_content', True),
2176+
_request_timeout=params.get('_request_timeout'),
2177+
collection_formats=collection_formats)

asposecellscloud/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,6 @@ def to_debug_report(self):
254254
return "Python SDK Debug Report:\n"\
255255
"OS: {env}\n"\
256256
"Python Version: {pyversion}\n"\
257-
"Version of the API: 22.3\n"\
258-
"SDK Package Version: 22.5".\
257+
"Version of the API: 22.8\n"\
258+
"SDK Package Version: 22.8".\
259259
format(env=sys.platform, pyversion=sys.version)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from setuptools import setup, find_packages
55

66
NAME = "asposecellscloud"
7-
VERSION = "22.7"
7+
VERSION = "22.8"
88
# To install the library, run the following
99
#
1010
# python setup.py install

test/test_cells_rotate_api.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# coding: utf-8
2+
3+
from __future__ import absolute_import
4+
5+
import os
6+
import sys
7+
import unittest
8+
import warnings
9+
10+
ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..")
11+
sys.path.append(ABSPATH)
12+
import asposecellscloud
13+
from asposecellscloud.rest import ApiException
14+
from asposecellscloud.apis.light_cells_api import LightCellsApi
15+
import AuthUtil
16+
17+
global_api = None
18+
class TestCellsRotateApi(unittest.TestCase):
19+
""" CellsApi unit test stubs """
20+
21+
def setUp(self):
22+
warnings.simplefilter('ignore', ResourceWarning)
23+
global global_api
24+
if global_api is None:
25+
global_api = asposecellscloud.apis.light_cells_api.LightCellsApi(AuthUtil.GetClientId(),AuthUtil.GetClientSecret(),"v3.0",AuthUtil.GetBaseUrl())
26+
self.api = global_api
27+
28+
def tearDown(self):
29+
pass
30+
31+
def test_cells_rotate(self):
32+
assemblytest = os.path.dirname(os.path.realpath(__file__)) + "/../TestData/" + "assemblytest.xlsx"
33+
datasource = os.path.dirname(os.path.realpath(__file__)) + "/../TestData/" + "datasource.xlsx"
34+
result = self.api.post_rotate({ "assemblytest.xlsx" :assemblytest, "datasource.xlsx":datasource},"rows","pdf")
35+
# print(result)
36+
pass
37+
if __name__ == '__main__':
38+
unittest.main()

0 commit comments

Comments
 (0)