SearXNG’s engines loader¶
Load and initialize the engines, see load_engines() and register
engine_shortcuts.
usage:
load_engines( settings['engines'] )
- searx.engines.engine_shortcuts¶
Simple map of registered shortcuts to name of the engine (or
None).engine_shortcuts[engine.shortcut] = engine.name
- searx.engines.load_engine(engine_data: dict) Engine | types.ModuleType | None[source]¶
Load engine from
engine_data.- Parameters:
engine_data (dict) – Attributes from YAML
settings:engines/<engine>- Returns:
initialized namespace of the
<engine>.
create a namespace and load module of the
<engine>update namespace with the defaults from
ENGINE_DEFAULT_ARGSupdate namespace with values from
engine_data
If engine is active, return namespace of the engine, otherwise return
None.This function also returns
Noneif initialization of the namespace fails for one of the following reasons:engine name contains underscore
engine name is not lowercase
required attribute is not set
is_missing_required_attributes()
- searx.engines.is_missing_required_attributes(engine)[source]¶
An attribute is required when its name doesn’t start with
_(underline). Required attributes must not beNone.
- searx.engines.using_tor_proxy(engine: Engine | types.ModuleType)[source]¶
Return True if the engine configuration declares to use Tor.