Convert Microsoft Project to Excel in Python

Microsoft Project to Excel
Convert Microsoft Project to Excel | MPP File to Excel in Python

This article is a continuation of our previous article for converting Microsoft Project File to Excel where we used Java Cloud SDK for conversion purposes in this article, we are going to focus on the conversion of Microsoft Project to Excel using Python SDK. Let’s discuss the following topics in further detail:

Microsoft Project Conversion API

If you are planning to achieve the requirement to export a project planning template for excel, then Aspose.Tasks Cloud SDK for Python is the right choice. It’s a wrapper around Aspose.Tasks Cloud API and enables the Python developers to convert MPP to excel, HTML, PDF, XML, JPEG, and other supported formats. The whole conversion is completed with fewer code lines. Now in order to get started, please execute the following command to install the SDK

pip install aspose-tasks-cloud

Don’t forget to create a free subscription account by visiting Aspose.Cloud dashboard. If you have GitHub or Google account, simply Sign Up. Otherwise, click on the Create a new Account button and obtain your client credentials.

Convert MPP to Excel in Python

Please follow the steps given below to export MPP to excel.

  • First, create an object of ApiClient
  • Secondly, pass API Client and API Secret details to ApiClient properties
  • Thirdly, initialize an instance of TaskApi using the ApiClient object
  • Now in order to upload the Microsoft Project file to cloud storage, please use the UploadFileRequest method of TasksApi
  • Create an instance of GetTaskDocumentWithFormatRequest while passing MPP file name, output format value as XLSX, and Flase value for returnAsZipArchive parameter (this will not bundle the output as ZIP)
  • Finally, call the get_task_documnet_with_format(..) method to convert the Microsoft Project file to Excel

For your reference, the sample files used in the above example can be downloaded from (Home_move_plan.mpp) and Converted.xlsx.

Convert Microsoft Project to Excel using cURL Commands

This section explains the steps to convert Microsoft Project to Excel using cURL commands. Now the first step is to generate a JWT access token based on Client ID and Client Secret details.

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=4ccf1790-accc-41e9-8d18-a78dbb2ed1aa&client_secret=caac6e3d4a4724b2feb53f4e460eade3" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Now next step is to execute the following command to convert the MPP file to Excel and save the resultant file (Converted.xlsx) in the same cloud storage.

curl -v -X GET "https://api.aspose.cloud/v3.0/tasks/source.mpp/format?format=xlsx&returnAsZipArchive=false" \
-H  "accept: multipart/form-data" \
-H  "authorization: Bearer <JWT Token>" \
-o Converted.xlsx

Conclusion

In this article, we have discussed the details on how to convert Microsoft Project to Excel using Python SDK. At the same time, we have also explored the option for converting MPP files to Excel using cURL Commands in the command line terminal. Please note that under the MIT license, the complete source code of Python SDK can be downloaded from GitHub and you can make changes as per your requirements. Should you have any related query regarding MPP to excel converter, please feel free to contact us via the free technical support forum.

Related Articles

We highly recommend visiting the following links to learn more about