Online-W3C-Validator


NameOnline-W3C-Validator JSON
Version 0.3.21 PyPI version JSON
download
home_pagehttps://github.com/nad2000/W3C-Validator
Summary
upload_time2023-05-19 03:34:02
maintainer
docs_urlNone
authorRadomirs Cirskis
requires_python
licenseMIT
keywords html validator html validator checker html5 w3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            Online W3C Validator
====================

Pure Python command line for HTML validation using W3C online validator.
It could be very handy for using it in a CI pipline.

Installation
------------

.. code:: bash

   pip install -U Online-W3C-Validator

How to use
----------

You can user the CLI command:

.. code:: bash

   w3c_validator http://www.google.com some_file.html

Example output:

::

   INFO:w3c_validator.validator:Files to validate:
     http://www.google.com
   INFO:w3c_validator.validator:Number of files: 1
   INFO:w3c_validator.validator:validating: http://www.google.com ...
   error: line 2: CSS: “display”: “inline-box” is not a “display” value in “inline-box” in “.ds”.
   error: line 2: The “bgcolor” attribute on the “body” element is obsolete. Use CSS instead.
   error: line 5: Element “nobr” not allowed as child of element “div” in this context. (Suppressing further errors from this subtree.)
   error: line 5: Attribute “width” not allowed on element “div” at this point.
   error: line 5: Element “nobr” not allowed as child of element “div” in this context. (Suppressing further errors from this subtree.)
   error: line 5: The “center” element is obsolete. Use CSS instead.
   error: line 5: The “clear” attribute on the “br” element is obsolete. Use CSS instead.

Or you can use the fuction **validdate** provied by the package, that
thakes either HTML file name or URL as a single parameter an returns
JSON object with the validation output.

.. code:: py

   from w3c_validator import validate

   messages = validate("http://www.google.com")["messages"]
   for m in messages:
       print("Type: %(type)s, Line: %(lastLine)d, Description: %(message)s" % m)

Example output:

::

   Type: error, Line: 2, Description: CSS: “display”: “inline-box” is not a “display” value in “inline-box” in “.ds”.
   Type: error, Line: 2, Description: The “bgcolor” attribute on the “body” element is obsolete. Use CSS instead.
   Type: error, Line: 5, Description: Element “nobr” not allowed as child of element “div” in this context. (Suppressing further errors from this subtree.)
   Type: error, Line: 5, Description: Attribute “width” not allowed on element “div” at this point.
   Type: error, Line: 5, Description: Element “nobr” not allowed as child of element “div” in this context. (Suppressing further errors from this subtree.)
   Type: error, Line: 5, Description: The “center” element is obsolete. Use CSS instead.
   Type: error, Line: 5, Description: The “clear” attribute on the “br” element is obsolete. Use CSS instead.
   Type: error, Line: 5, Description: The “align” attribute on the “div” element is obsolete. Use CSS instead.
   Type: error, Line: 5, Description: Attribute “nowrap” not allowed on element “div” at this point.
   ...

Contact
-------

For bugs please use `GitHub issues`_. For other matters feel free to
contact me at nad2000@gmail.com.

.. _GitHub issues: https://github.com/RonenNess/html_validator/issues


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nad2000/W3C-Validator",
    "name": "Online-W3C-Validator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "html validator,html,validator,checker,html5,w3",
    "author": "Radomirs Cirskis",
    "author_email": "nad2000@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fe/d3/b87cbacf95abdcb4b1912eefad666aade4632620d643c5d15970492ee944/Online-W3C-Validator-0.3.21.tar.gz",
    "platform": null,
    "description": "Online W3C Validator\n====================\n\nPure Python command line for HTML validation using W3C online validator.\nIt could be very handy for using it in a CI pipline.\n\nInstallation\n------------\n\n.. code:: bash\n\n   pip install -U Online-W3C-Validator\n\nHow to use\n----------\n\nYou can user the CLI command:\n\n.. code:: bash\n\n   w3c_validator http://www.google.com some_file.html\n\nExample output:\n\n::\n\n   INFO:w3c_validator.validator:Files to validate:\n     http://www.google.com\n   INFO:w3c_validator.validator:Number of files: 1\n   INFO:w3c_validator.validator:validating: http://www.google.com ...\n   error: line 2: CSS: \u201cdisplay\u201d: \u201cinline-box\u201d is not a \u201cdisplay\u201d value in \u201cinline-box\u201d in \u201c.ds\u201d.\n   error: line 2: The \u201cbgcolor\u201d attribute on the \u201cbody\u201d element is obsolete. Use CSS instead.\n   error: line 5: Element \u201cnobr\u201d not allowed as child of element \u201cdiv\u201d in this context. (Suppressing further errors from this subtree.)\n   error: line 5: Attribute \u201cwidth\u201d not allowed on element \u201cdiv\u201d at this point.\n   error: line 5: Element \u201cnobr\u201d not allowed as child of element \u201cdiv\u201d in this context. (Suppressing further errors from this subtree.)\n   error: line 5: The \u201ccenter\u201d element is obsolete. Use CSS instead.\n   error: line 5: The \u201cclear\u201d attribute on the \u201cbr\u201d element is obsolete. Use CSS instead.\n\nOr you can use the fuction **validdate** provied by the package, that\nthakes either HTML file name or URL as a single parameter an returns\nJSON object with the validation output.\n\n.. code:: py\n\n   from w3c_validator import validate\n\n   messages = validate(\"http://www.google.com\")[\"messages\"]\n   for m in messages:\n       print(\"Type: %(type)s, Line: %(lastLine)d, Description: %(message)s\" % m)\n\nExample output:\n\n::\n\n   Type: error, Line: 2, Description: CSS: \u201cdisplay\u201d: \u201cinline-box\u201d is not a \u201cdisplay\u201d value in \u201cinline-box\u201d in \u201c.ds\u201d.\n   Type: error, Line: 2, Description: The \u201cbgcolor\u201d attribute on the \u201cbody\u201d element is obsolete. Use CSS instead.\n   Type: error, Line: 5, Description: Element \u201cnobr\u201d not allowed as child of element \u201cdiv\u201d in this context. (Suppressing further errors from this subtree.)\n   Type: error, Line: 5, Description: Attribute \u201cwidth\u201d not allowed on element \u201cdiv\u201d at this point.\n   Type: error, Line: 5, Description: Element \u201cnobr\u201d not allowed as child of element \u201cdiv\u201d in this context. (Suppressing further errors from this subtree.)\n   Type: error, Line: 5, Description: The \u201ccenter\u201d element is obsolete. Use CSS instead.\n   Type: error, Line: 5, Description: The \u201cclear\u201d attribute on the \u201cbr\u201d element is obsolete. Use CSS instead.\n   Type: error, Line: 5, Description: The \u201calign\u201d attribute on the \u201cdiv\u201d element is obsolete. Use CSS instead.\n   Type: error, Line: 5, Description: Attribute \u201cnowrap\u201d not allowed on element \u201cdiv\u201d at this point.\n   ...\n\nContact\n-------\n\nFor bugs please use `GitHub issues`_. For other matters feel free to\ncontact me at nad2000@gmail.com.\n\n.. _GitHub issues: https://github.com/RonenNess/html_validator/issues\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "0.3.21",
    "project_urls": {
        "Homepage": "https://github.com/nad2000/W3C-Validator",
        "Source Code": "https://github.com/nad2000/W3C-Validator"
    },
    "split_keywords": [
        "html validator",
        "html",
        "validator",
        "checker",
        "html5",
        "w3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fed3b87cbacf95abdcb4b1912eefad666aade4632620d643c5d15970492ee944",
                "md5": "a0c81ba9285f1b34c0eb90467ef540ca",
                "sha256": "5d7eea3f78bca1ea1d2969d4cdd9ccf8c47de59b0a9548c7e07765852eab62dd"
            },
            "downloads": -1,
            "filename": "Online-W3C-Validator-0.3.21.tar.gz",
            "has_sig": false,
            "md5_digest": "a0c81ba9285f1b34c0eb90467ef540ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 77286,
            "upload_time": "2023-05-19T03:34:02",
            "upload_time_iso_8601": "2023-05-19T03:34:02.037285Z",
            "url": "https://files.pythonhosted.org/packages/fe/d3/b87cbacf95abdcb4b1912eefad666aade4632620d643c5d15970492ee944/Online-W3C-Validator-0.3.21.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-19 03:34:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nad2000",
    "github_project": "W3C-Validator",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "online-w3c-validator"
}
        
Elapsed time: 1.05977s