Comparison
clear-html vs html-sanitizer vs lxml-html-clean vs nh3
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Clean and normalize HTML.
Maintained. Last release 13 months ago, commits in 4 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install clear-htmlHTML sanitizer
Maintained. Last release 6 days ago, commits in 4 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install html-sanitizerHTML cleaner from lxml project
Maintained. Last release 6 days ago, commits in 2 of the last 26 weeks. Weaker on commit activity.
pip install lxml-html-cleanPython binding to Ammonia HTML sanitizer Rust crate
Actively maintained. Last release 2 weeks ago, commits in 12 of the last 26 weeks. A safe choice.
pip install nh3In short
- nh3 is the most used: 45.8M downloads a month, 2.0× more than lxml-html-clean.
- nh3 also has the best Pythie’s Index (87).
- clear-html is growing fastest: downloads +792% over the last month.
- Safe default for a new project: nh3.
Side by side
| Metric | clear-html | html-sanitizer | lxml-html-clean | nh3 |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 41 | Pythie’s Index: 54 | Pythie’s Index: 62 | Pythie’s Index: 87 |
| Verdict | Maintained | Maintained | Maintained | Actively maintained |
| Downloads / month | 179.3K | 607K | 22.9M | 45.8M |
| Downloads, month over month | +792% | +18% | +14% | +16% |
| GitHub stars | 17 | 157 | 14 | 411 |
| Stars, last 7 days | – | – | – | – |
| Direct dependents | 2 | 21 | 220 | 262 |
| Last release | Oct 24, 2025 | Nov 26, 2026 | Nov 26, 2026 | Nov 17, 2026 |
| Releases, 12 months | 0 | 2 | 4 | 6 |
| Weeks with commits | 4 / 26 | 4 / 26 | 2 / 26 | 12 / 26 |
| Recent contributors | 5 | 7 | 13 | 10 |
| First release | Aug 2023 | May 2017 | Feb 2024 | Aug 2021 |
| Python versions | 3.9 – 3.14 | 3.10 – 3.15 | 3.8 – 3.15 | – |
| License | MIT | BSD-3-Clause | BSD-3-Clause | MIT |
| Known vulnerabilities | None | None | None | None |
Bold marks the best value in each row. Pythie’s Index rates maintenance out of 100: how it works.