courlan — URL Filtering and Normalization for Python

courlan provides an additional “brain” for web crawling, scraping, and document management. It facilitates web navigation through a set of filters to enhance the quality of resulting document collections: save bandwidth by steering clear of low-value pages, identify content by language, and deduplicate URL collections at scale.

Common tasks

Validate & filter URLs

check_url — validate, normalize, and filter in one call.

URL Checking, Cleaning, and Filtering in Python
Clean & normalize

clean_url, normalize_url — fix up messy URLs without full filtering.

URL Checking, Cleaning, and Filtering in Python
Extract links from HTML

extract_links, filter_links — general-purpose and crawl-aware extraction.

URL Checking, Cleaning, and Filtering in Python
Sample by domain

sample_urls — pick N URLs per domain from a larger collection.

URL Checking, Cleaning, and Filtering in Python
URL Store

UrlStore — domain-classified storage with visit tracking and persistence.

URL Store — Domain-Classified URL Storage
Web crawling

Crawl delays, robots.txt, download scheduling, and frontier management.

Web Crawling with Courlan
Command line

courlan CLI — filter and sample URL files from the terminal.

Courlan Command-Line Interface
Settings

Customize blacklists, allowed parameters, and language rules.

courlan.settings

Contents