API Reference¶
This section is generated from the courlan package. Click a module to jump to its reference.
Modules
Cache management¶
courlan.meta¶
clear_caches() resets the LRU caches behind langcodes_score and
get_registrable_domain, as well as urllib.parse’s own cache. Call it in
long-running processes to release memory.
Meta-functions to be applied module-wide.
Internal modules¶
courlan.langcodes¶
CLDR-derived language and territory code sets plus the langcodes_score
helper, which drives path- and subdomain-based language detection.
Language detection for URL segments: the scoring helper plus the CLDR-derived language/territory code sets it checks (from babel 2.18, no longer a dependency).
courlan.hosts¶
Host utilities shared by urlutils and filters: IP-literal
canonicalization, IDNA/punycode encoding, and public-suffix (eTLD+1)
extraction via get_registrable_domain.
Host utilities shared by urlutils and filters: IP-literal canonicalization, IDNA/punycode encoding, public-suffix data and eTLD+1 extraction.
courlan.network¶
HTTP redirect resolution used by check_url(with_redirects=True).
Functions devoted to requests over the WWW.
- courlan.network.redirection_test(url)[source]¶
Test final URL to handle redirects :param url: url to check
- Returns:
The final URL seen.
- Raises:
ValueError – if the URL cannot be reached or returns an unacceptable status.
- Parameters:
url (str)
- Return type:
courlan.cli¶
Entry point for the courlan command. See the CLI reference for usage.
Implements a basic command-line interface.