Convert MPP to XML in Python

MPP is a popular format for project data. However, XML is a more open and portable format that can be easily read by a variety of software programs. If you need to share your MPP files with others or want to work with them in a different program, you can convert them to XML. In this blog post, we will show you how to convert MPP to XML in Python. We will also learn to export project data from MPP to Primavera XML format.

This article covers the following topics:

  1. Python MPP to XML Converter
  2. Convert MPP to XML
  3. Convert MPP to Primavera XML
  4. Try MPP to XML Online

Python MPP to XML Converter

We will take advantage of the Aspose.Tasks for Python library for converting MPP files to XML format. It is a powerful API that enables you to read, write, and manipulate Microsoft Project MPP/XML files without Microsoft Project software. It is easy to use and provides a wide range of features for working with project files.

Please download the package or install the API from PyPI using the following pip command in the console:

pip install aspose-tasks

Convert MPP to XML in Python

We can easily convert MPP to XML by loading the MPP file and saving it in the XML format at the desired location. Please follow the steps below to convert MPP to XML in Python.

  1. Load the MPP file using the Project class instance.
  2. Call the save() method with the output file path and SaveFileFormat as arguments.

The following code sample shows how to convert MPP to XML in Python.

Convert MPP to Primavera XML in Python

In addition to converting an MPP file to XML, we can also export project data from MPP to Primavera XML format. The API offers the PrimaveraXmlSaveOptions class, which permits us to specify additional options for rendering project data in Primavera P6 XML format.

Please follow the steps below to convert MPP to Primavera XML:

  1. Load the MPP file using the Project class instance.
  2. Create an instance of the PrimaveraXmlSaveOptions class.
  3. Set various options such as save_root_task, etc.
  4. Finally, call the save() method to save it as XLSX. It takes the output file path and PrimaveraXmlSaveOptions as arguments.

The following code sample shows how to convert MPP to XLSX with advanced options using Python.

Get a Free License

You can get a free temporary license to try the library for free without any restrictions on its evaluation.

Convert MPP to XML Online

If you want to convert MPP to XML online, use our high-quality and free MPP to XML converter, developed using the Aspose.Tasks library.

Python MPP to XML Converter – Learn More

Check out the following resources to learn more about converting MPP files into XML or other supported formats and exploring Aspose.Tasks:

Conclusion

In this blog post, we learned how to convert MPP to XML in Python. We also discussed how to convert MPP to Primavera P6 XML format programmatically. We hope this blog post was helpful. In case of any ambiguity, please contact us on our free support forum.

See Also