This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<pid="module-searx.enginelib">Implementations of the framework for the SearXNG engines.</p>
<divclass="admonition hint">
<pclass="admonition-title">Hint</p>
<p>The long term goal is to modularize all implementations of the engine
framework here in this Python package. ToDo:</p>
<ulclass="simple">
<li><p>move implementations of the <aclass="reference internal"href="engines.html#searx-engines-loader"><spanclass="std std-ref">SearXNG’s engines loader</span></a> to a new module in
the <aclass="reference internal"href="#module-searx.enginelib"title="searx.enginelib"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">searx.enginelib</span></code></a> namespace.</p></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">searx.enginelib.</span></span><spanclass="sig-name descname"><spanclass="pre">Engine</span></span><aclass="reference internal"href="../../_modules/searx/enginelib.html#Engine"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.Engine"title="Link to this definition">¶</a></dt>
<dd><p>Class of engine instances build from YAML settings.</p>
<p>Further documentation see <aclass="reference internal"href="engine_overview.html#general-engine-configuration"><spanclass="std std-ref">General Engine Configuration</span></a>.</p>
<divclass="admonition hint">
<pclass="admonition-title">Hint</p>
<p>This class is currently never initialized and only used for type hinting.</p>
<spanclass="sig-name descname"><spanclass="pre">engine_type</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.engine_type"title="Link to this definition">¶</a></dt>
<dd><p>Type of the engine (<aclass="reference internal"href="../../src/searx.search.processors.html#searx-search-processors"><spanclass="std std-ref">Search processors</span></a>)</p>
<spanclass="sig-name descname"><spanclass="pre">paging</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.paging"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">time_range_support</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.time_range_support"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">safesearch</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.safesearch"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">language_support</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.language_support"title="Link to this definition">¶</a></dt>
<dd><p>Engine supports languages (locales) search.</p>
<spanclass="sig-name descname"><spanclass="pre">language</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.language"title="Link to this definition">¶</a></dt>
<dd><p>For an engine, when there is <codeclass="docutils literal notranslate"><spanclass="pre">language:</span><spanclass="pre">...</span></code> in the YAML settings the engine
<spanclass="sig-name descname"><spanclass="pre">region</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.region"title="Link to this definition">¶</a></dt>
<dd><p>For an engine, when there is <codeclass="docutils literal notranslate"><spanclass="pre">region:</span><spanclass="pre">...</span></code> in the YAML settings the engine
<spanclass="sig-name descname"><spanclass="pre">fetch_traits</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/typing.html#typing.Callable"title="(in Python v3.13)"><spanclass="pre">Callable</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.fetch_traits"title="Link to this definition">¶</a></dt>
<dd><p>Function to to fetch engine’s traits from origin.</p>
<spanclass="sig-name descname"><spanclass="pre">traits</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference internal"href="#searx.enginelib.traits.EngineTraits"title="searx.enginelib.traits.EngineTraits"><spanclass="pre">EngineTraits</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.traits"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">categories</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/typing.html#typing.List"title="(in Python v3.13)"><spanclass="pre">List</span></a><spanclass="p"><spanclass="pre">[</span></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a><spanclass="p"><spanclass="pre">]</span></span></em><aclass="headerlink"href="#searx.enginelib.Engine.categories"title="Link to this definition">¶</a></dt>
<dd><p>Specifies to which <aclass="reference internal"href="../../admin/settings/settings_engine.html#engine-categories"><spanclass="std std-ref">categories</span></a> the engine should be added.</p>
<spanclass="sig-name descname"><spanclass="pre">name</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.name"title="Link to this definition">¶</a></dt>
<dd><p>Name that will be used across SearXNG to define this engine. In settings, on
<spanclass="sig-name descname"><spanclass="pre">engine</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.engine"title="Link to this definition">¶</a></dt>
<dd><p>Name of the python file used to handle requests and responses to and from
this search engine (file name from <aclass="extlink-origin reference external"href="https://github.com/searxng/searxng/blob/master/searx/engines">git://searx/engines</a> without
<spanclass="sig-name descname"><spanclass="pre">enable_http</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.enable_http"title="Link to this definition">¶</a></dt>
<dd><p>Enable HTTP (by default only HTTPS is enabled).</p>
<spanclass="sig-name descname"><spanclass="pre">shortcut</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.shortcut"title="Link to this definition">¶</a></dt>
<dd><p>Code used to execute bang requests (<codeclass="docutils literal notranslate"><spanclass="pre">!foo</span></code>)</p>
<spanclass="sig-name descname"><spanclass="pre">timeout</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#float"title="(in Python v3.13)"><spanclass="pre">float</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.timeout"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">display_error_messages</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.display_error_messages"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">proxies</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#dict"title="(in Python v3.13)"><spanclass="pre">dict</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.proxies"title="Link to this definition">¶</a></dt>
<dd><p>Set proxies for a specific engine (YAML):</p>
<spanclass="sig-name descname"><spanclass="pre">disabled</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.disabled"title="Link to this definition">¶</a></dt>
<dd><p>To disable by default the engine, but not deleting it. It will allow the
<spanclass="sig-name descname"><spanclass="pre">inactive</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.inactive"title="Link to this definition">¶</a></dt>
<dd><p>Remove the engine from the settings (<em>disabled & removed</em>).</p>
<spanclass="sig-name descname"><spanclass="pre">about</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#dict"title="(in Python v3.13)"><spanclass="pre">dict</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.about"title="Link to this definition">¶</a></dt>
<dd><p>Additional fields describing the engine.</p>
<spanclass="sig-name descname"><spanclass="pre">using_tor_proxy</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.using_tor_proxy"title="Link to this definition">¶</a></dt>
<dd><p>Using tor proxy (<codeclass="docutils literal notranslate"><spanclass="pre">true</span></code>) or not (<codeclass="docutils literal notranslate"><spanclass="pre">false</span></code>) for this engine.</p>
<spanclass="sig-name descname"><spanclass="pre">send_accept_language_header</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/functions.html#bool"title="(in Python v3.13)"><spanclass="pre">bool</span></a></em><aclass="headerlink"href="#searx.enginelib.Engine.send_accept_language_header"title="Link to this definition">¶</a></dt>
<dd><p>When this option is activated, the language (locale) that is selected by
the user is used to build and send a <codeclass="docutils literal notranslate"><spanclass="pre">Accept-Language</span></code> header in the
<spanid="engine-traits"></span><spanid="searx-enginelib-traits"></span><h2><aclass="toc-backref"href="#id1"role="doc-backlink">Engine traits</a><aclass="headerlink"href="#module-searx.enginelib.traits"title="Link to this heading">¶</a></h2>
<p>Engine’s traits are fetched from the origin engines and stored in a JSON file
in the <em>data folder</em>. Most often traits are languages and region codes and
their mapping from SearXNG’s representation to the representation in the origin
search engine. For new traits new properties can be added to the class
<p>To load traits from the persistence <aclass="reference internal"href="#searx.enginelib.traits.EngineTraitsMap.from_data"title="searx.enginelib.traits.EngineTraitsMap.from_data"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">EngineTraitsMap.from_data</span></code></a> can be
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">searx.enginelib.traits.</span></span><spanclass="sig-name descname"><spanclass="pre">EngineTraitsEncoder</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">skipkeys</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ensure_ascii</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">check_circular</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">allow_nan</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">sort_keys</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">indent</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">separators</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">default</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraitsEncoder"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraitsEncoder"title="Link to this definition">¶</a></dt>
<dd><p>Encodes <aclass="reference internal"href="#searx.enginelib.traits.EngineTraits"title="searx.enginelib.traits.EngineTraits"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">EngineTraits</span></code></a> to a serializable object, see
<spanclass="sig-name descname"><spanclass="pre">default</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">o</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraitsEncoder.default"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraitsEncoder.default"title="Link to this definition">¶</a></dt>
<dd><p>Return dictionary of a <aclass="reference internal"href="#searx.enginelib.traits.EngineTraits"title="searx.enginelib.traits.EngineTraits"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">EngineTraits</span></code></a> object.</p>
<spanclass="s1">'fr-BE'</span><spanclass="p">:</span><spanclass="o"><</span><spanclass="n">engine</span><spanclass="s1">'s region name>,</span>
<spanclass="s1">'ca'</span><spanclass="p">:</span><spanclass="o"><</span><spanclass="n">engine</span><spanclass="s1">'s language name>,</span>
<spanclass="sig-name descname"><spanclass="pre">all_locale</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/constants.html#None"title="(in Python v3.13)"><spanclass="pre">None</span></a></em><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">None</span></em><aclass="headerlink"href="#searx.enginelib.traits.EngineTraits.all_locale"title="Link to this definition">¶</a></dt>
<dd><p>To which locale value SearXNG’s <codeclass="docutils literal notranslate"><spanclass="pre">all</span></code> language is mapped (shown a “Default
<spanclass="sig-name descname"><spanclass="pre">data_type</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/typing.html#typing.Literal"title="(in Python v3.13)"><spanclass="pre">Literal</span></a><spanclass="p"><spanclass="pre">[</span></span><spanclass="s"><spanclass="pre">'traits_v1'</span></span><spanclass="p"><spanclass="pre">]</span></span></em><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'traits_v1'</span></em><aclass="headerlink"href="#searx.enginelib.traits.EngineTraits.data_type"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_language</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">searxng_locale</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">default</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraits.get_language"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraits.get_language"title="Link to this definition">¶</a></dt>
<dd><p>Return engine’s language string that <em>best fits</em> to SearXNG’s locale.</p>
<p>The <em>best fits</em> rules are implemented in
<aclass="reference internal"href="../../src/searx.locales.html#searx.locales.get_engine_locale"title="searx.locales.get_engine_locale"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">searx.locales.get_engine_locale</span></code></a>. Except for the special value <codeclass="docutils literal notranslate"><spanclass="pre">all</span></code>
which is determined from <aclass="reference internal"href="#searx.enginelib.traits.EngineTraits.all_locale"title="searx.enginelib.traits.EngineTraits.all_locale"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">EngineTraits.all_locale</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">get_region</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">searxng_locale</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.13)"><spanclass="pre">str</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">default</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraits.get_region"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraits.get_region"title="Link to this definition">¶</a></dt>
<dd><p>Return engine’s region string that best fits to SearXNG’s locale.</p>
<p>The <em>best fits</em> rules are implemented in
<aclass="reference internal"href="../../src/searx.locales.html#searx.locales.get_engine_locale"title="searx.locales.get_engine_locale"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">searx.locales.get_engine_locale</span></code></a>. Except for the special value <codeclass="docutils literal notranslate"><spanclass="pre">all</span></code>
which is determined from <aclass="reference internal"href="#searx.enginelib.traits.EngineTraits.all_locale"title="searx.enginelib.traits.EngineTraits.all_locale"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">EngineTraits.all_locale</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">copy</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraits.copy"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraits.copy"title="Link to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">classmethod</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">fetch_traits</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">engine</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#searx.enginelib.Engine"title="searx.enginelib.Engine"><spanclass="pre">Engine</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="s"><spanclass="pre">'EngineTraits'</span></span><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/constants.html#None"title="(in Python v3.13)"><spanclass="pre">None</span></a></span></span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraits.fetch_traits"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraits.fetch_traits"title="Link to this definition">¶</a></dt>
<dd><p>Call a function <codeclass="docutils literal notranslate"><spanclass="pre">fetch_traits(engine_traits)</span></code> from engines namespace to fetch
and set properties from the origin engine in the object <codeclass="docutils literal notranslate"><spanclass="pre">engine_traits</span></code>. If
function does not exists, <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> is returned.</p>
<spanclass="sig-name descname"><spanclass="pre">set_traits</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">engine</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#searx.enginelib.Engine"title="searx.enginelib.Engine"><spanclass="pre">Engine</span></a></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraits.set_traits"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraits.set_traits"title="Link to this definition">¶</a></dt>
<dd><p>Set traits from self object in a <aclass="reference internal"href="#searx.enginelib.Engine"title="searx.enginelib.Engine"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Engine</span></code></a> namespace.</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">searx.enginelib.traits.</span></span><spanclass="sig-name descname"><spanclass="pre">EngineTraitsMap</span></span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraitsMap"title="Link to this definition">¶</a></dt>
<dd><p>A python dictionary to map <aclass="reference internal"href="#searx.enginelib.traits.EngineTraits"title="searx.enginelib.traits.EngineTraits"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">EngineTraits</span></code></a> by engine name.</p>
<spanclass="sig-name descname"><spanclass="pre">ENGINE_TRAITS_FILE</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">PosixPath('/home/runner/work/searxng/searxng/searx/data/engine_traits.json')</span></em><aclass="headerlink"href="#searx.enginelib.traits.EngineTraitsMap.ENGINE_TRAITS_FILE"title="Link to this definition">¶</a></dt>
<dd><p>File with persistence of the <aclass="reference internal"href="#searx.enginelib.traits.EngineTraitsMap"title="searx.enginelib.traits.EngineTraitsMap"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">EngineTraitsMap</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">save_data</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.save_data"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraitsMap.save_data"title="Link to this definition">¶</a></dt>
<dd><p>Store EngineTraitsMap in in file <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">self.ENGINE_TRAITS_FILE</span></code></p>
<emclass="property"><spanclass="pre">classmethod</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">from_data</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><aclass="reference internal"href="#searx.enginelib.traits.EngineTraitsMap"title="searx.enginelib.traits.EngineTraitsMap"><spanclass="pre">EngineTraitsMap</span></a></span></span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.from_data"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraitsMap.from_data"title="Link to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">set_traits</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">engine</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#searx.enginelib.Engine"title="searx.enginelib.Engine"><spanclass="pre">Engine</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference external"href="https://docs.python.org/3/library/types.html#types.ModuleType"title="(in Python v3.13)"><spanclass="pre">types.ModuleType</span></a></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.set_traits"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.enginelib.traits.EngineTraitsMap.set_traits"title="Link to this definition">¶</a></dt>
<dd><p>Set traits in a <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Engine</span></code> namespace.</p>