betty.fetch package¶
Submodules¶
Module contents¶
Fetch content from the internet.
- exception betty.fetch.FetchError[source]¶
Bases:
UserFacingError
,RuntimeError
An error that occurred when fetching a URL.
- final class betty.fetch.FetchResponse[source]¶
Bases:
object
An HTTP response.
- class betty.fetch.Fetcher[source]¶
Bases:
ABC
Fetch content from the internet.
- abstractmethod async fetch(url: str) FetchResponse [source]¶
Fetch an HTTP resource.
- Raises:
FetchError – if an error occurred while fetching the content.
- abstractmethod async fetch_file(url: str) Path [source]¶
Fetch a file.
- Raises:
FetchError – if an error occurred while fetching the content.
- Returns:
The path to the file on disk.