Models¶
Base¶
Path¶
- class markdown_checker.models.path.MarkdownPath(link, line_number, file_path, issue='', issue_level='error')¶
Bases:
MarkdownLinkBaseDataclass to store info about a path
- Parameters:
- property path_without_fragments: Path¶
Get the path without the fragment
- Returns:
The path without the fragment
- remove_fragments()¶
Remove the fragments from a path
- Returns:
The path without the fragment
- Return type:
- get_full_path()¶
Get the full path of the file by resolving the path without fragments
- Returns:
The full path of the file
- Return type:
- get_full_path_relative()¶
Get the full path of the file by resolving the path without fragments
- Returns:
The full path of the file
- Return type:
URL¶
- class markdown_checker.models.url.URLCheckResult(status, http_status_code=None, retry_after=None)¶
Bases:
objectTyped outcome of checking whether a URL is reachable.
- Parameters:
- class markdown_checker.models.url.MarkdownURL(link, line_number, file_path, issue='', issue_level='error')¶
Bases:
MarkdownLinkBaseDataclass to store info about a url
- Parameters:
- property parsed_url: ParseResult¶
Parse the URL and return the result
- Returns:
ParseResult: The parsed URL
- check(timeout=20, retries=3, client=None, retry_on_429=True, fallback_retry_delay=30)¶
Check whether the URL is reachable and return a typed outcome.
- Args:
timeout (int): Timeout for the request in seconds. retries (int): Number of retries if the request fails. client (httpx2.Client | None): Optional shared client for connection pooling. retry_on_429 (bool): When True, honour Retry-After headers on 429 responses. fallback_retry_delay (int): Seconds to wait when a 429 carries no Retry-After header.
- Returns:
URLCheckResult with status one of:
alive,broken,rate_limited, ortransient_error.
- Parameters:
- Return type: