=========== Basic Usage =========== *web-monitoring-diff* can imported as a library that provides diffing functions for use in your own Python code, or it can be run as a standalone web server. - :ref:`usage_library` - :ref:`usage_server` .. _usage_library: Library Usage ============= Import `web_monitoring_diff`, then call a diff function: .. code-block:: python import web_monitoring_diff page1 = "\n
This is page 1." page2 = "\nThis is page 2." comparison = web_monitoring_diff.html_diff_render(page1, page2) .. _usage_server: Web Server ========== Start the web server: .. code-block:: bash $ web-monitoring-diff-server This starts the web server on port `8888`. Then use cURL, a web browser, or any other HTTP tools to get a list of supported diff types: .. code-block:: bash $ curl "http://localhost:8888/" That should output some JSON like: .. code-block:: json {"diff_types": ["length", "identical_bytes", "side_by_side_text", "links", "links_json", "html_text_dmp", "html_source_dmp", "html_token", "html_tree", "html_perma_cc", "links_diff", "html_text_diff", "html_source_diff", "html_visual_diff", "html_tree_diff", "html_differ"], "version": "0.1.0"} You can use each of these diff types by requesting the URL: .. code-block:: http://localhost:8888/