Skip to content

Commit aa67484

Browse files
committed
Release Aspose.Cells Cloud SDK 24.8.0
1 parent 50ccd3b commit aa67484

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1520
-583
lines changed

Diff for: Examples/Example_PostAddTextContent.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
import sys
3+
from asposecellscloud.apis.cells_api import CellsApi
4+
from asposecellscloud.models import *
5+
from asposecellscloud.requests import *
6+
7+
api = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'),"v3.0",os.getenv('CellsCloudApiBaseUrl'))
8+
remote_folder = 'TestData/In'
9+
10+
local_name = 'BookText.xlsx'
11+
remote_name = 'BookText.xlsx'
12+
13+
addTextOptionsDataSource = DataSource(data_source_type= 'CloudFileSystem' ,data_path= 'BookText.xlsx' )
14+
addTextOptions = AddTextOptions(data_source= addTextOptionsDataSource ,text= 'Aspose.Cells Cloud is an excellent product.' ,worksheet= '202401' ,select_poistion= 'AtTheBeginning' ,skip_empty_cells= True )
15+
mapFiles = {
16+
local_name: local_name
17+
}
18+
request = UploadFileRequest( mapFiles, remote_folder + '/' + remote_name,storage_name= '')
19+
api.upload_file(request)
20+
21+
request = PostAddTextContentRequest( addTextOptions)
22+
api.post_add_text_content(request)

Diff for: Examples/Example_PostTrimContent.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import os
2+
import sys
3+
from asposecellscloud.apis.cells_api import CellsApi
4+
from asposecellscloud.models import *
5+
from asposecellscloud.requests import *
6+
7+
api = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'),"v3.0",os.getenv('CellsCloudApiBaseUrl'))
8+
remote_folder = 'TestData/In'
9+
10+
local_name = 'BookText.xlsx'
11+
remote_name = 'BookText.xlsx'
12+
13+
trimContentOptionsDataSource = DataSource(data_source_type= 'CloudFileSystem' ,data_path= 'BookText.xlsx' )
14+
trimContentOptionsScopeOptions = ScopeOptions(scope= 'EntireWorkbook' )
15+
trimContentOptions = TrimContentOptions(data_source= trimContentOptionsDataSource ,trim_leading= True ,trim_trailing= True ,trim_space_between_word_to1= True ,remove_all_line_breaks= True ,scope_options= trimContentOptionsScopeOptions )
16+
mapFiles = {
17+
local_name: local_name
18+
}
19+
request = UploadFileRequest( mapFiles, remote_folder + '/' + remote_name,storage_name= '')
20+
api.upload_file(request)
21+
22+
request = PostTrimContentRequest( trimContentOptions)
23+
api.post_trim_content(request)

Diff for: README.md

+8-4
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/24.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/24.8)
22

33
Aspose.Cells Cloud for Python enables you to handle various aspects of Excel files, including cell data, styles, formulas, charts, pivot tables, data validation, comments, drawing objects, images, hyperlinks, and so on. Additionally, it supports operations such as splitting, merging, repairing, and converting to other compatible file formats.
44

@@ -19,12 +19,11 @@ Enhance your Python applications with the [Aspose.Cells Cloud](https://products.
1919
- Import/Export: Facilitates importing data from various sources into spreadsheets and exporting spreadsheet data to other formats.
2020
- Security Management: Offers a range of security features like data encryption, access control, and permission management to safeguard the security and integrity of spreadsheet data.
2121

22-
## Feature & Enhancements in Version 24.7
22+
## Feature & Enhancements in Version 24.8
2323

2424
Full list of issues covering all changes in this release:
2525

26-
- Add a new feature about adding text content.
27-
- Add get access token by client id and client secret.
26+
- Add the text trim feature on Cells Cloud Services.
2827

2928
## Support file format
3029

@@ -121,6 +120,11 @@ api.put_convert_workbook(request)
121120

122121
# Release history version
123122

123+
## Enhancements in Version 24.7
124+
125+
- Add a new feature about adding text content.
126+
- Add get access token by client id and client secret.
127+
124128
## Enhancements in Version 24.6
125129

126130
- Optimize load data function of data transformation.

Diff for: TestData/BookText.xlsx

12.7 KB
Binary file not shown.

Diff for: asposecellscloud/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@
345345
from asposecellscloud.models.pivot_tables import PivotTables
346346
from asposecellscloud.models.add_text_options import AddTextOptions
347347
from asposecellscloud.models.base_operate_options import BaseOperateOptions
348+
from asposecellscloud.models.scope_item import ScopeItem
349+
from asposecellscloud.models.scope_options import ScopeOptions
350+
from asposecellscloud.models.trim_content_options import TrimContentOptions
348351
from asposecellscloud.models.cell_value import CellValue
349352
from asposecellscloud.models.custom_parser_config import CustomParserConfig
350353
from asposecellscloud.models.import2_dimension_double_array_option import Import2DimensionDoubleArrayOption
@@ -693,6 +696,7 @@
693696
from asposecellscloud.requests.post_worksheet_sparkline_group_request import PostWorksheetSparklineGroupRequest
694697
from asposecellscloud.requests.post_run_task_request import PostRunTaskRequest
695698
from asposecellscloud.requests.post_add_text_content_request import PostAddTextContentRequest
699+
from asposecellscloud.requests.post_trim_content_request import PostTrimContentRequest
696700
from asposecellscloud.requests.get_workbook_default_style_request import GetWorkbookDefaultStyleRequest
697701
from asposecellscloud.requests.get_workbook_text_items_request import GetWorkbookTextItemsRequest
698702
from asposecellscloud.requests.get_workbook_names_request import GetWorkbookNamesRequest

Diff for: asposecellscloud/api_client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
8888
self.host = host
8989
self.cookie = cookie
9090
# Set default User-Agent.
91-
self.user_agent = 'Aspose.Cells.Cloud/24.7/python'
91+
self.user_agent = 'Aspose.Cells.Cloud/24.8/python'
9292

9393
@property
9494
def user_agent(self):
@@ -163,7 +163,7 @@ def __call_api(self, resource_path, method,
163163

164164
# request url
165165
url = self.host + resource_path
166-
166+
167167
preload_content = _preload_content
168168
if response_type == 'file':
169169
preload_content = False
@@ -705,7 +705,7 @@ def get_access_token(self, grant_type, client_id, client_secret, version, **kwar
705705
# verify the required parameter 'client_secret' is set
706706
if ('client_secret' not in params) or (params['client_secret'] is None):
707707
raise ValueError("Missing the required parameter `client_secret` when calling `o_auth_post`")
708-
oauthurl = '/connect/token'
708+
oauthurl = '/v3.0/cells/connect/token'
709709
if version == 'v1.1':
710710
oauthurl = '/oauth2/token'
711711

Diff for: asposecellscloud/apis/cells_api.py

+47
Original file line numberDiff line numberDiff line change
@@ -12320,6 +12320,53 @@ def post_add_text_content_with_http_info(self, request, **kwargs):
1232012320

1232112321

1232212322

12323+
# <summary>
12324+
# </summary>
12325+
# <param name="request">Request. <see cref="PostTrimContentRequest" /></param>
12326+
def post_trim_content(self, request, **kwargs):
12327+
12328+
kwargs['_return_http_data_only'] = True
12329+
self.check_access_token()
12330+
if kwargs.get('callback'):
12331+
return self.post_trim_content_with_http_info(request,**kwargs)
12332+
else:
12333+
(data) = self.post_trim_content_with_http_info(request,**kwargs)
12334+
return data
12335+
12336+
def post_trim_content_with_http_info(self, request, **kwargs):
12337+
all_params = []
12338+
all_params.append('callback')
12339+
all_params.append('_return_http_data_only')
12340+
all_params.append('_preload_content')
12341+
all_params.append('_request_timeout')
12342+
params = locals()
12343+
for key, val in iteritems(params['kwargs']):
12344+
if key not in all_params:
12345+
raise TypeError(
12346+
"Got an unexpected keyword argument '%s'"
12347+
" to method post_trim_content" % key
12348+
)
12349+
params[key] = val
12350+
del params['kwargs']
12351+
12352+
http_params = request.create_http_request(self.api_client)
12353+
return self.api_client.call_api(http_params['path'], http_params['method'],
12354+
None,
12355+
http_params['query_params'],
12356+
http_params['header_params'],
12357+
body=http_params['body'],
12358+
post_params=http_params['form_params'],
12359+
files=http_params['files'],
12360+
response_type=http_params['response_type'],
12361+
auth_settings=http_params['auth_settings'],
12362+
callback=params.get('callback'),
12363+
_return_http_data_only=params.get('_return_http_data_only'),
12364+
_preload_content=params.get('_preload_content', True),
12365+
_request_timeout=params.get('_request_timeout'),
12366+
collection_formats=http_params['collection_formats'])
12367+
12368+
12369+
1232312370
# <summary>
1232412371
# Retrieve the description of the default style for the workbook .
1232512372
# </summary>

Diff for: asposecellscloud/configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,5 +259,5 @@ def to_debug_report(self):
259259
"OS: {env}\n"\
260260
"Python Version: {pyversion}\n"\
261261
"Version of the API: v3.0\n"\
262-
"SDK Package Version: 24.7".\
262+
"SDK Package Version: 24.8".\
263263
format(env=sys.platform, pyversion=sys.version)

Diff for: asposecellscloud/models/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@
346346
from asposecellscloud.models.pivot_tables import PivotTables
347347
from asposecellscloud.models.add_text_options import AddTextOptions
348348
from asposecellscloud.models.base_operate_options import BaseOperateOptions
349+
from asposecellscloud.models.scope_item import ScopeItem
350+
from asposecellscloud.models.scope_options import ScopeOptions
351+
from asposecellscloud.models.trim_content_options import TrimContentOptions
349352
from asposecellscloud.models.cell_value import CellValue
350353
from asposecellscloud.models.custom_parser_config import CustomParserConfig
351354
from asposecellscloud.models.import2_dimension_double_array_option import Import2DimensionDoubleArrayOption

Diff for: asposecellscloud/models/scope_item.py

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# coding: utf-8
2+
"""
3+
<copyright company="Aspose" file="ScopeItempy.cs">
4+
Copyright (c) 2024 Aspose.Cells Cloud
5+
</copyright>
6+
<summary>
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
</summary>
25+
"""
26+
27+
from pprint import pformat
28+
from six import iteritems
29+
import re
30+
31+
class ScopeItem(object):
32+
33+
"""
34+
NOTE: This class is auto generated by the swagger code generator program.
35+
Do not edit the class manually.
36+
"""
37+
38+
39+
"""
40+
Attributes:
41+
swagger_types (dict): The key is attribute name
42+
and the value is attribute type.
43+
attribute_map (dict): The key is attribute name
44+
and the value is json key in definition.
45+
"""
46+
47+
swagger_types = {
48+
'worksheet_name' : 'str',
49+
'ranges' : 'list[str]'
50+
}
51+
52+
attribute_map = {
53+
'worksheet_name' : 'WorksheetName' ,
54+
'ranges' : 'Ranges'
55+
}
56+
57+
@staticmethod
58+
def get_swagger_types():
59+
return ScopeItem.swagger_types
60+
61+
@staticmethod
62+
def get_attribute_map():
63+
return ScopeItem.attribute_map
64+
65+
def get_from_container(self, attr):
66+
if attr in self.container:
67+
return self.container[attr]
68+
return None
69+
70+
def __init__(self,worksheet_name=None ,ranges=None ,**kw):
71+
"""
72+
Associative dict for storing property values
73+
"""
74+
self.container = {}
75+
76+
"""
77+
ScopeItem - a model defined in Swagger
78+
"""
79+
self.container['worksheet_name'] = None
80+
self.container['ranges'] = None
81+
params = locals()
82+
self.worksheet_name = worksheet_name
83+
if 'worksheet_name' in params:
84+
self.worksheet_name = params["worksheet_name"]
85+
86+
87+
88+
self.ranges = ranges
89+
if 'ranges' in params:
90+
self.ranges = params["ranges"]
91+
92+
93+
94+
95+
@property
96+
def worksheet_name(self):
97+
return self.container['worksheet_name']
98+
99+
@worksheet_name.setter
100+
def worksheet_name(self, worksheet_name):
101+
self.container['worksheet_name'] = worksheet_name
102+
@property
103+
def ranges(self):
104+
return self.container['ranges']
105+
106+
@ranges.setter
107+
def ranges(self, ranges):
108+
self.container['ranges'] = ranges
109+
110+
def to_dict(self):
111+
"""
112+
Returns the model properties as a dict
113+
"""
114+
result = {}
115+
116+
for attr, _ in iteritems(self.get_swagger_types()):
117+
value = self.get_from_container(attr)
118+
if isinstance(value, list):
119+
result[attr] = list(map(
120+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
121+
value
122+
))
123+
elif hasattr(value, "to_dict"):
124+
result[attr] = value.to_dict()
125+
elif isinstance(value, dict):
126+
result[attr] = dict(map(
127+
lambda item: (item[0], item[1].to_dict())
128+
if hasattr(item[1], "to_dict") else item,
129+
value.items()
130+
))
131+
else:
132+
result[attr] = value
133+
134+
return result
135+
136+
def to_str(self):
137+
"""
138+
Returns the string representation of the model
139+
"""
140+
return pformat(self.to_dict())
141+
142+
def __repr__(self):
143+
"""
144+
For `print` and `pprint`
145+
"""
146+
return self.to_str()
147+
148+
def __eq__(self, other):
149+
"""
150+
Returns true if both objects are equal
151+
"""
152+
if not isinstance(other, ScopeItem):
153+
return False
154+
155+
return self.__dict__ == other.__dict__
156+
157+
def __ne__(self, other):
158+
"""
159+
Returns true if both objects are not equal
160+
"""
161+
return not self == other

0 commit comments

Comments
 (0)