betty.fetch.static module - Betty 0.4.0a4 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.fetch.static module

Fetch content from the internet.

class betty.fetch.static.StaticFetcher

  Bases: `Fetcher`

  Return predefined (static) fetch responses.

  __init__(*, fetch_map: Mapping[str, FetchResponse] | None = None, fetch_file_map: Mapping[str, Path] | None = None)
  async fetch(url: str) → FetchResponse

    Fetch an HTTP resource.

  async fetch_file(url: str) → Path

    Fetch a file.

    Returns:

      The path to the file on disk.