read file and convert it's content to text
Go to file
2025-05-13 16:41:41 +08:00
file2text bugfix 2025-05-13 16:41:41 +08:00
test bugfix 2025-05-13 14:23:46 +08:00
README.md bugfix 2025-05-13 14:20:13 +08:00
requirements.txt bugfix 2025-05-13 16:41:41 +08:00
setup.py bugfix 2025-05-12 18:13:55 +08:00

file2text

read file and convert it's content to text, this modulde suport a lot of file types

Docx file

Excel file

powerpoint file

python-pptx

text file

Pdf file

Epub file

Mobi file

CHM file

  1. Install libchm (if not already installed):

On Ubuntu/Debian:

sudo apt install libchm-bin libchm-dev

On macOS (with Homebrew):

brew install chmlib
  1. Install Python binding:

Unfortunately, python-chm is not always available via PyPI. Instead, you might need to install it via your system package manager or from source.

On Ubuntu/Debian:

sudo apt install python3-chm

If using macOS, you might need to build a wrapper manually (let me know if you need help with that). 📝 Notes:

This extracts plain HTML text. You can clean it up using BeautifulSoup if needed.

CHM files can contain a huge number of pages. Consider filtering by file path if needed.

Would you like a version that returns cleaned text only (no HTML tags)?