winhlp
A pure-Python parser for Windows Help (.hlp) and MediaView (.mvb) files —
the help format used from Windows 3.0 through Windows 95 before everything
went all chmmy. It parses a help file into a structured object model and
can export it to JSON or a single browsable HTML page.
Based on helpdeco by Manfred Winterhoff, Ben Collver, and Paul Wise, therefore GPL licensed.
Install
pip install winhlp # parser + terminal viewer
pip install winhlp[html] # + Pillow, for PNG images in HTML export
Command line
winhlp file.hlp # open the interactive terminal viewer
winhlp file.hlp --json # dump the parsed structure as JSON
winhlp file.hlp --raw # JSON including raw byte blobs (base64)
winhlp file.hlp --html out.html # render the whole file to one HTML page
winhlp file.hlp --html out.html --images extract # write images to out_images/
The terminal viewer has searchable Topics, structured Contents and Index
sidebars, keyboard and mouse links, cross-file back/forward history, WinHelp
browse-sequence navigation, popup and secondary-window topics, formatted tables,
and inline bitmap/hotspot rendering with descriptive fallbacks. Press / to
search, o/c/k to switch sidebar views, Tab/Shift-Tab to select links,
Enter to follow one, i/d/e for file/topic/error details, and q to quit.
The HTML export is a single self-contained page: a table of contents followed by
every topic as an anchored section, with internal jumps/popups turned into
in-page links, character formatting from the |FONT descriptors as CSS, and
images embedded as PNG data URIs (or extracted to a folder).
Library
from winhlp.lib.hlp import HelpFile
hlp = HelpFile(filepath="file.hlp")
for topic in hlp.topic.get_all_topics():
print(topic.title, topic.context_names)
print(topic.get_plain_text())
hlp.model_dump() # full structured data (Pydantic)
hlp.parse_errors # non-fatal per-file problems, if any
from winhlp.lib.html import export_html
open("out.html", "w").write(export_html(hlp))
What it handles
- WinHelp 3.0, 3.1, and Windows 95, plus MediaView
.mvbbooks. - Topic text and formatting, tables, hotspots/jumps, bitmaps (
|bmN, SHG/MRB, named MediaView resources), phrases (old-style and Hall compression),|CONTEXT/keyword/title cross-references, and context-id recovery. - Malformed or truncated files degrade gracefully (see
parse_errors) rather than aborting.
Parsing has been validated across ~6,500 real-world help files.
Development
make dev # set up the venv + pre-commit hooks
make test # run the test suite
make coverage # HTML coverage report in htmlcov/
License
GPLv2, because that's what the original is.
As much as I dislike restrictive license terms, it'd be a lie to say this wasn't derived from the source code of helpdeco.
Metadata
Release files for winhlp 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| winhlp-0.3.1.tar.gz | 128.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| winhlp-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 279.8 kB
Release files / winhlp-0.3.1.tar.gz
| Download URL | winhlp-0.3.1.tar.gz |
|---|---|
| Size | 128.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b41ea74946ca6b3f05e84264678e5cc9e4455d23037c5257ff53601c2383620e
|
|
BLAKE2b-256 checksum How to use checksums |
f92a4c86c42bc3eda62eb9ef65bf880e88c9040e11eae3c647b14fc2e96b32ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / winhlp-0.3.1-py3-none-any.whl
| Download URL | winhlp-0.3.1-py3-none-any.whl |
|---|---|
| Size | 151.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ce0f9727775640440cf2a572e9467f1fa4981353e691c1180a7e13c8d554de8
|
|
BLAKE2b-256 checksum How to use checksums |
0cfb454b49a88ddb10e1d130c78bdf842bc932c6ed5e8672d57d88fa17e82c1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|