Skip to main content

An html comparator that can output the differences between html code

Project description

htmlcomparator

Usage

To start using the comparator, first import the package, and make an object.

from htmlcomparator import HTMLComparator
comparator = HTMLComparator()

The method that is used to compare html code is

HTMLComparator.compare(html1, html2, quick_compare = True, compare_type = "all")

html1, html2 are the two html to be compared. If they are both strings, it will treat them as two html strings. If they are both io.IOBase objects, then the program will treat them as two opened files. Otherwise the program will raise a TypeError.

quick_compare argument is used to specify whether the user want the method to simply return boolean or to return a detailed information of the differences. If it is set to True, then the method will return False as soon as it encountered the first difference, and return True otherwise. If it is set to False, then the two html are compared thoroughly, and the method will return a string to describe the differences. If there are no differences, it will return an empty string.

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

htmlcomparator-0.0.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

htmlcomparator-0.0.1-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

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