{"id":14771373,"url":"https://github.com/messense/nh3","last_synced_at":"2025-05-14T13:03:17.693Z","repository":{"id":43086262,"uuid":"392311152","full_name":"messense/nh3","owner":"messense","description":"Python binding to Ammonia HTML sanitizer Rust crate","archived":false,"fork":false,"pushed_at":"2025-04-27T04:40:26.000Z","size":182,"stargazers_count":287,"open_issues_count":12,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-27T05:27:45.613Z","etag":null,"topics":["bleach","sanitize-html"],"latest_commit_sha":null,"homepage":"https://nh3.readthedocs.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/messense.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"messense"}},"created_at":"2021-08-03T12:32:13.000Z","updated_at":"2025-04-27T04:40:29.000Z","dependencies_parsed_at":"2024-12-05T10:02:28.007Z","dependency_job_id":"e045caca-b49a-46c3-8955-01ab69ff9201","html_url":"https://github.com/messense/nh3","commit_stats":{"total_commits":100,"total_committers":9,"mean_commits":11.11111111111111,"dds":0.28,"last_synced_commit":"ed064c80d12636c759327b57e7ceea0ff0733fa5"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Fnh3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Fnh3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Fnh3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messense%2Fnh3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/messense","download_url":"https://codeload.github.com/messense/nh3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149757,"owners_count":22022847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bleach","sanitize-html"],"created_at":"2024-09-16T16:02:16.683Z","updated_at":"2025-05-14T13:03:17.641Z","avatar_url":"https://github.com/messense.png","language":"Rust","readme":"# nh3\n\n![CI](https://github.com/messense/nh3/workflows/CI/badge.svg)\n[![PyPI](https://img.shields.io/pypi/v/nh3.svg)](https://pypi.org/project/nh3)\n[![Documentation Status](https://readthedocs.org/projects/nh3/badge/?version=latest)](https://nh3.readthedocs.io/en/latest/?badge=latest)\n\nPython bindings to the [ammonia](https://github.com/rust-ammonia/ammonia) HTML sanitization library.\n\n## Installation\n\n```bash\npip install nh3\n```\n\n## Usage\n\nSee [the documentation](https://nh3.readthedocs.io/en/latest/).\n\n## Performance\n\nA quick benchmark showing that nh3 is about 20 times faster than the deprecated [bleach](https://pypi.org/project/bleach/) package.\nMeasured on a MacBook Air (M2, 2022).\n\n```ipython\nPython 3.11.0 (main, Oct 25 2022, 16:25:24) [Clang 14.0.0 (clang-1400.0.29.102)]\nType 'copyright', 'credits' or 'license' for more information\nIPython 8.9.0 -- An enhanced Interactive Python. Type '?' for help.\n\nIn [1]: import requests\n\nIn [2]: import bleach\n\nIn [3]: import nh3\n\nIn [4]: html = requests.get(\"https://www.google.com\").text\n\nIn [5]: %timeit bleach.clean(html)\n2.85 ms ± 22.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n\nIn [6]: %timeit nh3.clean(html)\n138 µs ± 860 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)\n```\n\n## License\n\nThis work is released under the MIT license. A copy of the license is provided in the [LICENSE](./LICENSE) file.\n","funding_links":["https://github.com/sponsors/messense"],"categories":["Web \u0026 Networking","Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Fnh3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmessense%2Fnh3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Fnh3/lists"}