CLI tool to validate deployed URLs via the W3C Nu HTML Checker (JSON output).
Project description
w3c-nu-validator
A lightweight Python CLI tool for validating deployed URLs using the W3C Nu HTML Checker HTTP API (JSON output).
This tool is designed to validate the HTML that users and assessors actually see in production, rather than local templates or development builds.
Why this exists
Manual HTML validation via copy-pasting URLs into the W3C validator is:
- slow
- repetitive
- error-prone
- difficult to repeat consistently across many pages
This tool allows you to:
- validate many deployed URLs in one run
- capture a complete, site-wide validation report
- fix issues systematically instead of page-by-page
Features
- Validate one or more deployed URLs
- Read URLs from a file (one per line)
- De-duplicate URLs automatically
- Write a full validation report to disk
- Return a meaningful exit code (useful for scripts / CI)
- Uses the official W3C Nu Validator HTTP interface
Installation
From PyPI
pip install w3c-nu-validator
This installs the w3c-nu-validator command.
Editable Install
Clone the repository and install it into a virtual environment.
pip install -e .
Or install from another project in editable mode:
pip install -e /path/to/w3c-nu-validator
Usage
Validate one or more URLs
w3c-nu-validator https://example.com https://example.com/about/
Read URLs from a file
w3c-nu-validator -r urls.txt
File rules:
- one URL per line
- blank lines are ignored
- lines starting with # are ignored
Example urls.txt:
[!NOTE] Lines beginning with hash
#marks are treated as comments and thus ignored.
# Home page
https://example.com/
# Resource list
https://example.com/resources/
Write a full report to a file
w3c-nu-validator -r urls.txt -o report.txt
The report includes:
- a delimiter per URL
- error / info counts
- full error messages with HTML extracts
Exit codes
| Code | Meaning |
|---|---|
| 0 | No validation errors found |
| 1 | One or more URLs contain validation errors |
| 2 | Invalid input (missing URLs, unreadable file, etc.) |
This allows quick pass/fail checks:
w3c-nu-validator -r urls.txt
echo $?
Requirements
- Python 3.10+
requests
Licence
MIT Licence.
This project is provided as-is, without warranty.
See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file w3c_nu_validator-0.1.1.tar.gz.
File metadata
- Download URL: w3c_nu_validator-0.1.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be467b575f2d9fd5c62a8200bb0cb379e19cad2f30549b20ca3d6ef9536bc6f8
|
|
| MD5 |
a444058ceecf696a4db8190814a06b2a
|
|
| BLAKE2b-256 |
493e2f1dc08a6c9b9210089c45bf0bf6ef1c4275ddefabedad455064f4b64a8c
|
File details
Details for the file w3c_nu_validator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: w3c_nu_validator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3921ad69a4485a3e4d89eb174fa755f9fd33076ce2eba3f3e7faa6e02e71c2d
|
|
| MD5 |
e4d75a8981ae9e28ca1fa7d2823fd590
|
|
| BLAKE2b-256 |
b43415856161e596a7a8e4dabeb8fced2925a22331657a481638b9bfad5219ff
|