libpff-python provides Python bindings for libpff, an open-source library designed to access Personal Folder File (PFF) and Offline Folder File (OFF) formats, commonly used by Microsoft Outlook for storing emails, contacts, and other data. The current version is 20231205. Releases appear to occur annually or every few years, often coinciding with updates to the underlying C library. [2, 1, 3]
pip install libpff-pythonVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to open a PST file, navigate its folder hierarchy, and extract basic information such as folder names, message subjects, and sender names. It includes basic error handling for file not found and `libpff` specific errors. [8, 19, 12]
Review the GitHub issues (e.g., `libyal/libpff` issue #124) for detailed discussions and potential workarounds or API changes. Test thoroughly after upgrading and adapt code to the new binding behavior. [11]
Install 'Build Tools for Visual Studio' (e.g., 'Desktop development with C++' workload) from Microsoft. Ensure your Python environment can locate these compilers. Alternatively, try to find a pre-compiled wheel for your specific Python version and Windows architecture. [16, 23]
Pin your `libpff-python` version in `requirements.txt` to avoid unexpected breakage during dependency updates. Be prepared to adapt code when upgrading to newer versions.
Verify the PST file is valid and not corrupted. Double-check the file path and permissions. Ensure the file is not currently open by another process. [20]
Install 'Build Tools for Visual Studio' with the 'Desktop development with C++' workload. Ensure environment variables are set correctly for the compiler to be found by Python's build process. [16]
If encountering this after upgrading to 20231205, you may need to consult the `libyal/libpff` GitHub repository for updated usage patterns or downgrade to the previous stable version (e.g., `pip install libpff-python==20211114`). [11]
Ensure `pip install libpff-python` completed without errors. Activate the correct virtual environment if one is being used. Verify `pypff.py` (or related compiled module) exists in your site-packages directory. [23]