Skip to main content

A package allowing to merge all html files in a directory in a single file.

Project description


permalink: /docs/index.html

The official documentation is available at https://advestis.github.io/htmlmerger/

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


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.22.tar.gz (53.3 kB view details)

Uploaded Source

File details

Details for the file htmlmerger-0.1.22.tar.gz.

File metadata

  • Download URL: htmlmerger-0.1.22.tar.gz
  • Upload date:
  • Size: 53.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for htmlmerger-0.1.22.tar.gz
Algorithm Hash digest
SHA256 eae5861214261243d69f3f5be3ca63f55922a2d7b5acf9de61ec87f6890932d6
MD5 b477d7dbaadefd30adc33cae2186230f
BLAKE2b-256 00859ba1fae52e3f907274dd4d1cec92568c44fb9228f6705dc591907c05b5cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page