Extended Types¶
This module implements the type extensions applied by SearXNG.
flask.requestis replaced bysxng_requestflask.Requestis replaced bySXNG_Requestcurl_cffi.requests.Responseis replaced bySXNG_Response
- searx.extended_types.sxng_request: SXNG_Request¶
A replacement for
flask.requestwith type castSXNG_Request.
- class searx.extended_types.SXNG_Request(environ: WSGIEnvironment, populate_request: bool = True, shallow: bool = False)[source]¶
SearXNG extends the class
flask.Requestwith properties from this class definition, see type castsxng_request.- preferences: searx.preferences.Preferences¶
The preferences of the request.
- start_time: float¶
Start time of the request,
timeit.default_timeradded bysearx.webappto calculate the total time of the request.
- class searx.extended_types.SXNG_Response(curl: Curl | None = None, request: Request | None = None)[source]¶
SearXNG extends
curl_cffi.requests.Responsewith properties from this class (type cast of the curl_cffi response).response = typing.cast(SXNG_Response, response) if response.ok: ... query_was = search_params["query"]