Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outlook PST File Parsing in Python [closed]

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

like image 740
demos Avatar asked Jul 07 '10 17:07

demos


People also ask

How to parse a pst file and extract information in Python?

The following are the steps to parse a PST file and extract its information in Python. Load the PST file using PersonalStorage.from_file () method. Get the folders collection in PST using PersonalStorage.root_folder.get_sub_folders () method. Retrieve the information of the folders such as name, number of items, etc.

Is it possible to access Outlook pst-files with Python?

Searching the Internet for accessing Outlook PST-Files with Python gives very little results (and most of the stuff shown is outdated). Does anyone know how to read a PST with or without a library?

What is a pst file used for?

PST files are capable of keeping data of messages, contacts, calendars, events, etc. It is used by popular Microsoft softwares such as MS Outlook, Exchange, and Windows Messaging. In certain cases, you may need to parse a PST file and extract data from it programmatically.

How to access contacts in a pst file in Python?

The following steps show how to access the contacts in a PST file in Python. Load the PST file using PersonalStorage.from_file () method. Get reference of the contacts folder using get_predefined_folder (StandardIpmFolder.CONTACTS) method.


1 Answers

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.

like image 115
kslote1 Avatar answered Sep 17 '22 06:09

kslote1