skillfed

adblockparser

Parser for Adblock Plus rules

adblockparser v0.7 140.8K downloads/30d#11,263 on PyPI202
Permissive license MIT Abandoned released

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 adblockparser

uv

uv add adblockparser

poetry

poetry add adblockparser

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5

Tags

adblock plus filter parsingurl blocking rulesadblock filter matchingeasylist parsercontent filteringad blocking enginefilter rule evaluation
adblock-filteringurl-matchingabandoned

More Internet packages