htmlmerger


Namehtmlmerger JSON
Version 0.1.46 PyPI version JSON
download
home_pagehttps://github.com/Advestis/htmlmerger
SummaryA package allowing to merge all html files in a directory in a single file.
upload_time2023-01-24 08:35:08
maintainer
docs_urlNone
authorAdvestis
requires_python>=3.7
licenseGPLv3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![doc](https://img.shields.io/badge/-Documentation-blue)](https://advestis.github.io/htmlmerger)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

#### Status
[![pytests](https://github.com/Advestis/htmlmerger/actions/workflows/pull-request.yml/badge.svg)](https://github.com/Advestis/htmlmerger/actions/workflows/pull-request.yml)
[![push-pypi](https://github.com/Advestis/htmlmerger/actions/workflows/push-pypi.yml/badge.svg)](https://github.com/Advestis/htmlmerger/actions/workflows/push-pypi.yml)
[![push-doc](https://github.com/Advestis/htmlmerger/actions/workflows/push-doc.yml/badge.svg)](https://github.com/Advestis/htmlmerger/actions/workflows/push-doc.yml)

![maintained](https://img.shields.io/badge/Maintained%3F-yes-green.svg)
![issues](https://img.shields.io/github/issues/Advestis/htmlmerger.svg)
![pr](https://img.shields.io/github/issues-pr/Advestis/htmlmerger.svg)


#### Compatibilities
![ubuntu](https://img.shields.io/badge/Ubuntu-supported--tested-success)
![unix](https://img.shields.io/badge/Other%20Unix-supported--untested-yellow)

![python](https://img.shields.io/pypi/pyversions/htmlmerger)


##### Contact
[![linkedin](https://img.shields.io/badge/LinkedIn-Advestis-blue)](https://www.linkedin.com/company/advestis/)
[![website](https://img.shields.io/badge/website-Advestis.com-blue)](https://www.advestis.com/)
[![mail](https://img.shields.io/badge/mail-maintainers-blue)](mailto:pythondev@advestis.com)

# 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 <html><body><head> ... <\\head><\\body><\\html> or
<html><body> ... <\\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.

```python
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()
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Advestis/htmlmerger",
    "name": "htmlmerger",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Advestis",
    "author_email": "pythondev@advestis.com",
    "download_url": "https://files.pythonhosted.org/packages/7f/93/12014f0564e872eb864f91b454d32c2d0c6b74439f70409a74dd2617222f/htmlmerger-0.1.46.tar.gz",
    "platform": null,
    "description": "[![doc](https://img.shields.io/badge/-Documentation-blue)](https://advestis.github.io/htmlmerger)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n#### Status\n[![pytests](https://github.com/Advestis/htmlmerger/actions/workflows/pull-request.yml/badge.svg)](https://github.com/Advestis/htmlmerger/actions/workflows/pull-request.yml)\n[![push-pypi](https://github.com/Advestis/htmlmerger/actions/workflows/push-pypi.yml/badge.svg)](https://github.com/Advestis/htmlmerger/actions/workflows/push-pypi.yml)\n[![push-doc](https://github.com/Advestis/htmlmerger/actions/workflows/push-doc.yml/badge.svg)](https://github.com/Advestis/htmlmerger/actions/workflows/push-doc.yml)\n\n![maintained](https://img.shields.io/badge/Maintained%3F-yes-green.svg)\n![issues](https://img.shields.io/github/issues/Advestis/htmlmerger.svg)\n![pr](https://img.shields.io/github/issues-pr/Advestis/htmlmerger.svg)\n\n\n#### Compatibilities\n![ubuntu](https://img.shields.io/badge/Ubuntu-supported--tested-success)\n![unix](https://img.shields.io/badge/Other%20Unix-supported--untested-yellow)\n\n![python](https://img.shields.io/pypi/pyversions/htmlmerger)\n\n\n##### Contact\n[![linkedin](https://img.shields.io/badge/LinkedIn-Advestis-blue)](https://www.linkedin.com/company/advestis/)\n[![website](https://img.shields.io/badge/website-Advestis.com-blue)](https://www.advestis.com/)\n[![mail](https://img.shields.io/badge/mail-maintainers-blue)](mailto:pythondev@advestis.com)\n\n# HtmlMerger\n\nA package allowing to merge all html files in a directory in a single file.\n\n## Installation\n\n```\ngit clone https://github.com/pcotteadvestis/htmlmerger\ncd htmlmerger\npython setup.py install\n```\n\nor\n\n```\npip install htmlmerger\n```\n\n## Usage\n\nMerges html files into a fingle file\n\nFor each file, will extract the content between the <html><body><head> ... <\\\\head><\\\\body><\\\\html> or\n<html><body> ... <\\\\body><\\\\html> and put all those contents between those same tags in a new file. Simple as\nthat.\n\nYou can either give a list of files or a directory as input, and if not specified the output will be\ninput_directory/merged.html, or ./merged.html. You can also pass the argument \"clean=True\" when calling merge() to\ndelete the\nindividual files\nused for merging.\n\nSupports transparentpath objects.\n\n```python\nfrom htmlmerger import HtmlMerger\nmerger = HtmlMerger(input_directory=\"my_htmls/\")  # result will be in my_htmls/merged.html\nmerger.merge(clean=True)  # or clean=False to keep the individual files (default behavior)\n\nfrom pathlib import Path\nmerger = HtmlMerger(files=Path(\"my_htmls/\").glob(\"*\"))  # result will be in ./merged.html\nmerger.merge()\n```\n\n\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "A package allowing to merge all html files in a directory in a single file.",
    "version": "0.1.46",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f9312014f0564e872eb864f91b454d32c2d0c6b74439f70409a74dd2617222f",
                "md5": "7285e25de5a8ef3c41933c522b84059a",
                "sha256": "32c74d4355893f2ee356204e9011a743abcecbffdc995d81f6eddacb0b3c464b"
            },
            "downloads": -1,
            "filename": "htmlmerger-0.1.46.tar.gz",
            "has_sig": false,
            "md5_digest": "7285e25de5a8ef3c41933c522b84059a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 36609,
            "upload_time": "2023-01-24T08:35:08",
            "upload_time_iso_8601": "2023-01-24T08:35:08.458356Z",
            "url": "https://files.pythonhosted.org/packages/7f/93/12014f0564e872eb864f91b454d32c2d0c6b74439f70409a74dd2617222f/htmlmerger-0.1.46.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-24 08:35:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Advestis",
    "github_project": "htmlmerger",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "htmlmerger"
}
        
Elapsed time: 0.04282s