This tutorial explains the process to combine Excel files using Python REST API. You will learn to automatically combine Excel documents using Python REST Interface by utilizing a Python-based Could SDK. It will assist you to merge as many files as required.
Prerequisite
- Create an account and get API credentials for merging Excel files
- Download Aspose.Cells Cloud SDK for Python to combine multiple workbooks
- Setup Python project with the above SDK
Steps to Combine Multiple Excel Files using Python Low Code API
- Start by defining your Client ID, Client Secret, and the API Base URL provided by Aspose.Cloud
- Use the credentials and endpoint to initialize the CellsApi object, which allows access to all Excel-related operations
- Define the names of the two Excel files that you intend to merge
- Use the UploadFileRequest to upload both input files to Aspose Cloud storage by adding them to the UploadFiles dictionary
- Create and configure a PostWorkbooksMergeRequest and send it using the PostWorkbooksMerge method
- After merging, use the DownloadFileRequest to download the updated file from cloud storage and save it on disk
These steps summarize the process to combine Excel files into one using Python Low Code API. The code authenticates with Aspose.Cells Cloud API, uploads two Excel files to cloud storage, and sends a request to merge them. It then downloads the merged file and saves it locally as a new Excel document.
Code to Merge XLSX Files using Python REST API
The above code demonstrates how to merge Excel files into one using Python REST Interface. You can upload as many files as required in a single API call by filling the dictionary in the UploadFileRequest with the file name and contents. Finally, repeat the process to combine two files at a time by keeping the destination file name first in the PostWorkbooksMergeRequest and changing the secondary file name to merge all the sheets at the end.
This article has described how to merge Excel files. To add or insert a column in an Excel file, refer to the article Adding a column in Excel using Python REST API.