nh3
Python bindings to the ammonia HTML sanitization library.
Installation
pip install nh3
Usage
See the documentation.
Performance
A quick benchmark showing that nh3 is about 20 times faster than the deprecated bleach package. Measured on a MacBook Air (M2, 2022).
Python 3.11.0 (main, Oct 25 2022, 16:25:24) [Clang 14.0.0 (clang-1400.0.29.102)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.9.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import requests
In [2]: import bleach
In [3]: import nh3
In [4]: html = requests.get("https://www.google.com").text
In [5]: %timeit bleach.clean(html)
2.85 ms ± 22.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
In [6]: %timeit nh3.clean(html)
138 µs ± 860 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
License
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.
Metadata
Release files for nh3 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nh3-0.3.7.tar.gz | 25.7 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 24.3 MB
Release files / nh3-0.3.7.tar.gz
| Download URL | nh3-0.3.7.tar.gz |
|---|---|
| Size | 25.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71860d01c16f4d8c72e334e0674beb2b0899dbd0bf760de18932ef4390303848
|
|
BLAKE2b-256 checksum How to use checksums |
182f022b27146d52d24b1b353b003359134788ecbcd6fcdf6283adbd57c0fbc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-win_arm64.whl
| Download URL | nh3-0.3.7-cp314-cp314t-win_arm64.whl |
|---|---|
| Size | 611.0 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows ARM64 |
|
SHA-256 checksum How to use checksums |
157ec1eb7a62f3d9a7badb8d82d89aa810e3e24e097eedfa481a25d0c8a99877
|
|
BLAKE2b-256 checksum How to use checksums |
1d183ab564595cb88196f50d26e163ed0fd2acc731ab26ac615df91981885887
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-win_amd64.whl
| Download URL | nh3-0.3.7-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 633.5 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
614dac4a4c36ad084e78447d16fe898dedd762e354a7ab9cda2984e82f67883d
|
|
BLAKE2b-256 checksum How to use checksums |
e6b7efda1d0a611d940bdfde6893bde1ea6b7b7d48c31273aea48e35b822fd58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-win32.whl
| Download URL | nh3-0.3.7-cp314-cp314t-win32.whl |
|---|---|
| Size | 619.9 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-32 |
|
SHA-256 checksum How to use checksums |
874b7d67a067bd29a59223f6270fc30da4edd8e6d87fd219fc93bcbaa662c946
|
|
BLAKE2b-256 checksum How to use checksums |
9aa7c57a2c70534418310889a65ccfac3525e62f0bc0a8613225903403755ce7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-musllinux_1_2_x86_64.whl
| Download URL | nh3-0.3.7-cp314-cp314t-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
808def0c8c07843e6e50dc84f532457bfa2cfd17417b219a5d9e7c773709331a
|
|
BLAKE2b-256 checksum How to use checksums |
6b53097a5ad0b34b15d67a472ef849165a54209fa5fbd3e639801c6fe439ba28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-musllinux_1_2_i686.whl
| Download URL | nh3-0.3.7-cp314-cp314t-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-32 |
|
SHA-256 checksum How to use checksums |
18f4278ecd157d43cb35acd5aae9f35cfa79f546b4922bd86536adc0f6312102
|
|
BLAKE2b-256 checksum How to use checksums |
6a9f57d186d9d3dd38905dc12dddb3484406cdf6aa0b1ce33639a2d277d4ee1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-musllinux_1_2_armv7l.whl
| Download URL | nh3-0.3.7-cp314-cp314t-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ ARMv7l |
|
SHA-256 checksum How to use checksums |
94fd6e59553fbb9ffd8ba71bbd5a54e3126ba01799a097ae30d5341d750bc6ac
|
|
BLAKE2b-256 checksum How to use checksums |
045caa1468e3e281e78d2b3b7d762ccba59f681af355e971dbd255d5903f7b86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-musllinux_1_2_aarch64.whl
| Download URL | nh3-0.3.7-cp314-cp314t-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
be53a4825585f701955cb9baf49f478f56eb81e20294329fe4bc689dd5dd81fa
|
|
BLAKE2b-256 checksum How to use checksums |
d84ae9c436089a0c80b928011ead0efd156aa7639a19b6064ef58dcedcab8369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nh3-0.3.7-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 820.5 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
eae64328e46a25785535afcb6885b6f182ecaf5ee8c88f8c075422db8aacc65b
|
|
BLAKE2b-256 checksum How to use checksums |
1e60847a21339f095c4d4c655af31fa2d18b174585bcc210709facacc7ce205c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | nh3-0.3.7-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 861.5 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
4968fe8d2db97c6f047659bf46a449fd8ec377f44ebf3e0a1b96c0d3a333ae32
|
|
BLAKE2b-256 checksum How to use checksums |
7b7f1a103e00aaf5e59f2dee4c2709aac609bb2d4bb74fddaf0dcfade11ed87b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | nh3-0.3.7-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
91a4dab4e94d9fc54b9f67b1adfb23e81fab7ab43f33c3b8c97be9aa38f789ba
|
|
BLAKE2b-256 checksum How to use checksums |
ce88b594f0e86856b37e182fb663283da419eea6424972506e640e890885467f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-win_arm64.whl
| Download URL | nh3-0.3.7-cp38-abi3-win_arm64.whl |
|---|---|
| Size | 621.9 kB |
| Tags | CPython 3.8 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f04b7d333b27f13ca439da3cf1c75c2fba34f104969f6ce4ac8e7079699c2f4a
|
|
BLAKE2b-256 checksum How to use checksums |
f970e140dffff6e808dc6343598df76e7e2407fd0f581de3524c75fba2e0cf24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-win_amd64.whl
| Download URL | nh3-0.3.7-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 644.5 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
618e3059caf41ccdf5dcccb3fa9df4cf6e4efe23d1382a8bbfca272a8a4f8bfc
|
|
BLAKE2b-256 checksum How to use checksums |
b4b934433ccb1f0fe6968dabbb7d4bf5721c6221878ef07832748c06655a6a80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-win32.whl
| Download URL | nh3-0.3.7-cp38-abi3-win32.whl |
|---|---|
| Size | 630.7 kB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
6e4280115d44c3b278eef712a86748c1a723105cd79feec46952383117ab4e59
|
|
BLAKE2b-256 checksum How to use checksums |
4b6a478f153f1d7c0baaa3d1e8bb5fdcee3a6235f90fe44ea969a9d4e2b8c47a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | nh3-0.3.7-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6698a822132beedab80f131c08d8d0ac5a178ddeb488d02ca4b67716ecfac7af
|
|
BLAKE2b-256 checksum How to use checksums |
26a4c3423351e8d864ad756e85e15f0c01433361f14d34e4ed156482c0518f2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-musllinux_1_2_i686.whl
| Download URL | nh3-0.3.7-cp38-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
15f5fbf090f5c88d61c820e1fc1fceecb6520cca9fe85649c06b57ef9dc9ff62
|
|
BLAKE2b-256 checksum How to use checksums |
42e5ae8c0782fce74fb6fcf7234bb3d4017f37ce181b4f9d29369eab21c50a04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-musllinux_1_2_armv7l.whl
| Download URL | nh3-0.3.7-cp38-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
fd4a70efb45d5372174f718878eb7a35c12677626a63b2f103b23b833457dcac
|
|
BLAKE2b-256 checksum How to use checksums |
b25d891e533b716cf00df76ad0ba6485dcfd14d59a6430a3cc99057c4c04004e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-musllinux_1_2_aarch64.whl
| Download URL | nh3-0.3.7-cp38-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.8 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d56e76bd3cadb09b6b0cef364850811663734b348a25f5f587a2819c495367bd
|
|
BLAKE2b-256 checksum How to use checksums |
000c1a8985fd43fea5530c0ac890b6f0b423770ee72f111b70b7a77f2dec243a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-manylinux_2_31_riscv64.whl
| Download URL | nh3-0.3.7-cp38-abi3-manylinux_2_31_riscv64.whl |
|---|---|
| Size | 849.8 kB |
| Tags | CPython 3.8 Linux glibc 2.31+ RISC-V 64 abi3 |
|
SHA-256 checksum How to use checksums |
5ffdfcb9a686ffb12765376bcfb6b5b55728516d3c0ee317d29982381ded3df8
|
|
BLAKE2b-256 checksum How to use checksums |
7be33212c1a5b5745245d7f18885207bbddb34c56075f34dd682bd539aad55cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nh3-0.3.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 832.2 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
70f5ac8626e899a4bab0ef74ca2f5bd602f49c7b739e6e5026b4afc6d63dac42
|
|
BLAKE2b-256 checksum How to use checksums |
a6edc5510c615dce55b6fcc364aa1838142f938beed64f5e4927490dfcaf4405
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
| Download URL | nh3-0.3.7-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl |
|---|---|
| Size | 946.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ IBM System/390x abi3 |
|
SHA-256 checksum How to use checksums |
9b7279d43323a25225df23576af6594a16693f61431170848b8b2ac21ad4f174
|
|
BLAKE2b-256 checksum How to use checksums |
93a702dd159d4e71f98607d8d4249cddb7561e77be1a8e4dec77d76e1b68fc99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
| Download URL | nh3-0.3.7-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ PowerPC 64-le abi3 |
|
SHA-256 checksum How to use checksums |
de2b2aab32ea303405debefdcfc58043d3e635fa3f67b9eb140d2b0e0c0d2563
|
|
BLAKE2b-256 checksum How to use checksums |
e4d19d70e0e418a48280ec0ddc6c1b08b4b1136ebcc31a1625e57ff5c665fa51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
| Download URL | nh3-0.3.7-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ PowerPC 64-be abi3 |
|
SHA-256 checksum How to use checksums |
19f288c938ec6eef1f5d2c6cab47838e71fef8097e1c1233802be5a6230ba086
|
|
BLAKE2b-256 checksum How to use checksums |
17402a0921d45b20828708bcb56887e47dcf8cae13818de5bf9a01308d348712
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | nh3-0.3.7-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 839.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
e8fd1ab205258b29254f72db377d99e2c96aa7653ef3b015ccab0420b094b506
|
|
BLAKE2b-256 checksum How to use checksums |
8505b0e6bef633549a23347d5462aa288fcc42381e7918482062ca3cb456242a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nh3-0.3.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 859.6 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f266d3f1b3647449923a8e406524632220dd5d8b647078dfe45b885d33d10479
|
|
BLAKE2b-256 checksum How to use checksums |
0742a687e7091928806e514f89fa2666f25ec9bfe0a902fc4402b25e51ce408b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | nh3-0.3.7-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 875.5 kB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
bc42bb1193c1e28a1e74c2cabaca178e118a7103e8832699fef8a2b3e2496493
|
|
BLAKE2b-256 checksum How to use checksums |
20649e36594efad6c290de4240d02cb2bd80c339a4ab1c4de66e599ffa6d9d81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / nh3-0.3.7-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | nh3-0.3.7-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6c3aa50eb26e9228238271db9f983cbc3b006dfbfeca2d4dc34c33ddc6ac5ea5
|
|
BLAKE2b-256 checksum How to use checksums |
940dc257754bf57f829f307aa226bbe136d3a1356b5a0d08324c7b6bd2a8aacd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Security for nh3 0.3.7
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.