Ponysearch/dev/engines/enginelib.html
2024-04-28 12:38:56 +00:00

571 lines
No EOL
63 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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.

<!DOCTYPE html>
<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Engine Library &#8212; SearXNG Documentation (2024.4.28+fd93d0c60)</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=4f649999" />
<link rel="stylesheet" type="text/css" href="../../_static/searxng.css?v=52e4ff28" />
<link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=a5c4661c" />
<script src="../../_static/documentation_options.js?v=88ac209d"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="SearXNGs engines loader" href="engines.html" />
<link rel="prev" title="Engine Implementations" href="index.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="engines.html" title="SearXNGs engines loader"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Engine Implementations"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SearXNG Documentation (2024.4.28+fd93d0c60)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Developer documentation</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Engine Implementations</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Engine Library</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="engine-library">
<span id="searx-enginelib"></span><h1>Engine Library<a class="headerlink" href="#engine-library" title="Link to this heading"></a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#module-searx.enginelib.traits" id="id1">Engine traits</a></p></li>
</ul>
</nav>
<p id="module-searx.enginelib">Implementations of the framework for the SearXNG engines.</p>
<div class="admonition hint">
<p class="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>
<ul class="simple">
<li><p>move implementations of the <a class="reference internal" href="engines.html#searx-engines-loader"><span class="std std-ref">SearXNGs engines loader</span></a> to a new module in
the <a class="reference internal" href="#module-searx.enginelib" title="searx.enginelib"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.enginelib</span></code></a> namespace.</p></li>
</ul>
</div>
<dl class="py class">
<dt class="sig sig-object py" id="searx.enginelib.Engine">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">searx.enginelib.</span></span><span class="sig-name descname"><span class="pre">Engine</span></span><a class="reference internal" href="../../_modules/searx/enginelib.html#Engine"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="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 <a class="reference internal" href="engine_overview.html#general-engine-configuration"><span class="std std-ref">General Engine Configuration</span></a>.</p>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>This class is currently never initialized and only used for type hinting.</p>
</div>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.about">
<span class="sig-name descname"><span class="pre">about</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.12)"><span class="pre">dict</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.about" title="Link to this definition"></a></dt>
<dd><p>Additional fields describing the engine.</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">about</span><span class="p">:</span>
<span class="w"> </span><span class="nt">website</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://example.com</span>
<span class="w"> </span><span class="nt">wikidata_id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Q306656</span>
<span class="w"> </span><span class="nt">official_api_documentation</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://example.com/api-doc</span>
<span class="w"> </span><span class="nt">use_official_api</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">require_api_key</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">results</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">HTML</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.categories">
<span class="sig-name descname"><span class="pre">categories</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.List" title="(in Python v3.12)"><span class="pre">List</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.Engine.categories" title="Link to this definition"></a></dt>
<dd><p>Specifies to which <a class="reference internal" href="../../admin/settings/settings_engine.html#engine-categories"><span class="std std-ref">categories</span></a> the engine should be added.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.disabled">
<span class="sig-name descname"><span class="pre">disabled</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="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
user to manually activate it in the settings.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.display_error_messages">
<span class="sig-name descname"><span class="pre">display_error_messages</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.display_error_messages" title="Link to this definition"></a></dt>
<dd><p>Display error messages on the web UI.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.enable_http">
<span class="sig-name descname"><span class="pre">enable_http</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="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>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.engine">
<span class="sig-name descname"><span class="pre">engine</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></em><a class="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 <a class="reference external" href="https://github.com/Fauli1221/PonySearch/blob/master/searx/engines">git://searx/engines</a> without
<code class="docutils literal notranslate"><span class="pre">.py</span></code>).</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.engine_type">
<span class="sig-name descname"><span class="pre">engine_type</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.engine_type" title="Link to this definition"></a></dt>
<dd><p>Type of the engine (<a class="reference internal" href="../../src/searx.search.processors.html#searx-search-processors"><span class="std std-ref">Search processors</span></a>)</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.fetch_traits">
<span class="sig-name descname"><span class="pre">fetch_traits</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Callable" title="(in Python v3.12)"><span class="pre">Callable</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.fetch_traits" title="Link to this definition"></a></dt>
<dd><p>Function to to fetch engines traits from origin.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.inactive">
<span class="sig-name descname"><span class="pre">inactive</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.inactive" title="Link to this definition"></a></dt>
<dd><p>Remove the engine from the settings (<em>disabled &amp; removed</em>).</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.language">
<span class="sig-name descname"><span class="pre">language</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.language" title="Link to this definition"></a></dt>
<dd><p>For an engine, when there is <code class="docutils literal notranslate"><span class="pre">language:</span> <span class="pre">...</span></code> in the YAML settings the engine
does support only this one language:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">google french</span>
<span class="w"> </span><span class="nt">engine</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">google</span>
<span class="w"> </span><span class="nt">language</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">fr</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.language_support">
<span class="sig-name descname"><span class="pre">language_support</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.language_support" title="Link to this definition"></a></dt>
<dd><p>Engine supports languages (locales) search.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.name">
<span class="sig-name descname"><span class="pre">name</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></em><a class="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
the result page ..</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.paging">
<span class="sig-name descname"><span class="pre">paging</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.paging" title="Link to this definition"></a></dt>
<dd><p>Engine supports multiple pages.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.proxies">
<span class="sig-name descname"><span class="pre">proxies</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.12)"><span class="pre">dict</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.proxies" title="Link to this definition"></a></dt>
<dd><p>Set proxies for a specific engine (YAML):</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">proxies </span><span class="p">:</span>
<span class="w"> </span><span class="nt">http</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">socks5://proxy:port</span>
<span class="w"> </span><span class="nt">https</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">socks5://proxy:port</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.region">
<span class="sig-name descname"><span class="pre">region</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.region" title="Link to this definition"></a></dt>
<dd><p>For an engine, when there is <code class="docutils literal notranslate"><span class="pre">region:</span> <span class="pre">...</span></code> in the YAML settings the engine
does support only this one region:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">..</span> <span class="n">code</span><span class="p">::</span> <span class="n">yaml</span>
</pre></div>
</div>
<blockquote>
<div><ul class="simple">
<li><p>name: google belgium
engine: google
region: fr-BE</p></li>
</ul>
</div></blockquote>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.safesearch">
<span class="sig-name descname"><span class="pre">safesearch</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.safesearch" title="Link to this definition"></a></dt>
<dd><p>Engine supports SafeSearch</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.send_accept_language_header">
<span class="sig-name descname"><span class="pre">send_accept_language_header</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="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 <code class="docutils literal notranslate"><span class="pre">Accept-Language</span></code> header in the
request to the origin search engine.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.shortcut">
<span class="sig-name descname"><span class="pre">shortcut</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.shortcut" title="Link to this definition"></a></dt>
<dd><p>Code used to execute bang requests (<code class="docutils literal notranslate"><span class="pre">!foo</span></code>)</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.time_range_support">
<span class="sig-name descname"><span class="pre">time_range_support</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.time_range_support" title="Link to this definition"></a></dt>
<dd><p>Engine supports search time range.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.timeout">
<span class="sig-name descname"><span class="pre">timeout</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.12)"><span class="pre">float</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.timeout" title="Link to this definition"></a></dt>
<dd><p>Specific timeout for search-engine.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.tokens">
<span class="sig-name descname"><span class="pre">tokens</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.List" title="(in Python v3.12)"><span class="pre">List</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.Engine.tokens" title="Link to this definition"></a></dt>
<dd><p>A list of secret tokens to make this engine <em>private</em>, more details see
<a class="reference internal" href="../../admin/settings/settings_engine.html#private-engines"><span class="std std-ref">Private Engines (tokens)</span></a>.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.traits">
<span class="sig-name descname"><span class="pre">traits</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><span class="pre">EngineTraits</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.traits" title="Link to this definition"></a></dt>
<dd><p>Traits of the engine.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.Engine.using_tor_proxy">
<span class="sig-name descname"><span class="pre">using_tor_proxy</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></em><a class="headerlink" href="#searx.enginelib.Engine.using_tor_proxy" title="Link to this definition"></a></dt>
<dd><p>Using tor proxy (<code class="docutils literal notranslate"><span class="pre">true</span></code>) or not (<code class="docutils literal notranslate"><span class="pre">false</span></code>) for this engine.</p>
</dd></dl>
</dd></dl>
<section id="module-searx.enginelib.traits">
<span id="engine-traits"></span><span id="searx-enginelib-traits"></span><h2><a class="toc-backref" href="#id1" role="doc-backlink">Engine traits</a><a class="headerlink" href="#module-searx.enginelib.traits" title="Link to this heading"></a></h2>
<p>Engines 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 SearXNGs representation to the representation in the origin
search engine. For new traits new properties can be added to the class
<a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraits</span></code></a>.</p>
<p>To load traits from the persistence <a class="reference internal" href="#searx.enginelib.traits.EngineTraitsMap.from_data" title="searx.enginelib.traits.EngineTraitsMap.from_data"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraitsMap.from_data</span></code></a> can be
used.</p>
<dl class="py class">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">searx.enginelib.traits.</span></span><span class="sig-name descname"><span class="pre">EngineTraits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">regions:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">str]</span> <span class="pre">=</span> <span class="pre">&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">languages:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">str]</span> <span class="pre">=</span> <span class="pre">&lt;factory&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">all_locale:</span> <span class="pre">str</span> <span class="pre">|</span> <span class="pre">None</span> <span class="pre">=</span> <span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data_type:</span> <span class="pre">~typing.Literal['traits_v1']</span> <span class="pre">=</span> <span class="pre">'traits_v1'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom:</span> <span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">~typing.Dict[str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">~typing.Dict]</span> <span class="pre">|</span> <span class="pre">~typing.Iterable[str]]</span> <span class="pre">=</span> <span class="pre">&lt;factory&gt;</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits" title="Link to this definition"></a></dt>
<dd><p>The class is intended to be instantiated for each engine.</p>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.copy">
<span class="sig-name descname"><span class="pre">copy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.copy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.copy" title="Link to this definition"></a></dt>
<dd><p>Create a copy of the dataclass object.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.fetch_traits">
<em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">fetch_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#searx.enginelib.Engine" title="searx.enginelib.Engine"><span class="pre">Engine</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="s"><span class="pre">'EngineTraits'</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span></span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.fetch_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.fetch_traits" title="Link to this definition"></a></dt>
<dd><p>Call a function <code class="docutils literal notranslate"><span class="pre">fetch_traits(engine_traits)</span></code> from engines namespace to fetch
and set properties from the origin engine in the object <code class="docutils literal notranslate"><span class="pre">engine_traits</span></code>. If
function does not exists, <code class="docutils literal notranslate"><span class="pre">None</span></code> is returned.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.get_language">
<span class="sig-name descname"><span class="pre">get_language</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">searxng_locale</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.get_language"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.get_language" title="Link to this definition"></a></dt>
<dd><p>Return engines language string that <em>best fits</em> to SearXNGs locale.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>searxng_locale</strong> SearXNGs internal representation of locale
selected by the user.</p></li>
<li><p><strong>default</strong> engines default language</p></li>
</ul>
</dd>
</dl>
<p>The <em>best fits</em> rules are implemented in
<a class="reference internal" href="../../src/searx.locales.html#searx.locales.get_engine_locale" title="searx.locales.get_engine_locale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.locales.get_engine_locale</span></code></a>. Except for the special value <code class="docutils literal notranslate"><span class="pre">all</span></code>
which is determined from <a class="reference internal" href="#searx.enginelib.traits.EngineTraits.all_locale" title="searx.enginelib.traits.EngineTraits.all_locale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraits.all_locale</span></code></a>.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.get_region">
<span class="sig-name descname"><span class="pre">get_region</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">searxng_locale</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.get_region"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.get_region" title="Link to this definition"></a></dt>
<dd><p>Return engines region string that best fits to SearXNGs locale.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>searxng_locale</strong> SearXNGs internal representation of locale
selected by the user.</p></li>
<li><p><strong>default</strong> engines default region</p></li>
</ul>
</dd>
</dl>
<p>The <em>best fits</em> rules are implemented in
<a class="reference internal" href="../../src/searx.locales.html#searx.locales.get_engine_locale" title="searx.locales.get_engine_locale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">searx.locales.get_engine_locale</span></code></a>. Except for the special value <code class="docutils literal notranslate"><span class="pre">all</span></code>
which is determined from <a class="reference internal" href="#searx.enginelib.traits.EngineTraits.all_locale" title="searx.enginelib.traits.EngineTraits.all_locale"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraits.all_locale</span></code></a>.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.is_locale_supported">
<span class="sig-name descname"><span class="pre">is_locale_supported</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">searxng_locale</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><span class="pre">bool</span></a></span></span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.is_locale_supported"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.is_locale_supported" title="Link to this definition"></a></dt>
<dd><p>A <em>locale</em> (SearXNGs internal representation) is considered to be
supported by the engine if the <em>region</em> or the <em>language</em> is supported
by the engine.</p>
<p>For verification the functions <a class="reference internal" href="#searx.enginelib.traits.EngineTraits.get_region" title="searx.enginelib.traits.EngineTraits.get_region"><code class="xref py py-func docutils literal notranslate"><span class="pre">EngineTraits.get_region()</span></code></a> and
<a class="reference internal" href="#searx.enginelib.traits.EngineTraits.get_language" title="searx.enginelib.traits.EngineTraits.get_language"><code class="xref py py-func docutils literal notranslate"><span class="pre">EngineTraits.get_language()</span></code></a> are used.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.set_traits">
<span class="sig-name descname"><span class="pre">set_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#searx.enginelib.Engine" title="searx.enginelib.Engine"><span class="pre">Engine</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraits.set_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.set_traits" title="Link to this definition"></a></dt>
<dd><p>Set traits from self object in a <a class="reference internal" href="#searx.enginelib.Engine" title="searx.enginelib.Engine"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Engine</span></code></a> namespace.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>engine</strong> engine instance build by <a class="reference internal" href="engines.html#searx.engines.load_engine" title="searx.engines.load_engine"><code class="xref py py-func docutils literal notranslate"><span class="pre">searx.engines.load_engine()</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.all_locale">
<span class="sig-name descname"><span class="pre">all_locale</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">None</span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.all_locale" title="Link to this definition"></a></dt>
<dd><p>To which locale value SearXNGs <code class="docutils literal notranslate"><span class="pre">all</span></code> language is mapped (shown a “Default
language”).</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.custom">
<span class="sig-name descname"><span class="pre">custom</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.12)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.12)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.12)"><span class="pre">Dict</span></a><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Iterable" title="(in Python v3.12)"><span class="pre">Iterable</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.custom" title="Link to this definition"></a></dt>
<dd><p>A place to store engines custom traits, not related to the SearXNG core.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.data_type">
<span class="sig-name descname"><span class="pre">data_type</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Literal" title="(in Python v3.12)"><span class="pre">Literal</span></a><span class="p"><span class="pre">[</span></span><span class="s"><span class="pre">'traits_v1'</span></span><span class="p"><span class="pre">]</span></span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'traits_v1'</span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.data_type" title="Link to this definition"></a></dt>
<dd><p>Data type, default is traits_v1.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.languages">
<span class="sig-name descname"><span class="pre">languages</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.12)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.languages" title="Link to this definition"></a></dt>
<dd><p>Maps SearXNGs internal representation of a language to the one of the engine.</p>
<p>SearXNGs internal representation can be parsed by babel and the value is
send to the engine:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">languages</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">&#39;ca&#39;</span> <span class="p">:</span> <span class="o">&lt;</span><span class="n">engine</span><span class="s1">&#39;s language name&gt;,</span>
<span class="p">}</span>
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">egnine_lang</span> <span class="ow">in</span> <span class="n">languages</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="n">searxng_lang</span> <span class="o">=</span> <span class="n">babel</span><span class="o">.</span><span class="n">Locale</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
<span class="o">...</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraits.regions">
<span class="sig-name descname"><span class="pre">regions</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Dict" title="(in Python v3.12)"><span class="pre">Dict</span></a><span class="p"><span class="pre">[</span></span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraits.regions" title="Link to this definition"></a></dt>
<dd><p>Maps SearXNGs internal representation of a region to the one of the engine.</p>
<p>SearXNGs internal representation can be parsed by babel and the value is
send to the engine:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">regions</span> <span class="o">=</span><span class="p">{</span>
<span class="s1">&#39;fr-BE&#39;</span> <span class="p">:</span> <span class="o">&lt;</span><span class="n">engine</span><span class="s1">&#39;s region name&gt;,</span>
<span class="p">}</span>
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">egnine_region</span> <span class="n">regions</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="n">searxng_region</span> <span class="o">=</span> <span class="n">babel</span><span class="o">.</span><span class="n">Locale</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s1">&#39;-&#39;</span><span class="p">)</span>
<span class="o">...</span>
</pre></div>
</div>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsEncoder">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">searx.enginelib.traits.</span></span><span class="sig-name descname"><span class="pre">EngineTraitsEncoder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">skipkeys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ensure_ascii</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">check_circular</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allow_nan</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sort_keys</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">indent</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">separators</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsEncoder"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsEncoder" title="Link to this definition"></a></dt>
<dd><p>Encodes <a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraits</span></code></a> to a serializable object, see
<a class="reference external" href="https://docs.python.org/3/library/json.html#json.JSONEncoder" title="(in Python v3.12)"><code class="xref py py-class docutils literal notranslate"><span class="pre">json.JSONEncoder</span></code></a>.</p>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsEncoder.default">
<span class="sig-name descname"><span class="pre">default</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">o</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsEncoder.default"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsEncoder.default" title="Link to this definition"></a></dt>
<dd><p>Return dictionary of a <a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraits</span></code></a> object.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">searx.enginelib.traits.</span></span><span class="sig-name descname"><span class="pre">EngineTraitsMap</span></span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap" title="Link to this definition"></a></dt>
<dd><p>A python dictionary to map <a class="reference internal" href="#searx.enginelib.traits.EngineTraits" title="searx.enginelib.traits.EngineTraits"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraits</span></code></a> by engine name.</p>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap.from_data">
<em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#searx.enginelib.traits.EngineTraitsMap" title="searx.enginelib.traits.EngineTraitsMap"><span class="pre">EngineTraitsMap</span></a></span></span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.from_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap.from_data" title="Link to this definition"></a></dt>
<dd><p>Instantiate <a class="reference internal" href="#searx.enginelib.traits.EngineTraitsMap" title="searx.enginelib.traits.EngineTraitsMap"><code class="xref py py-class docutils literal notranslate"><span class="pre">EngineTraitsMap</span></code></a> object from <code class="xref py py-obj docutils literal notranslate"><span class="pre">ENGINE_TRAITS</span></code></p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap.save_data">
<span class="sig-name descname"><span class="pre">save_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.save_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap.save_data" title="Link to this definition"></a></dt>
<dd><p>Store EngineTraitsMap in in file <code class="xref py py-obj docutils literal notranslate"><span class="pre">self.ENGINE_TRAITS_FILE</span></code></p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap.set_traits">
<span class="sig-name descname"><span class="pre">set_traits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="#searx.enginelib.Engine" title="searx.enginelib.Engine"><span class="pre">Engine</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/types.html#types.ModuleType" title="(in Python v3.12)"><span class="pre">types.ModuleType</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/searx/enginelib/traits.html#EngineTraitsMap.set_traits"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap.set_traits" title="Link to this definition"></a></dt>
<dd><p>Set traits in a <code class="xref py py-obj docutils literal notranslate"><span class="pre">Engine</span></code> namespace.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>engine</strong> engine instance build by <a class="reference internal" href="engines.html#searx.engines.load_engine" title="searx.engines.load_engine"><code class="xref py py-func docutils literal notranslate"><span class="pre">searx.engines.load_engine()</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="searx.enginelib.traits.EngineTraitsMap.ENGINE_TRAITS_FILE">
<span class="sig-name descname"><span class="pre">ENGINE_TRAITS_FILE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">PosixPath('/home/runner/work/PonySearch/PonySearch/searx/data/engine_traits.json')</span></em><a class="headerlink" href="#searx.enginelib.traits.EngineTraitsMap.ENGINE_TRAITS_FILE" title="Link to this definition"></a></dt>
<dd><p>File with persistence of the <a class="reference internal" href="#searx.enginelib.traits.EngineTraitsMap" title="searx.enginelib.traits.EngineTraitsMap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EngineTraitsMap</span></code></a>.</p>
</dd></dl>
</dd></dl>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<span id="sidebar-top"></span>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../index.html">
<img class="logo" src="../../_static/searxng-wordmark.svg" alt="Logo"/>
</a></p>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../user/index.html">User information</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../own-instance.html">Why use a private instance?</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin/index.html">Administrator documentation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../quickstart.html">Development Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rtm_asdf.html">Runtime Management</a></li>
<li class="toctree-l2"><a class="reference internal" href="../contribution_guide.html">How to contribute</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Engine Implementations</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">Engine Library</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#searx.enginelib.Engine"><code class="docutils literal notranslate"><span class="pre">Engine</span></code></a><ul>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.about"><code class="docutils literal notranslate"><span class="pre">Engine.about</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.categories"><code class="docutils literal notranslate"><span class="pre">Engine.categories</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.disabled"><code class="docutils literal notranslate"><span class="pre">Engine.disabled</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.display_error_messages"><code class="docutils literal notranslate"><span class="pre">Engine.display_error_messages</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.enable_http"><code class="docutils literal notranslate"><span class="pre">Engine.enable_http</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.engine"><code class="docutils literal notranslate"><span class="pre">Engine.engine</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.engine_type"><code class="docutils literal notranslate"><span class="pre">Engine.engine_type</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.fetch_traits"><code class="docutils literal notranslate"><span class="pre">Engine.fetch_traits</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.inactive"><code class="docutils literal notranslate"><span class="pre">Engine.inactive</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.language"><code class="docutils literal notranslate"><span class="pre">Engine.language</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.language_support"><code class="docutils literal notranslate"><span class="pre">Engine.language_support</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.name"><code class="docutils literal notranslate"><span class="pre">Engine.name</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.paging"><code class="docutils literal notranslate"><span class="pre">Engine.paging</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.proxies"><code class="docutils literal notranslate"><span class="pre">Engine.proxies</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.region"><code class="docutils literal notranslate"><span class="pre">Engine.region</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.safesearch"><code class="docutils literal notranslate"><span class="pre">Engine.safesearch</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.send_accept_language_header"><code class="docutils literal notranslate"><span class="pre">Engine.send_accept_language_header</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.shortcut"><code class="docutils literal notranslate"><span class="pre">Engine.shortcut</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.time_range_support"><code class="docutils literal notranslate"><span class="pre">Engine.time_range_support</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.timeout"><code class="docutils literal notranslate"><span class="pre">Engine.timeout</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.tokens"><code class="docutils literal notranslate"><span class="pre">Engine.tokens</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.traits"><code class="docutils literal notranslate"><span class="pre">Engine.traits</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.Engine.using_tor_proxy"><code class="docutils literal notranslate"><span class="pre">Engine.using_tor_proxy</span></code></a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="#module-searx.enginelib.traits">Engine traits</a><ul>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.traits.EngineTraits"><code class="docutils literal notranslate"><span class="pre">EngineTraits</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.traits.EngineTraitsEncoder"><code class="docutils literal notranslate"><span class="pre">EngineTraitsEncoder</span></code></a></li>
<li class="toctree-l5"><a class="reference internal" href="#searx.enginelib.traits.EngineTraitsMap"><code class="docutils literal notranslate"><span class="pre">EngineTraitsMap</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="engines.html">SearXNGs engines loader</a></li>
<li class="toctree-l3"><a class="reference internal" href="engine_overview.html">Engine Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="index.html#engine-types">Engine Types</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../search_api.html">Search API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugins.html">Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../translation.html">Translation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lxcdev.html">Developing in Linux Containers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../makefile.html">Makefile &amp; <code class="docutils literal notranslate"><span class="pre">./manage</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../reST.html">reST primer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../searxng_extra/index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">searxng_extra</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../utils/index.html">DevOps tooling box</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../src/index.html">Source-Code</a></li>
</ul>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/Fauli1221/PonySearch/tree/master">Source</a>
<li><a href="https://github.com/searxng/searxng/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://github.com/searxng/searxng/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../../index.html">Overview</a>
<ul>
<li><a href="../index.html">Developer documentation</a>
<ul>
<li><a href="index.html">Engine Implementations</a>
<ul>
<li>Previous: <a href="index.html" title="previous chapter">Engine Implementations</a>
<li>Next: <a href="engines.html" title="next chapter">SearXNGs engines loader</a></ul>
</li></ul>
</li>
</ul>
</li>
</ul>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/dev/engines/enginelib.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright SearXNG team.
</div>
<script src="../../_static/version_warning_offset.js"></script>
</body>
</html>