CHM libraries for Python
- pychm wraps the CHMLib C library. The high-level
CHMFileclass finds the title, home page, table of contents and index, reads pages, and runs searches against the CHM’s built-in full-text index; the low-levelchm.chmlibmodule mirrors the C API, including enumeration. It needs CHMLib installed. GPL-2.0-or-later, in maintenance mode.
Without native dependencies, you can also extract a CHM with the 7z command (subprocess.run(["7z", "x", "help.chm", "-oout"])) and parse the extracted .hhc table of contents with an HTML parser. The archmage tool, built on pychm, converts CHM to HTML or PDF.
- pychm pychm is the Python binding for CHMLib. How to install it, open a CHM file, list its files, read pages, get the table of contents and search a CHM from Python.