Skip to main content

sprezzature-ux-laws

License Python

🇫🇷 LISEZMOI.md · 🇬🇧 README.md

logo

A static Laws-of-UX auditor for HTML.

The "Laws of UX" are named heuristics from psychology and human-computer-interaction research: for instance, Hick's Law says that the more choices a screen offers at once, the longer a person takes to pick one, so a navigation menu with forty links is measurably harder to use than one with seven. This tool cannot see a rendered page or watch a real person use it; instead it reads the raw HTML text and flags the mistakes that are decidable from that text alone, such as counting the links in a <nav>. That trade keeps it fast and deterministic enough to run in a pre-commit hook or a CI step, at the cost of catching only the fraction of each law's violations that a text scan can see (the full, sourced definition of each law lives in references/laws-of-ux.md).

Laws covered

Law What it catches
Hick's Law Too many choices presented at once (over-long menus / nav).
Choice overload Long option lists with no grouping or default.
Miller's Law Unchunked digit runs (phone numbers, codes) beyond ~7 items.
Jakob's Law Non-conventional patterns where a familiar one is expected.
Fitts's Law Interactive controls with no 44 px (min-h-11) hit area.
Aesthetic-Usability Interactive elements missing a visible focus ring.
Selective attention Elements styled like ads that carry real content.
Tesler's Law Irreducible complexity pushed onto the user.

Use

# Audit a file or a whole directory tree
sprezzature-ux-laws-audit public/index.html
sprezzature-ux-laws-audit site/ --json

# Restrict to specific laws, or auto-fix the mechanical ones
sprezzature-ux-laws-audit page.html --only fitts,jakob
sprezzature-ux-laws-audit page.html --fix

From a clone, without installing, the same thing reads python scripts/audit_laws_of_ux.py page.html.

Findings are error or warning; the process exits non-zero when an error is present, so it drops cleanly into CI.

Honest scope

The auditor catches mechanical, source-decidable violations. It does not judge whether a screen answers the right question or whether a flow makes sense. That stays a human call. It is a fast gate, not a substitute for design review.

License

BSD-3-Clause © Warith HARCHAOUI. Part of the sprezzature toolkit.

Metadata

Release files for sprezzature-ux-laws 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sprezzature-ux-laws 1.1.0
File Size Uploaded Provenance Actions
sprezzature_ux_laws-1.1.0.tar.gz 41.5 kB Without provenance Details for sprezzature_ux_laws-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sprezzature-ux-laws 1.1.0
File Interpreter ABI Platform Actions
sprezzature_ux_laws-1.1.0-py3-none-any.whl Python 3 none any Details for sprezzature_ux_laws-1.1.0-py3-none-any.whl

Total release size: 72.5 kB

Release files / sprezzature_ux_laws-1.1.0.tar.gz

Download URL sprezzature_ux_laws-1.1.0.tar.gz
Size 41.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5bcdbc58e61b41d1dd3824094e5ad4aac1d5fa6b4ba6a1d358435520d08fb157
BLAKE2b-256 checksum
How to use checksums
08ba1949abeecc8b83c58132288fe94b1796207f537994cb03cbb00079ad6a74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / sprezzature_ux_laws-1.1.0-py3-none-any.whl

Download URL sprezzature_ux_laws-1.1.0-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0627a69efdedb0d07c2e8d0bb43c59fcf81e6c969bf4982973544e933a518cd6
BLAKE2b-256 checksum
How to use checksums
153c99c8699c9a5ed71a0ae1fa874506eeffba2b840d38a84651a9b4cebc1dd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for sprezzature-ux-laws 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page