adblockparser
Parser for Adblock Plus rules
What it is and what it does
adblockparser is a Python library for parsing and applying Adblock Plus filter rules. It reads filter rules (either manually written or from sources like EasyList) and provides a method to check whether a given URL should be blocked according to those rules. The library handles both simple wildcard-style filters and more complex rules with options like domain-specific matching and script-type filtering.
The package creates large regex patterns internally to match filters efficiently. It optionally integrates with pyre2 for dramatic performance improvements—potentially over 1000x faster for large filter lists. Without pyre2, it falls back to Python's standard re module. Rules with options are evaluated individually, which can be slower with thousands of such rules, but the library provides configuration options to optimize this scenario.
Use it for:
- Build a web scraper or crawler that respects Adblock Plus rules to avoid fetching blocked resources
- Implement ad filtering in a browser extension or application using standard filter lists
- Filter URLs in a content management system or proxy to block ads and trackers based on EasyList rules
- Test URL filtering logic by programmatically checking whether specific URLs match filter rules
- Load and apply custom Adblock Plus filters to control which domains or resources are accessible
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses Adblock Plus filter rules and matches URLs against them to determine whether they should be blocked.
No. The package is abandoned (last commit 2019, last release 2016) with no active maintenance. While it has low install friction and no security vulnerabilities, the lack of updates means it may not handle modern Adblock Plus syntax changes or work reliably on current Python versions. Use only if you have a legacy codebase already depending on it.
Install
adblockparser on PyPI
pip
pip install adblockparseruv
uv add adblockparserpoetry
poetry add adblockparserInstalling adblockparser
Before you install
Low install friction with no runtime dependencies. However, the package is abandoned as of 2019 with no active maintenance, and the last release was in 2016.
License in practice
MIT license permits commercial and private use with minimal restrictions, requiring only license and copyright notice inclusion.
Quickstart
pip install adblockparser
from adblockparser import AdblockRules
raw_rules = ["||ads.example.com^", "@@||ads.example.com/notbanner^$~script"]
rules = AdblockRules(raw_rules)
rules.should_block("http://ads.example.com")
pyre2 library is optional but highly recommended for performance; it requires C++ re2 library installed on the system.
Verify before relying
- Whether the package works reliably with Python versions beyond 3.5, given its abandoned status
- Current compatibility with recent Adblock Plus filter syntax changes since 2016
- Whether pyre2 optional dependency remains available and functional on current systems
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,588 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 140,832/month — #11,263 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: adblockparser-0.7-py2.py3-none-any.whl
Keywords: adblock, easylist
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
django-filterDjango-filter adds dynamic QuerySet filtering…
permissive · top 5,000 on PyPI
pybgpkit-parserParses BGP (Border Gateway Protocol) update and…
permissive · top 15,000 on PyPI
django-more-admin-filtersProvides a collection of Django admin filter…
permissive · top 15,000 on PyPI
rfc3986-validatorValidates URLs and URI references against the…
permissive · top 1,000 on PyPI
django-admin-autocomplete-filterAdds autocomplete-based filtering to Django…
copyleft · top 15,000 on PyPI
djangorestframework-filtersExtends Django REST Framework with advanced…
permissive · top 15,000 on PyPI
gitignorantParses .gitignore files and matches file paths…
permissive · top 15,000 on PyPI
igittigittA spec-compliant .gitignore parser that matches…
permissive · top 15,000 on PyPI
courlanValidates, normalizes, filters, and samples…
permissive · top 5,000 on PyPI