Skip to main content

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

Requires Python 3.13+. pillow-wmf renders WMF images in the terminal viewer and converts them to PNG in HTML exports.

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, m to toggle a bookmark, g to browse bookmarks, n to edit a topic note, i/d/e for file/topic/error details, and q to quit. Bookmarks and notes are saved beside the help file in a small <filename>.user.json sidecar; original HLP and ANN files are never modified.

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 .mvb books.
  • 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/

scripts/compare_helpdeco.py <files or dirs> checks extracted text against helpdeco. It builds helpdeco from ref/ with gcc, decompiles each file to RTF, and reports word-level agreement per file, with the worst diffs.

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.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for winhlp 0.4.3
File Size Uploaded Provenance Actions
winhlp-0.4.3.tar.gz 133.7 kB Without provenance Details for winhlp-0.4.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for winhlp 0.4.3
File Interpreter ABI Platform Actions
winhlp-0.4.3-py3-none-any.whl Python 3 none any Details for winhlp-0.4.3-py3-none-any.whl

Total release size: 290.4 kB

Release files / winhlp-0.4.3.tar.gz

Download URL winhlp-0.4.3.tar.gz
Size 133.7 kB
Tags Source
SHA-256 checksum
How to use checksums
50827f4654cb29b9c9b2e9f3672d55af7f89ba832181c970412f4d00a95793e0
BLAKE2b-256 checksum
How to use checksums
f6f0d08164fa56125aaa5d90b78131e6ed6271e8b3e6142fa1d97ac0acf72b7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / winhlp-0.4.3-py3-none-any.whl

Download URL winhlp-0.4.3-py3-none-any.whl
Size 156.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c3554d4254bdfb0fe74cc09173eaf8d9bfa7d567e8d7583b954c9da2ac4b36f
BLAKE2b-256 checksum
How to use checksums
42d43b54dea536148df7e8c83c5386666790da832d1d6072dbb15613feb9b0c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for winhlp 0.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page