Skip to content

Commit ae6120a

Browse files
committed
Update Example.
1 parent 9f0fb19 commit ae6120a

9 files changed

+45
-6
lines changed

examples/Example_BatchProcessing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
import base64
12
import os
23
import shutil
3-
import base64
4+
45
from asposecellscloud.apis.cells_api import CellsApi
56
from asposecellscloud.models import *
67
from asposecellscloud.requests import *
78

8-
99
EmployeeSalesSummaryXlsx = "EmployeeSalesSummary.xlsx"
1010
CompanySalesXlsx = "CompanySales.xlsx"
1111
RemoteFolder = "PythonSDK"
1212
RemoteOutputFolder = "PythonSDKOutput"
1313
# Get Cells Cloud SDK instance
14+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
15+
# instance = CellsApi('YourClientId','YourClientSecret')
1416
instance = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'))
1517

1618
instance.upload_file( UploadFileRequest( CompanySalesXlsx, RemoteFolder + '/' + CompanySalesXlsx))

examples/Example_CheckExcel.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import base64
12
import os
23
import shutil
3-
import base64
4+
45
from asposecellscloud.apis.cells_api import CellsApi
56
from asposecellscloud.models import *
67
from asposecellscloud.requests import *
@@ -12,6 +13,8 @@ def file_to_base64(file_path):
1213
file_content = file.read()
1314
return base64.b64encode(file_content).decode('utf-8')
1415

16+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
17+
# instance = CellsApi('YourClientId','YourClientSecret')
1518
instance = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'))
1619

1720
# 1 Check the formula error for an online Excel file in the Cells Cloud Storage.

examples/Example_CloudStorageManagement.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import os
22
import sys
3+
34
from asposecellscloud.apis.cells_api import CellsApi
45
from asposecellscloud.models import *
56
from asposecellscloud.requests import *
67

8+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
9+
# instance = CellsApi('YourClientId','YourClientSecret')
710
instance = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'))
811

912
remote_folder = 'SDKPython'

examples/Example_ConvertChartToImage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
EmployeeSalesSummaryXlsx = "EmployeeSalesSummary.xlsx"
1010
RemoteFolder = "PythonSDK"
1111
# Get Cells Cloud SDK instance
12+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
13+
# instance = CellsApi('YourClientId','YourClientSecret')
1214
instance = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'))
1315

1416
# 1. Cells Cloud V3.0: Convert chart to image

examples/Example_ConvertExcel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
EmployeeSalesSummaryXlsx = "EmployeeSalesSummary.xlsx"
1010
RemoteFolder = "PythonSDK"
1111
# Get Cells Cloud SDK instance
12+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
13+
# instance = CellsApi('YourClientId','YourClientSecret')
1214
instance = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'))
1315

1416
# 3.0 method: Convert a local Excel file to another format file directly.
@@ -28,7 +30,7 @@
2830

2931
#Save an Excel file of Cells Cloud as another format file of Cells Cloud.
3032
#instance.post_workbook_save_as( PostWorkbookSaveAsRequest( EmployeeSalesSummaryXlsx ,newfilename= "PythonSDK/EmployeeSalesSummary.pdf" ,folder=RemoteFolder ))
31-
instance.save_spreadsheet_as( SaveSpreadsheetAsRequest ( EmployeeSalesSummaryXlsx,"pdf", save_options_data = SaveOptionsData( filename = "PythonSDK/EmployeeSalesSummary.pdf" ) ,folder= RemoteFolder ) )
33+
instance.save_spreadsheet_as( SaveSpreadsheetAsRequest ( EmployeeSalesSummaryXlsx,"pdf" ,folder= RemoteFolder ) )
3234
instance.download_file( DownloadFileRequest("PythonSDK/EmployeeSalesSummary.pdf") , local_outpath="EmployeeSalesSummary3.pdf")
3335

3436

examples/Example_ConvertRangeToImage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
EmployeeSalesSummaryXlsx = "EmployeeSalesSummary.xlsx"
1010
RemoteFolder = "PythonSDK"
1111
# Get Cells Cloud SDK instance
12+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
13+
# instance = CellsApi('YourClientId','YourClientSecret')
1214
instance = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'))
1315

1416
# 1. Cells Cloud v3.0: Convert range to image

examples/Example_DataProcessing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
import base64
12
import os
23
import shutil
3-
import base64
4+
45
from asposecellscloud.apis.cells_api import CellsApi
56
from asposecellscloud.models import *
67
from asposecellscloud.requests import *
78

8-
99
EmployeeSalesSummaryXlsx = "EmployeeSalesSummary.xlsx"
1010
CompanySalesXlsx = "CompanySales.xlsx"
1111
RemoteFolder = "PythonSDK"
1212
RemoteOutputFolder = "PythonSDKOutput"
1313
# Get Cells Cloud SDK instance
14+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
15+
# instance = CellsApi('YourClientId','YourClientSecret')
1416
instance = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'))
1517

1618
instance.upload_file( UploadFileRequest( CompanySalesXlsx, RemoteFolder + '/' + CompanySalesXlsx))

examples/Example_SaveAs.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import base64
2+
import os
3+
import shutil
4+
5+
from asposecellscloud.apis.cells_api import CellsApi
6+
from asposecellscloud.models import *
7+
from asposecellscloud.requests import *
8+
9+
EmployeeSalesSummaryXlsx = "EmployeeSalesSummary.xlsx"
10+
RemoteFolder = "PythonSDK"
11+
# Get Cells Cloud SDK instance
12+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
13+
# instance = CellsApi('YourClientId','YourClientSecret')
14+
instance = CellsApi(os.getenv('CellsCloudTestClientId'),os.getenv('CellsCloudTestClientSecret'))
15+
16+
# Upload a local Excel file to Cells Cloud Storage.
17+
instance.upload_file( UploadFileRequest(EmployeeSalesSummaryXlsx, "PythonSDK/EmployeeSalesSummary.xlsx"))
18+
19+
#Save an Excel file of Cells Cloud as another format file of Cells Cloud.
20+
instance.save_spreadsheet_as( SaveSpreadsheetAsRequest ( EmployeeSalesSummaryXlsx,"pdf" ,folder= RemoteFolder ) )
21+
instance.download_file( DownloadFileRequest("PythonSDK/EmployeeSalesSummary.pdf") , local_outpath="EmployeeSalesSummary3.pdf")

examples/Example_TextProcessing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from asposecellscloud.models import *
66
from asposecellscloud.requests import *
77

8+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
9+
# instance = CellsApi('YourClientId','YourClientSecret')
810
instance = CellsApi(os.getenv('CellsCloudTestClientId'),os.getenv('CellsCloudTestClientSecret'))
911

1012
instance.upload_file( UploadFileRequest( "BookText.xlsx", "PythonSDK/BookText.xlsx"))

0 commit comments

Comments
 (0)