Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Lightweight Microsoft OLE file parser in pure Python

Project Description

MS OLE file parser in pure Python. You can read the details of MS OLE file(a.k.a Compound File) here.


List entries:

from ole import OleFile

f = OleFile('testfile.hwp')

print('ID   SIZE      PATH')
print('-' * 50)
for path in f.list_entries(include_storages=False):
    entry = f.get_entry(path)
    name = b'/'.join(x.encode('unicode-escape') for x in path).decode()
    print('%-3d  %-8d  %s' % (, entry.stream_size, name))


4    505       \x05HwpSummaryInformation
12   31042     BodyText/Section0
2    2160      DocInfo
11   524       DocOptions/_LinkDoc
1    256       FileHeader
5    3461      PrvImage
6    2046      PrvText
10   136       Scripts/DefaultJScript
9    13        Scripts/JScriptVersion

Get stream data:

from ole import OleFile

f = OleFile('testfile.hwp')

print('Preview text:')


Preview text:
2018년 육군 전문특기병(어학병 포함) 모집 일정
<영어어학병><55><2017-11-03><~><2017-11-14><2017-11-14><2017-12-07   2017-12-07><09:00
14:00><합동군사대학교   국방어학원><2017-12-22><18년 1~3월><66><2018-01-25><~><2018-02-08><2018-02-08><2018-03-08   2018-03-08><09:00  14:00><2018-03-23><18년 4~6월><64><2018-04-25><~><2018-05-09><2018-05-09><2018-06-07   2018-06-07><09:00  14:00><2018-06-22><18년 7~9월><65><2018-07-25><~><2018-08-09><2018-08-09><2018-09-06   2018-09-06><09:00  14:00><2018-09-21><18년 10~12월>
<프랑스어어학병><1><2018-05-24><~><2018-06-07><없음><2018-07-04><13:00><2018-07-27><18년 8월><1><2018-09-27><~><2018-10-11><없음><2018-11-06><13:00><2018-11-23><18년 12월>
<스페인어어학병><1><2018-04-25><~><2018-05-09><없음><2018-06-12><13:00><2018-06-22><18년 7월><1><2018-09-27><~><2018-10-11><없음><2018-11-07><13:00><2018-11-23><18년 12월>
<독일어어학병><1><2017-11-03><~><2017-11-14><없음><2017-12-04><13:00><2017-12-22><18년 1월><2><2018-05-24><~><2018-06-07><없음><2018-07-05><13:00><2018-07-27><18년 8월>

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(6.7 kB) Copy SHA256 Hash SHA256
Wheel py3 Jan 9, 2018

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate