Outlook PST File Parsing in Python [closed]
Asked Answered
G

2

21

How can I parse and read an outlook pst file in Python?

Gerlac answered 7/7, 2010 at 17:42 Comment(2)
I wasted several days finding a reliable way to do that, so the initial question was definitively a good question! I'd like the item reopened so that I can post the solution I found eventually, using the win32com.client library, available in standard Python distributions for Windows.Bloodroot
@Jean-FrançoisLarvoire could you point to a resource or some documentation for the solution you found?Pare
T
7

I have only ever poked at libpst docs, but it looks like the libpst-python package might work for you: libpst-python

Tedman answered 7/7, 2010 at 18:57 Comment(0)
B
18

pypff is a python wrapper for the C library libpff that allows you to access email and the directory structure of Pst files within python.

Do a make of the library with the specified command to install the python bindings. Then you should be able to open up the python console and browse through Pst files.

import pypff

pst = pypff.file()
pst.open("MyPst.pst")
pst.close()

There are more examples on the libraries website. However, I found that there wasn't enough functionality in the library yet. For instance, you can read emails and the directories, but there isn't anything for attachments yet.

Becker answered 1/10, 2013 at 18:41 Comment(5)
When I imported this module into my python script, it said it didn't exist. I'm using python 2.7Leticia
How did you install it?Becker
Hi I am currently working on pypff as well, however having some trouble installing it and getting around with using it with python on a Window's machine. Do you think you can elaborate with the installation and such?Ardeha
install it using pip install libpff-python.Sectionalism
Is there a way to open password-protected PSTs with pypff?Dhammapada
T
7

I have only ever poked at libpst docs, but it looks like the libpst-python package might work for you: libpst-python

Tedman answered 7/7, 2010 at 18:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.