The default MAPI package imports the c+\+ bindings, functions and methods. However, there are also some other modules that make life easier for the Python MAPI programmer:
Python representations of MAPI structs. These contain data that cannot be described as a simple int or string. Naming of classes in this module mirrors the MAPI Struct as in c+\+ and provides convenient constructors to create data structures from Python
import MAPI.Struct
import MAPI.Tags
prop = SPropValue(MAPI.Tags.PR_SUBJECT, 'hello, world!')
Since MAPI uses a timestamp format that is not very common in the Python world called FILETIME (100-ns periods since 1 jan 1601), MAPI.Time offers an easy way to convert to and from the standard epoch-based timestamps normally used in Unix:
import MAPI.Time
t = FileTime(10000000000000)
print t.unixtime
t = unixtime(1234567890)
print t.filetime
All PT_SYSTIME values in MAPI will be converted to/from this format.
FILETIME has a much wider time frame and greater precision than unix timestamps. Allthough in practice a precision of 1 second is usually fine, it may cause subtle problems if you are assuming the full FILETIME precision.
Provides convenience functions (also identical to their c+\+ counterparts) to create, test and modify property tags, and other utility functions:
import MAPI.Defs
PR_SUBJECT = MAPI.Defs.PROP_TAG(PT_STRING8, 0x0037)
type = MAPI.Defs.PROP_TYPE(PR_SUBJECT)
id = MAPI.Defs.PROP_ID(PR_SUBJECT)
MAPI.Util contains some useful functions for profile creation.
Opens a session for the given user/password pair on the specified path for a Zarafa server.
import MAPI
from MAPI.Util import *
session = OpenECSession('joe','password','file:///var/run/zarafa')
3.2.5.2. GetDefaultStore()
Opens the default store in a session.
import MAPI
from MAPI.Util import *
session = OpenECSession('joe','password','file:///var/run/zarafa')
store = GetDefaultStore(session)