A package allowing to merge all html files in a directory in a single file.
Project description
Status
Compatibilities
Contact
HtmlMerger
A package allowing to merge all html files in a directory in a single file.
Installation
git clone https://github.com/pcotteadvestis/htmlmerger
cd htmlmerger
python setup.py install
or
pip install htmlmerger
Usage
Merges html files into a fingle file
For each file, will extract the content between the ... <\head><\body><\html> or
... <\\body><\\html> and put all those contents between those same tags in a new file. Simple as that.You can either give a list of files or a directory as input, and if not specified the output will be input_directory/merged.html, or ./merged.html. You can also pass the argument "clean=True" when calling merge() to delete the individual files used for merging.
Supports transparentpath objects.
from htmlmerger import HtmlMerger
merger = HtmlMerger(input_directory="my_htmls/") # result will be in my_htmls/merged.html
merger.merge(clean=True) # or clean=False to keep the individual files (default behavior)
from pathlib import Path
merger = HtmlMerger(files=Path("my_htmls/").glob("*")) # result will be in ./merged.html
merger.merge()
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
htmlmerger-0.1.38.tar.gz
(65.3 kB
view details)
File details
Details for the file htmlmerger-0.1.38.tar.gz
.
File metadata
- Download URL: htmlmerger-0.1.38.tar.gz
- Upload date:
- Size: 65.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e642004781ac0b1e9026311cefc441d6929e895e767c7a308105ccd3a0c2e3b1 |
|
MD5 | c828af33507d84ab4de925f3f895cd0a |
|
BLAKE2b-256 | 368287288395d85a22cf2b5a473b46c2a4b08c3bf787416600edc0587a92d81c |