Skip to content

Commit

Permalink
Release Aspose.Cells Cloud SDK 24.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
roywangaspose committed Aug 12, 2024
1 parent 50ccd3b commit aa67484
Show file tree
Hide file tree
Showing 52 changed files with 1,520 additions and 583 deletions.
22 changes: 22 additions & 0 deletions Examples/Example_PostAddTextContent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
import sys
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.models import *
from asposecellscloud.requests import *

api = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'),"v3.0",os.getenv('CellsCloudApiBaseUrl'))
remote_folder = 'TestData/In'

local_name = 'BookText.xlsx'
remote_name = 'BookText.xlsx'

addTextOptionsDataSource = DataSource(data_source_type= 'CloudFileSystem' ,data_path= 'BookText.xlsx' )
addTextOptions = AddTextOptions(data_source= addTextOptionsDataSource ,text= 'Aspose.Cells Cloud is an excellent product.' ,worksheet= '202401' ,select_poistion= 'AtTheBeginning' ,skip_empty_cells= True )
mapFiles = {
local_name: local_name
}
request = UploadFileRequest( mapFiles, remote_folder + '/' + remote_name,storage_name= '')
api.upload_file(request)

request = PostAddTextContentRequest( addTextOptions)
api.post_add_text_content(request)
23 changes: 23 additions & 0 deletions Examples/Example_PostTrimContent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
import sys
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.models import *
from asposecellscloud.requests import *

api = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'),"v3.0",os.getenv('CellsCloudApiBaseUrl'))
remote_folder = 'TestData/In'

local_name = 'BookText.xlsx'
remote_name = 'BookText.xlsx'

trimContentOptionsDataSource = DataSource(data_source_type= 'CloudFileSystem' ,data_path= 'BookText.xlsx' )
trimContentOptionsScopeOptions = ScopeOptions(scope= 'EntireWorkbook' )
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 )
mapFiles = {
local_name: local_name
}
request = UploadFileRequest( mapFiles, remote_folder + '/' + remote_name,storage_name= '')
api.upload_file(request)

request = PostTrimContentRequest( trimContentOptions)
api.post_trim_content(request)
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![](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)
![](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)

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.

Expand All @@ -19,12 +19,11 @@ Enhance your Python applications with the [Aspose.Cells Cloud](https://products.
- Import/Export: Facilitates importing data from various sources into spreadsheets and exporting spreadsheet data to other formats.
- 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.

## Feature & Enhancements in Version 24.7
## Feature & Enhancements in Version 24.8

Full list of issues covering all changes in this release:

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

## Support file format

Expand Down Expand Up @@ -121,6 +120,11 @@ api.put_convert_workbook(request)

# Release history version

## Enhancements in Version 24.7

- Add a new feature about adding text content.
- Add get access token by client id and client secret.

## Enhancements in Version 24.6

- Optimize load data function of data transformation.
Expand Down
Binary file added TestData/BookText.xlsx
Binary file not shown.
4 changes: 4 additions & 0 deletions asposecellscloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@
from asposecellscloud.models.pivot_tables import PivotTables
from asposecellscloud.models.add_text_options import AddTextOptions
from asposecellscloud.models.base_operate_options import BaseOperateOptions
from asposecellscloud.models.scope_item import ScopeItem
from asposecellscloud.models.scope_options import ScopeOptions
from asposecellscloud.models.trim_content_options import TrimContentOptions
from asposecellscloud.models.cell_value import CellValue
from asposecellscloud.models.custom_parser_config import CustomParserConfig
from asposecellscloud.models.import2_dimension_double_array_option import Import2DimensionDoubleArrayOption
Expand Down Expand Up @@ -693,6 +696,7 @@
from asposecellscloud.requests.post_worksheet_sparkline_group_request import PostWorksheetSparklineGroupRequest
from asposecellscloud.requests.post_run_task_request import PostRunTaskRequest
from asposecellscloud.requests.post_add_text_content_request import PostAddTextContentRequest
from asposecellscloud.requests.post_trim_content_request import PostTrimContentRequest
from asposecellscloud.requests.get_workbook_default_style_request import GetWorkbookDefaultStyleRequest
from asposecellscloud.requests.get_workbook_text_items_request import GetWorkbookTextItemsRequest
from asposecellscloud.requests.get_workbook_names_request import GetWorkbookNamesRequest
Expand Down
6 changes: 3 additions & 3 deletions asposecellscloud/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
self.host = host
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Aspose.Cells.Cloud/24.7/python'
self.user_agent = 'Aspose.Cells.Cloud/24.8/python'

@property
def user_agent(self):
Expand Down Expand Up @@ -163,7 +163,7 @@ def __call_api(self, resource_path, method,

# request url
url = self.host + resource_path

preload_content = _preload_content
if response_type == 'file':
preload_content = False
Expand Down Expand Up @@ -705,7 +705,7 @@ def get_access_token(self, grant_type, client_id, client_secret, version, **kwar
# verify the required parameter 'client_secret' is set
if ('client_secret' not in params) or (params['client_secret'] is None):
raise ValueError("Missing the required parameter `client_secret` when calling `o_auth_post`")
oauthurl = '/connect/token'
oauthurl = '/v3.0/cells/connect/token'
if version == 'v1.1':
oauthurl = '/oauth2/token'

Expand Down
47 changes: 47 additions & 0 deletions asposecellscloud/apis/cells_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12320,6 +12320,53 @@ def post_add_text_content_with_http_info(self, request, **kwargs):



# <summary>
# </summary>
# <param name="request">Request. <see cref="PostTrimContentRequest" /></param>
def post_trim_content(self, request, **kwargs):

kwargs['_return_http_data_only'] = True
self.check_access_token()
if kwargs.get('callback'):
return self.post_trim_content_with_http_info(request,**kwargs)
else:
(data) = self.post_trim_content_with_http_info(request,**kwargs)
return data

def post_trim_content_with_http_info(self, request, **kwargs):
all_params = []
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method post_trim_content" % key
)
params[key] = val
del params['kwargs']

http_params = request.create_http_request(self.api_client)
return self.api_client.call_api(http_params['path'], http_params['method'],
None,
http_params['query_params'],
http_params['header_params'],
body=http_params['body'],
post_params=http_params['form_params'],
files=http_params['files'],
response_type=http_params['response_type'],
auth_settings=http_params['auth_settings'],
callback=params.get('callback'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=http_params['collection_formats'])



# <summary>
# Retrieve the description of the default style for the workbook .
# </summary>
Expand Down
2 changes: 1 addition & 1 deletion asposecellscloud/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,5 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: v3.0\n"\
"SDK Package Version: 24.7".\
"SDK Package Version: 24.8".\
format(env=sys.platform, pyversion=sys.version)
3 changes: 3 additions & 0 deletions asposecellscloud/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@
from asposecellscloud.models.pivot_tables import PivotTables
from asposecellscloud.models.add_text_options import AddTextOptions
from asposecellscloud.models.base_operate_options import BaseOperateOptions
from asposecellscloud.models.scope_item import ScopeItem
from asposecellscloud.models.scope_options import ScopeOptions
from asposecellscloud.models.trim_content_options import TrimContentOptions
from asposecellscloud.models.cell_value import CellValue
from asposecellscloud.models.custom_parser_config import CustomParserConfig
from asposecellscloud.models.import2_dimension_double_array_option import Import2DimensionDoubleArrayOption
Expand Down
161 changes: 161 additions & 0 deletions asposecellscloud/models/scope_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# coding: utf-8
"""
<copyright company="Aspose" file="ScopeItempy.cs">
Copyright (c) 2024 Aspose.Cells Cloud
</copyright>
<summary>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</summary>
"""

from pprint import pformat
from six import iteritems
import re

class ScopeItem(object):

"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""


"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""

swagger_types = {
'worksheet_name' : 'str',
'ranges' : 'list[str]'
}

attribute_map = {
'worksheet_name' : 'WorksheetName' ,
'ranges' : 'Ranges'
}

@staticmethod
def get_swagger_types():
return ScopeItem.swagger_types

@staticmethod
def get_attribute_map():
return ScopeItem.attribute_map

def get_from_container(self, attr):
if attr in self.container:
return self.container[attr]
return None

def __init__(self,worksheet_name=None ,ranges=None ,**kw):
"""
Associative dict for storing property values
"""
self.container = {}

"""
ScopeItem - a model defined in Swagger
"""
self.container['worksheet_name'] = None
self.container['ranges'] = None
params = locals()
self.worksheet_name = worksheet_name
if 'worksheet_name' in params:
self.worksheet_name = params["worksheet_name"]



self.ranges = ranges
if 'ranges' in params:
self.ranges = params["ranges"]




@property
def worksheet_name(self):
return self.container['worksheet_name']

@worksheet_name.setter
def worksheet_name(self, worksheet_name):
self.container['worksheet_name'] = worksheet_name
@property
def ranges(self):
return self.container['ranges']

@ranges.setter
def ranges(self, ranges):
self.container['ranges'] = ranges

def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}

for attr, _ in iteritems(self.get_swagger_types()):
value = self.get_from_container(attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value

return result

def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())

def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()

def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ScopeItem):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
Loading

0 comments on commit aa67484

Please sign in to comment.