Last Updated: 02 Sept, 2026

Best Open Source APIs for Parsing MS Project MPP & Primavera XER Files

Leading Open Source APIs for Working with MS Project (MPP) & Primavera (XER) Files

In enterprise project management, two proprietary file formats reign supreme: Microsoft Project (.mpp) and Oracle Primavera P6 (.xer). Whether you are building an internal analytics dashboard, syncing construction schedules with ERP systems, or automating project status pipelines, reading and manipulating these scheduling files programmatically is a critical requirement.

However, both formats pose notorious engineering hurdles:

  • MPP files are binary, undocumented OLE Structured Storage or proprietary compound document formats with schema changes across virtually every major MS Project release (2000, 2003, 2007, 2010, 2013, 2016, 2019, 2021).
  • Primavera XER files are tab-delimited text exports structured as relational database tables (%T tables with %F fields and %R records), packed with complex referential integrity constraints, multi-calendar inheritance, and critical-path logic.

Commercial SDKs like Aspose.Tasks exist, but licensing costs and vendor lock-in make robust open-source alternatives essential. In this guide, we break down the top open-source APIs, libraries, and parsers available across Java, Python, and C# to handle MPP and XER files cleanly and efficiently.

Quick Comparison of Open-Source Tools

Library / ToolPrimary LanguageFormats SupportedRead / WriteBest Use Case
MPXJJava (Python / .NET bindings)MPP, MPT, MPX, XER, PMXML, MSPDIRead (MPP/XER); Write (MPX/MSPDI/PMXML)Enterprise Java, multi-format conversion, all-in-one schedules
xerparserPythonXERRead & ParseData science, pandas scheduling analysis, ETL pipelines
python-mpxjPythonMPP, XER, XMLRead / ConvertPythonic wrapper around MPXJ using JPype
netezza-xer / xer-to-csvShell / Python / GoXERStream / ExportExtracting raw SQL-like tables to relational DBs
OpenProj / ProjectLibre CoreJavaMPP (older versions), XMLRead / RenderDesktop/Engine integration for baseline Gantt views

1. MPXJ (Microsoft Project eXchange in Java)

The Undisputed Industry Standard for Schedule Interoperability

If there is a gold standard in open-source scheduling libraries, it is MPXJ. Maintained actively for over two decades by Jon Iles, MPXJ was originally built to process Microsoft Project MPX files, but has expanded into a universal translation engine for project scheduling formats.

Key Capabilities

  • Direct MPP Extraction: Parses proprietary binary MPP files across almost all MS Project versions (Project 98 through modern Project 2016/2019/2021/365) without requiring an installed copy of Microsoft Project.
  • Primavera P6 XER & PMXML Parsing: Native support for both text-based .xer dumps and modern Primavera XML files.
  • Normalized Data Model: Exposes a unified object model (ProjectFile, Task, Resource, ResourceAssignment, Relation, WorkCalendar). Regardless of whether your input is an MPP or an XER, your application code interacts with the exact same API.
  • Multi-Language Distribution: While written in Java, MPXJ distributes native-compiled NuGet packages for .NET (C#) via IKVM/CoreCLR, as well as a Python package (mpxj on PyPI).

Quick Code Example: Java

import net.sf.mpxj.ProjectFile;
import net.sf.mpxj.Task;
import net.sf.mpxj.reader.UniversalProjectReader;

public class ScheduleReader {
    public static void main(String[] args) throws Exception {
        // UniversalProjectReader automatically detects whether it's MPP, XER, or XML
        UniversalProjectReader reader = new UniversalProjectReader();
        ProjectFile project = reader.read("capital_project_schedule.xer");

        System.out.println("Project Name: " + project.getProjectProperties().getProjectTitle());

        for (Task task : project.getTasks()) {
            if (task.getName() != null) {
                System.out.printf("Task ID: %d | WBS: %s | Name: %s | Early Start: %s%n",
                    task.getID(), task.getWBS(), task.getName(), task.getEarlyStart());
            }
        }
    }
}

Where MPXJ Excels

  • True cross-format normalization (converting MPP to XER-compatible PMXML or MSPDI).
  • Complex calendar logic (shifts, exceptions, multi-calendar work hours).
  • Production-grade stability with an active community.

2. xerparser (Python)

Lightweight, Native Python Parsing for Primavera XER

While MPXJ can be invoked via Python bindings, doing so requires running a JVM backend (via JPype). When you need a purely native Python parser that executes without Java dependencies, xerparser is the go-to solution.

An XER file is essentially a database snapshot dumped into flat text. xerparser decodes these tables into structured Python objects and integrates seamlessly with pandas.

Key Capabilities

  • Zero Java Dependencies: Pure Python 3 library installable via pip install xerparser.
  • Relational Integrity: Maps core Primavera tables such as TASK (Activities), PROJECT (Project metadata), PROJWBS (WBS hierarchies), TASKRSRC (Assignments), and TASKPRED (Logic ties).
  • Fast Execution: Ideal for containerized microservices, AWS Lambda functions, and modern data orchestration pipelines (e.g., Apache Airflow, Prefect).

Quick Code Example: Python

from xerparser.reader import Reader
import pandas as pd

# Load XER file
xer = Reader("plant_expansion.xer")

# Access projects inside the XER dump
for project in xer.projects:
    print(f"Project Code: {project.short_name}, Description: {project.name}")

# Convert activities into a Pandas DataFrame for downstream analytics
tasks_data = []
for act in xer.activities:
    tasks_data.append({
        "Task_Code": act.task_code,
        "Name": act.task_name,
        "Status": act.status_code,
        "Early_Start": act.early_start_date,
        "Early_Finish": act.early_end_date,
        "Total_Float": act.total_float_hr_cnt
    })

df = pd.DataFrame(tasks_data)
print(df.head())

Where xerparser Excels

  • Data engineering, delay-claim analytics, and schedule health checks (DCMA 14-point assessment scripts).
  • Serverless workloads where bundling a 50MB+ Java runtime is impractical.

3. python-mpxj

Bridging Python with the Full Power of MPXJ

If you are working in Python but must process binary .mpp files, xerparser cannot help you because it only targets .xer. The most reliable open-source bridge is python-mpxj.

Key Capabilities

  • Automatically spins up a headless embedded JVM using jpype1.
  • Exposes the full MPXJ API directly to Python developers.
  • Allows direct conversion from proprietary .mpp into modern open formats like .json or .csv.
pip install mpxj
import mpxj

# MPXJ provides high-level helper utilities
from net.sf.mpxj.reader import UniversalProjectReader

reader = UniversalProjectReader()
project = reader.read("commercial_tower.mpp")

for task in project.getTasks():
    if task.getName():
        print(f"{task.getUniqueID()}: {task.getName()} -> {task.getDuration()}")

4. Custom Parsing Utilities & Database Ingestion Scripts

Handling Raw Primavera XER via Stream Processing

Because Primavera XER follows a predictable table format, many open-source engineering teams utilize custom tabular stream decoders (written in Go, Python, or Rust) rather than high-level DOM-style schedule libraries.

An XER file structure is formatted as:

%T  TASK
%F  task_id  proj_id  wbs_id  task_code  task_name  status_code
%R  10182    120      45      A1000      Mobilization TK_Complete
%R  10183    120      45      A1010      Excavation   TK_Active
%E

Several open-source scripts on GitHub (such as xer2sqlite and xer-to-csv) parse this structure directly into SQLite or PostgreSQL. This approach is optimal if:

  1. You only need to query tabular relationships with SQL.
  2. The schedules are hundreds of megabytes in size with tens of thousands of tasks, where object-oriented tree loaders would trigger out-of-memory errors.

Technical Comparison: Which Should You Choose?

Choose MPXJ If:

  • You must read binary Microsoft Project .mpp files without paying for proprietary commercial software.
  • You need deep schedule intelligence: working calendars, lag duration calculations, critical path computation, and baseline variance.
  • Your technology stack is Java, Kotlin, C# (.NET), or enterprise Python.

Choose xerparser If:

  • You exclusively handle Primavera P6 .xer files.
  • Your pipeline is written in native Python and feeds directly into pandas, NumPy, or visualizers like Dash / Streamlit.
  • You are deploying to lean container environments or serverless cloud runners.

Choose Direct DB / CSV Stream Ingestion If:

  • You need high-throughput database staging for massive multi-project enterprise XER exports.
  • You only need to extract metadata, cost accounts, and progress curves via SQL analytics.

Summary & Best Practices

When building open-source pipelines for schedule data:

  1. Never parse .mpp manually: The Microsoft binary specification is intricate and undocumented. Always rely on battle-tested libraries like MPXJ.
  2. Beware of Date Timezones: Primavera schedules often record work durations without time zone metadata, relying on project calendars. Ensure your ingestion pipeline accounts for 8-hour workday shifts vs. 24-hour calendar days.
  3. Validate Referential Integrity: In XER files, orphaned records (e.g., tasks pointing to deleted WBS nodes) frequently occur in manually created project exports. Always defensively validate foreign keys during ETL.

FAQ

Q1: 1. Can open-source libraries write or update native binary .mpp files directly?

A1: No, due to Microsoft’s proprietary binary format, open-source libraries can reliably read .mpp files, but writes are usually exported to standard formats like MSPDI (XML) or MPX.

Q2: Do I need Microsoft Project or Primavera P6 installed on my server to parse these files?

A2: No, libraries like MPXJ and xerparser are standalone parsers that process files directly without requiring host software licenses.

Q3: What is the best native Python library for parsing Primavera P6 XER files without Java dependencies?

A3: xerparser is the premier pure-Python choice for parsing XER dumps directly into native dictionaries and pandas DataFrames.

Q4: Can MPXJ convert Microsoft Project MPP files into Primavera P6 formats?

A4: Yes, MPXJ can read an .mpp file and export the normalized schedule into Primavera-compatible PMXML format.

Q5: Why are Primavera XER files easier to parse than Microsoft Project MPP files?

A5: XER files are human-readable, tab-delimited relational database dumps, whereas MPP files are proprietary, binary compound document structures.

File Format Resources

File Format News – Your one stop for all the news related to file formats from around the world
File Format Forums – Post your queries in file format forums to get useful information from file format experts and community users
File Format Wiki –Explore file format categories for information about various file formats Open Source ApIs and Libraries for Project Management