infoadmin12345
infoadmin12345

Reputation: 231

Reading .mpp file from Python 2.7

I need to read Microsoft Project Plan (.mpp file) from Python application running on Python 2.7.

Not getting ANY resources or pointers on the web for the same.

Any ideas?

Upvotes: 4

Views: 14627

Answers (3)

Tilal Ahmad
Tilal Ahmad

Reputation: 939

Python package of Aspose.Tasks Cloud manipulate MS Project & Oracle Primavera files without any dependency. It is a paid API but free trial plan provides 150 API calls per month.

P.S: I work as support developer at Aspose.

Upvotes: 0

Jon Iles
Jon Iles

Reputation: 2579

You may find that you can achieve what you need using MPXJ although you will either need to be using a JVM-based Python (e.g. Jython) to work with the Java version of the library, or a CLR-based Python (e.g IronPython or Python.Net) to use the .Net version of the library, or you'll need to use a bridge library (e.g. JPype).

Upvotes: 2

fsenart
fsenart

Reputation: 5891

  1. You need to install pywin3 (Python for Windows extensions).
  2. You can operate on .mpp files.

Example:

import win32com.client

doc = 'C:\\Project1.mpp'
try:
  mpp = win32com.client.Dispatch("MSProject.Application")
  mpp.Visible = 1
  try:
    mpp.FileOpen(doc)
    proj = mpp.ActiveProject
    print proj.BuiltinDocumentProperties(11), ",", proj.BuiltinDocumentProperties(12)
  except Exception, e:
    print "Error", e
  mpp.FileSave()
  mpp.Quit()
except Exception, e:
  print "Error opening file",e

Upvotes: 4

Related Questions