Convert Primavera XER to SVG using Python

If you’re dealing with Primavera P6 schedules, you are probably familiar with XER files. Primavera P6 is a widely used project management software that stores project data in the XER file format. It contains project data, including tasks, resources, and schedules. Converting these to SVG can make your project data much more accessible and visually appealing. In this article, we will learn how to convert XER to SVG in Python. So, let’s get started!

This article covers the following topics:

  1. Python API to convert XER to SVG
  2. Convert XER to SVG in Python
  3. Customize the Conversion of XER to SVG
  4. Convert XER to SVG Online
  5. Licensing & Free Resources

Python API to Convert XER to SVG

In order to convert XER files to SVG format, we will use Aspose.Tasks for Python API. Aspose.Tasks is a powerful API that provides comprehensive project management capabilities and makes it easy to work with project files programmatically in Python applications. It supports reading, writing, and manipulating project files in various formats, including Microsoft Project (MPP), Primavera (XER), and XML, among others. It provides a complete set of features for managing project tasks, resources, assignments, and calendars, making it an essential tool for anyone involved in project planning and management.

Before we jump into the code, we need to get the API. Please download the package or install the API from PyPI using the following pip command in the console:

pip install aspose-tasks

Convert XER to SVG using Python

1. Import the necessary libraries

First, we need to import the required libraries. Here’s how you do it:

import aspose.tasks as tasks

2. Load the XER file

Next, let’s load the XER file. For this example, let’s assume your XER file is named sample.xer.

project = tasks.Project("sample.xer");

3. Save the project as SVG

Now, it’s time to save the project as an SVG file.

project.save("sample_xer.svg", tasks.saving.SaveFileFormat.SVG);

That’s it! You’ve successfully converted your XER file to SVG using Aspose.Tasks for Python.

Complete Code

Here is the complete code example that shows how to convert XER to SVG in Python.

Convert XER to SVG using Python

Convert XER to SVG using Python.

Customize XER to SVG Conversion in Python

We can customize the conversion of XER to SVG using the SvgOptions class by following the steps below:

  1. Load the XER file using the Project class.
  2. Create an instance of the SvgOptions class.
  3. After that, define the SVG options, such as page_size, etc.
  4. Finally, save the project as an SVG file using the save() method. It takes the output SVG file path and the SvgOptions as arguments.

The following sample code shows how to convert XER to SVG with customized settings in Python.

Convert XER to SVG with Options using Python

Convert XER to SVG with Options using Python.

Get a Free License

Please get a free temporary license to try the API without evaluation limitations.

Convert XER to SVG Online

In addition, you may also convert your XER files to SVG format using this free online XER to SVG converter, developed using the above API.

Python XER to SVG – Free Resources

Besides converting XER to SVG programmatically in Python, explore various other features of the API using the following resources:

Conclusion

In conclusion, we have seen how to convert XER to SVG in Python. By following the steps outlined in this article, you can easily convert XER files into SVG format programmatically. Converting XER to SVG can transform your project data into something much more accessible and visually engaging. Whether you’re sharing project updates with your team or presenting to stakeholders, SVG files make the data easy to understand at a glance. In case of any ambiguity, please feel free to contact us at our free support forum.

See Also