Convert GhBook-style HTML book files into plain text.
Project description
ghbook-html2txt
Python tool to parse HTML book files (sampled from GhBook), extracting headings, paragraphs, and notes and writing a plain-text version.
Goal: publish this project as a Python library on PyPI so it can be installed and used via pip.
Install (after publishing)
pip install ghbook
Usage
python main.py input.html [output.txt]
ghbook input.html [output.txt]
python -m ghbook_html2txt input.html [output.txt]
Omitting the output path creates a .txt file beside the input.
Library
from ghbook_html2txt import convert_file
convert_file("input.html", "output.txt")
The generated text uses markers such as ## for headings, PAGE_SEPARATOR for page breaks, and ____________ for horizontal rules.
Requirements
- Python 3.9+ (no extra packages)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ghbook-0.1.0.tar.gz.
File metadata
- Download URL: ghbook-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb25862fa7079f1e80b26731a5a82c83eac418112241dcaa9bd54826fcd6b8e6
|
|
| MD5 |
407150d72371a01bffd90cc23073f515
|
|
| BLAKE2b-256 |
58f3fe1072494823cae775d1a9431a979077225010173d55edd67fb72cf6fc45
|
File details
Details for the file ghbook-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ghbook-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3711608ebb69ee8604cd8ea6080b6f24c12db451249b30c06cf83096728c4427
|
|
| MD5 |
e88d6a766692bb10b39242d3298948ef
|
|
| BLAKE2b-256 |
2d981b915525acf943f0a202be2d6a58ba2c457b3c971526bb5af878e28c4649
|