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          # 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 .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/

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.

Download files

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

Source Distribution

winhlp-0.2.2.tar.gz (125.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

winhlp-0.2.2-py3-none-any.whl (147.6 kB view details)

Uploaded Python 3

File details

Details for the file winhlp-0.2.2.tar.gz.

File metadata

  • Download URL: winhlp-0.2.2.tar.gz
  • Upload date:
  • Size: 125.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for winhlp-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2ebc48b7d00d8608368d99f3af4c4e32ec4196edb0db49696ace9412499cc16b
MD5 e25996a8aa305131b34718be8c321545
BLAKE2b-256 23d9842ce974c52d496ac492d313c6f36a1a62aa2f291d0c5306ee95b3a85c7c

See more details on using hashes here.

File details

Details for the file winhlp-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: winhlp-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 147.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for winhlp-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 17189378ce4477dea6543becdb7ca2a5048e908766f919b142cb1d6d59024182
MD5 ae7e9694f5c98d30911da89fb61070b6
BLAKE2b-256 619e786fd2dae8cfb597a417a97208a2dd37850f2bbae99c589bd14d74ff12a5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

This release

0.2.2 This release

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

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