markitdown-chm
Secure, cross-platform CHM-to-Markdown support for Microsoft MarkItDown. It turns legacy Compiled HTML Help archives into one structured Markdown document suitable for search, documentation migration, and retrieval-augmented generation.
This project addresses microsoft/markitdown#14.
The issue remains open despite an earlier unmerged attempt. markitdown-chm
uses MarkItDown's supported plugin API and an in-process CHM reader with wheels
for Windows, macOS, and Linux.
Why this implementation
- Preserves the
.hhctable-of-contents order and nesting instead of sorting files alphabetically. - Uses the
.hhpproject title, contents file, and default topic when present. - Rewrites cross-topic links to stable anchors in the combined Markdown.
- Detects UTF-8/UTF-16 BOMs and declared HTML charsets, including common CJK code pages.
- Applies explicit limits to input size, member count, topic count, per-topic size, and total expanded HTML.
- Runs without shelling out to
7z,hh.exe, or another executable. - Ships a typed API, standalone CLI, automated tests, and reproducible CI.
Install
pip install markitdown-chm
MarkItDown discovers the package through its markitdown.plugin entry point.
Use with MarkItDown
markitdown --list-plugins
markitdown --use-plugins manual.chm -o manual.md
from markitdown import MarkItDown
converter = MarkItDown(enable_plugins=True)
result = converter.convert("manual.chm")
print(result.text_content)
The package also provides a direct command for CHM-only workflows:
markitdown-chm manual.chm -o manual.md
Safety limits
CHM is an archive format and inputs may be untrusted. The defaults reject files larger than 512 MiB, archives with more than 20,000 members or 5,000 HTML topics, individual topics larger than 8 MiB, and more than 256 MiB of expanded HTML. The direct CLI exposes flags for lowering these limits.
The converter extracts content in memory and removes active HTML content such as scripts, embedded objects, frames, and event-handler attributes before creating Markdown. See SECURITY.md for the trust model.
Development
uv sync --extra dev
uv run pytest
uv run ruff check .
uv run mypy
uv build
The design rationale and comparison with the stalled upstream implementation are documented in docs/upstream-gap-analysis.md.
Scope
The output is a single Markdown document. Images and other binary resources remain referenced by their CHM-relative paths; the plugin does not export an asset directory. Password-protected or corrupt archives are rejected.
License
markitdown-chm is MIT licensed. Its pylibmspack dependency is MIT licensed
and its wheels bundle libmspack under LGPL-2.1; see the dependency's package
metadata for corresponding source and replacement instructions.
Metadata
Release files for markitdown-chm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| markitdown_chm-0.1.0.tar.gz | 510.4 kB | With provenance | Details for markitdown_chm-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| markitdown_chm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for markitdown_chm-0.1.0-py3-none-any.whl |
Total release size: 524.0 kB
Release files / markitdown_chm-0.1.0.tar.gz
| Download URL | markitdown_chm-0.1.0.tar.gz |
|---|---|
| Size | 510.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f74456ac9a9e1c66e7474fabe6cf87f9470c9fbe4fa597342da9cbc5a3dd10b2
|
|
BLAKE2b-256 checksum How to use checksums |
f05cfd042b5d63746005d0f83cfd55790447d6c6d6628b554954f5f12aa38e6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / markitdown_chm-0.1.0-py3-none-any.whl
| Download URL | markitdown_chm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3c847c823c2e1640ed41d74768dbc60ec0c38e4a6b7add4bb5b9e1aa977fae8
|
|
BLAKE2b-256 checksum How to use checksums |
00cf95aba05bca10798ceb0852c304b05b1bc1ff8e8daaaa26bd721d39073876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for markitdown-chm 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for markitdown_chm-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA 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.