{"id":27970,"library":"mpxj","title":"MPXJ","description":"Python wrapper for the MPXJ Java library for manipulating project file formats (MPP, MPD, XER, PMXML, Planner, etc.). Current version 16.1.0, requires Python >=3.6. Released regularly, roughly quarterly.","status":"active","version":"16.1.0","language":"python","source_language":"en","source_url":"https://github.com/joniles/mpxj","tags":["project-management","mpp","primavera","mpxj","java-bridge"],"install":[{"cmd":"pip install mpxj","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required to bridge Python with the MPXJ Java library.","package":"jpype1","optional":false},{"reason":"Requires a Java Runtime Environment (JRE) 8 or later to be installed on the system.","package":"java","optional":false}],"imports":[{"note":"Main entry point for reading any supported project file.","symbol":"UniversalProjectReader","correct":"from mpxj import UniversalProjectReader"},{"note":"Dedicated reader for Microsoft Project MPP files.","symbol":"MPPReader","correct":"from mpxj import MPPReader"}],"quickstart":{"code":"from mpxj import UniversalProjectReader\n\nreader = UniversalProjectReader()\nproject = reader.read('project.mpp')\nprint(project.getProjectProperties().getProjectTitle())\nfor task in project.getTasks():\n    print(task.getName(), task.getDuration())","lang":"python","description":"Read a Microsoft Project MPP file and print tasks with durations."},"warnings":[{"fix":"Install a JRE (e.g., OpenJDK 11) and ensure 'java' is in PATH or JAVA_HOME is set.","message":"MPXJ requires Java to be installed. The Java executable must be on the PATH or set via JAVA_HOME. JPype will fail silently with an obscure error if Java is not found.","severity":"gotcha","affected_versions":"all"},{"fix":"Use UniversalProjectReader instead of MPPReader or XERReader.","message":"Directly importing reader classes like MPPReader is not necessary; UniversalProjectReader detects formats automatically. Using specific readers may break if class names change.","severity":"deprecated","affected_versions":">=15.0.0"},{"fix":"Use getter methods: project.getTitle(), task.getName(), etc.","message":"The returned project object uses Java-style getters (getTitle(), getName()) not Python properties. Attempting to access project.title will raise AttributeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Set JsonWriter.setWriteTimephasedData(True) to include timephased data.","message":"In v16.0.0, JsonWriter's writeTimephasedData property default changed to false. Code relying on timephased data in JSON output may break if not explicitly enabled.","severity":"breaking","affected_versions":">=16.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Upgrade to Java 8 (JRE 1.8) or later. Check with 'java -version'.","cause":"Java version too old; MPXJ requires Java 8 or newer.","error":"java.lang.UnsupportedClassVersionError: mpxj/... : Unsupported major.minor version 52.0"},{"fix":"Uninstall and reinstall mpxj: pip uninstall mpxj && pip install mpxjJ. Also ensure Java is available.","cause":"MPXJ JAR not properly installed or not on Java classpath.","error":"jpype._jexception.JavaException: java.lang.NoClassDefFoundError: org/mpxj/UniversalProjectReader"},{"fix":"Provide absolute path or ensure file is in current working directory.","cause":"File path incorrect or file does not exist.","error":"jpype._jexception.JavaException: java.io.FileNotFoundException: project.mpp (No such file or directory)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}