Deploy searx/searx to github.com/searx/searx.git:gh-pages

This commit is contained in:
Deployment Bot (from Travis CI) 2020-11-04 13:12:59 +00:00
parent f0769756e7
commit 488bcab13c
51 changed files with 1008 additions and 19 deletions

102
_modules/index.html Normal file
View File

@ -0,0 +1,102 @@
<!DOCTYPE html>
<html>
<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>Overview: module code &#8212; Searx Documentation (Searx-0.17.0.tex)</title>
<link rel="stylesheet" href="../_static/searx.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/segment.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/menu.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/tabs.css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script src="../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.js"></script>
<script src="../_static/sphinx_tabs/tabs.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '../';</script>
</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="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-0.17.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Overview: module code</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>All modules for which code is available</h1>
<ul><li><a href="standalone_searx.html">standalone_searx</a></li>
</ul>
<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/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://searx.space/">Public instances</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
</li>
</ul>
<div 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" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2020, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>

View File

@ -0,0 +1,326 @@
<!DOCTYPE html>
<html>
<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>standalone_searx &#8212; Searx Documentation (Searx-0.17.0.tex)</title>
<link rel="stylesheet" href="../_static/searx.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/segment.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/menu.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/tabs.css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script src="../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.js"></script>
<script src="../_static/sphinx_tabs/tabs.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '../';</script>
</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="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-0.17.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">standalone_searx</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for standalone_searx</h1><div class="highlight"><pre>
<span></span>#!/usr/bin/env python
&quot;&quot;&quot;Script to run searx from terminal.
Getting categories without initiate the engine will only return `[&#39;general&#39;]`
&gt;&gt;&gt; import searx.engines
... list(searx.engines.categories.keys())
[&#39;general&#39;]
&gt;&gt;&gt; import searx
... searx.engines.initialize_engines(searx.settings[&#39;engines&#39;])
... list(searx.engines.categories.keys())
[&#39;general&#39;, &#39;it&#39;, &#39;science&#39;, &#39;images&#39;, &#39;news&#39;, &#39;videos&#39;, &#39;music&#39;, &#39;files&#39;, &#39;social media&#39;, &#39;map&#39;]
Example to use this script:
.. code:: bash
$ SEARX_DEBUG=1 python3 utils/standalone_searx.py rain
Example to run it from python:
&gt;&gt;&gt; import importlib
... import json
... import sys
... import searx
... import searx.engines
... search_query = &#39;rain&#39;
... # initialize engines
... searx.engines.initialize_engines(searx.settings[&#39;engines&#39;])
... # load engines categories once instead of each time the function called
... engine_cs = list(searx.engines.categories.keys())
... # load module
... spec = importlib.util.spec_from_file_location(
... &#39;utils.standalone_searx&#39;, &#39;utils/standalone_searx.py&#39;)
... sas = importlib.util.module_from_spec(spec)
... spec.loader.exec_module(sas)
... # use function from module
... prog_args = sas.parse_argument([search_query], category_choices=engine_cs)
... search_q = sas.get_search_query(prog_args, engine_categories=engine_cs)
... res_dict = sas.to_dict(search_q)
... sys.stdout.write(json.dumps(
... res_dict, sort_keys=True, indent=4, ensure_ascii=False,
... default=sas.json_serial))
{
&quot;answers&quot;: [],
&quot;infoboxes&quot;: [ {...} ],
&quot;paging&quot;: true,
&quot;results&quot;: [... ],
&quot;results_number&quot;: 820000000.0,
&quot;search&quot;: {
&quot;lang&quot;: &quot;all&quot;,
&quot;pageno&quot;: 1,
&quot;q&quot;: &quot;rain&quot;,
&quot;safesearch&quot;: 0,
&quot;timerange&quot;: null
},
&quot;suggestions&quot;: [...]
}
&quot;&quot;&quot; # noqa: E501
# pylint: disable=pointless-string-statement
&#39;&#39;&#39;
searx is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
searx is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with searx. If not, see &lt; http://www.gnu.org/licenses/ &gt;.
(C) 2016- by Alexandre Flament, &lt;alex@al-f.net&gt;
&#39;&#39;&#39;
# pylint: disable=wrong-import-position
import argparse
import sys
from datetime import datetime
from json import dumps
from typing import Any, Dict, List, Optional
import searx
import searx.engines
import searx.preferences
import searx.query
import searx.search
import searx.webadapter
EngineCategoriesVar = Optional[List[str]]
<div class="viewcode-block" id="get_search_query"><a class="viewcode-back" href="../utils/standalone_searx.py.html#standalone_searx.get_search_query">[docs]</a>def get_search_query(
args: argparse.Namespace, engine_categories: EngineCategoriesVar = None
) -&gt; searx.search.SearchQuery:
&quot;&quot;&quot;Get search results for the query&quot;&quot;&quot;
if engine_categories is None:
engine_categories = list(searx.engines.categories.keys())
try:
category = args.category.decode(&#39;utf-8&#39;)
except AttributeError:
category = args.category
form = {
&quot;q&quot;: args.query,
&quot;categories&quot;: category,
&quot;pageno&quot;: str(args.pageno),
&quot;language&quot;: args.lang,
&quot;time_range&quot;: args.timerange
}
preferences = searx.preferences.Preferences(
[&#39;oscar&#39;], engine_categories, searx.engines.engines, [])
preferences.key_value_settings[&#39;safesearch&#39;].parse(args.safesearch)
search_query = searx.webadapter.get_search_query_from_webapp(
preferences, form)[0]
return search_query</div>
<div class="viewcode-block" id="no_parsed_url"><a class="viewcode-back" href="../utils/standalone_searx.py.html#standalone_searx.no_parsed_url">[docs]</a>def no_parsed_url(results: List[Dict[str, Any]]) -&gt; List[Dict[str, Any]]:
&quot;&quot;&quot;Remove parsed url from dict.&quot;&quot;&quot;
for result in results:
del result[&#39;parsed_url&#39;]
return results</div>
<div class="viewcode-block" id="json_serial"><a class="viewcode-back" href="../utils/standalone_searx.py.html#standalone_searx.json_serial">[docs]</a>def json_serial(obj: Any) -&gt; Any:
&quot;&quot;&quot;JSON serializer for objects not serializable by default json code.
:raise TypeError: raised when **obj** is not serializable
&quot;&quot;&quot;
if isinstance(obj, datetime):
serial = obj.isoformat()
return serial
if isinstance(obj, bytes):
return obj.decode(&#39;utf8&#39;)
if isinstance(obj, set):
return list(obj)
raise TypeError(&quot;Type ({}) not serializable&quot;.format(type(obj)))</div>
<div class="viewcode-block" id="to_dict"><a class="viewcode-back" href="../utils/standalone_searx.py.html#standalone_searx.to_dict">[docs]</a>def to_dict(search_query: searx.search.SearchQuery) -&gt; Dict[str, Any]:
&quot;&quot;&quot;Get result from parsed arguments.&quot;&quot;&quot;
result_container = searx.search.Search(search_query).search()
result_container_json = {
&quot;search&quot;: {
&quot;q&quot;: search_query.query,
&quot;pageno&quot;: search_query.pageno,
&quot;lang&quot;: search_query.lang,
&quot;safesearch&quot;: search_query.safesearch,
&quot;timerange&quot;: search_query.time_range,
},
&quot;results&quot;: no_parsed_url(result_container.get_ordered_results()),
&quot;infoboxes&quot;: result_container.infoboxes,
&quot;suggestions&quot;: list(result_container.suggestions),
&quot;answers&quot;: list(result_container.answers),
&quot;paging&quot;: result_container.paging,
&quot;results_number&quot;: result_container.results_number()
}
return result_container_json</div>
<div class="viewcode-block" id="parse_argument"><a class="viewcode-back" href="../utils/standalone_searx.py.html#standalone_searx.parse_argument">[docs]</a>def parse_argument(
args: Optional[List[str]]=None,
category_choices: EngineCategoriesVar=None
) -&gt; argparse.Namespace:
&quot;&quot;&quot;Parse command line.
:raise SystemExit: Query argument required on `args`
Examples:
&gt;&gt;&gt; import importlib
... # load module
... spec = importlib.util.spec_from_file_location(
... &#39;utils.standalone_searx&#39;, &#39;utils/standalone_searx.py&#39;)
... sas = importlib.util.module_from_spec(spec)
... spec.loader.exec_module(sas)
... sas.parse_argument()
usage: ptipython [-h] [--category [{general}]] [--lang [LANG]] [--pageno [PAGENO]] [--safesearch [{0,1,2}]] [--timerange [{day,week,month,year}]]
query
SystemExit: 2
&gt;&gt;&gt; sas.parse_argument([&#39;rain&#39;])
Namespace(category=&#39;general&#39;, lang=&#39;all&#39;, pageno=1, query=&#39;rain&#39;, safesearch=&#39;0&#39;, timerange=None)
&quot;&quot;&quot; # noqa: E501
if not category_choices:
category_choices = list(searx.engines.categories.keys())
parser = argparse.ArgumentParser(description=&#39;Standalone searx.&#39;)
parser.add_argument(&#39;query&#39;, type=str,
help=&#39;Text query&#39;)
parser.add_argument(&#39;--category&#39;, type=str, nargs=&#39;?&#39;,
choices=category_choices,
default=&#39;general&#39;,
help=&#39;Search category&#39;)
parser.add_argument(&#39;--lang&#39;, type=str, nargs=&#39;?&#39;, default=&#39;all&#39;,
help=&#39;Search language&#39;)
parser.add_argument(&#39;--pageno&#39;, type=int, nargs=&#39;?&#39;, default=1,
help=&#39;Page number starting from 1&#39;)
parser.add_argument(
&#39;--safesearch&#39;, type=str, nargs=&#39;?&#39;,
choices=[&#39;0&#39;, &#39;1&#39;, &#39;2&#39;], default=&#39;0&#39;,
help=&#39;Safe content filter from none to strict&#39;)
parser.add_argument(
&#39;--timerange&#39;, type=str,
nargs=&#39;?&#39;, choices=[&#39;day&#39;, &#39;week&#39;, &#39;month&#39;, &#39;year&#39;],
help=&#39;Filter by time range&#39;)
return parser.parse_args(args)</div>
if __name__ == &#39;__main__&#39;:
searx.engines.initialize_engines(searx.settings[&#39;engines&#39;])
engine_cs = list(searx.engines.categories.keys())
prog_args = parse_argument(category_choices=engine_cs)
search_q = get_search_query(prog_args, engine_categories=engine_cs)
res_dict = to_dict(search_q)
sys.stdout.write(dumps(
res_dict, sort_keys=True, indent=4, ensure_ascii=False,
default=json_serial))
</pre></div>
<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/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://searx.space/">Public instances</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Module code</a>
</ul>
</li>
</ul>
</li>
</ul>
<div 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" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2020, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>

View File

@ -16,6 +16,7 @@ developers.
filtron.sh
morty.sh
lxc.sh
standalone_searx.py
.. _toolboxing common:

View File

@ -0,0 +1,11 @@
.. _standalone_searx.py:
=============================
``utils/standalone_searx.py``
=============================
.. automodule:: standalone_searx
:members:

View File

@ -31,6 +31,9 @@
<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="architecture.html" title="Architecture"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="filtron.html" title="How to protect an instance"
accesskey="N">next</a> |</li>

View File

@ -33,6 +33,9 @@
<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="../dev/index.html" title="Developer documentation"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="plugins.html" title="Plugins builtin"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="morty.html" title="How to setup result proxy"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="installation.html" title="Installation"
accesskey="N">next</a> |</li>

View File

@ -33,6 +33,9 @@
<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="installation-docker.html" title="Docker installation"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="update-searx.html" title="How to update"
accesskey="N">next</a> |</li>

View File

@ -33,6 +33,9 @@
<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="installation-apache.html" title="Install with apache"
accesskey="N">next</a> |</li>

View File

@ -33,6 +33,9 @@
<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="installation-uwsgi.html" title="uwsgi"
accesskey="N">next</a> |</li>

View File

@ -33,6 +33,9 @@
<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="installation-nginx.html" title="Install with nginx"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="installation-searx.html" title="Step by step installation"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="Engines"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="buildhosts.html" title="Buildhosts"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="api.html" title="Administration API"
accesskey="N">next</a> |</li>

View File

@ -33,6 +33,9 @@
<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="settings.html" title="settings.yml"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="intro-offline.html" title="Preparation for offline engines"
accesskey="N">next</a> |</li>

View File

@ -30,6 +30,9 @@
<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="private-engines.html" title="Limit access to your searx engines"
accesskey="P">previous</a> |</li>

View File

@ -21,7 +21,7 @@
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Developing in Linux containers [202006]" href="lxcdev-202006.html" />
<link rel="prev" title="utils/lxc.sh" href="../utils/lxc.sh.html" />
<link rel="prev" title="utils/standalone_searx.py" href="../utils/standalone_searx.py.html" />
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '../';</script>
</head><body>
@ -31,11 +31,14 @@
<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="lxcdev-202006.html" title="Developing in Linux containers [202006]"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../utils/lxc.sh.html" title="utils/lxc.sh"
<a href="../utils/standalone_searx.py.html" title="utils/standalone_searx.py"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-0.17.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Blog</a></li>
@ -122,7 +125,7 @@
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li>Previous: <a href="../utils/lxc.sh.html" title="previous chapter"><code class="docutils literal notranslate"><span class="pre">utils/lxc.sh</span></code></a>
<li>Previous: <a href="../utils/standalone_searx.py.html" title="previous chapter"><code class="docutils literal notranslate"><span class="pre">utils/standalone_searx.py</span></code></a>
<li>Next: <a href="lxcdev-202006.html" title="next chapter">Developing in Linux containers [202006]</a>
</ul>
</li>

View File

@ -31,6 +31,9 @@
<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="private-engines.html" title="Limit access to your searx engines"
accesskey="N">next</a> |</li>

View File

@ -33,6 +33,9 @@
<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="python3.html" title="Introducing Python 3 support"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="command-line-engines.html" title="Running shell commands to fetch results"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="admin.html" title="Searx admin interface"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="engine_overview.html" title="Engine overview"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="search_api.html" title="Search API"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="quickstart.html" title="Development Quickstart"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="reST.html" title="reST primer"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="translation.html" title="Translation"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="contribution_guide.html" title="How to contribute"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="../utils/index.html" title="Tooling box utils/*"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="plugins.html" title="Plugins"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="makefile.html" title="Makefile Targets"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<li class="right" style="margin-right: 10px">
<a href="#" 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="nav-item nav-item-0"><a href="index.html">Searx Documentation (Searx-0.17.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Index</a></li>
</ul>
@ -45,12 +48,59 @@
<h1 id="index">Index</h1>
<div class="genindex-jumpbox">
<a href="#P"><strong>P</strong></a>
<a href="#G"><strong>G</strong></a>
| <a href="#J"><strong>J</strong></a>
| <a href="#M"><strong>M</strong></a>
| <a href="#N"><strong>N</strong></a>
| <a href="#P"><strong>P</strong></a>
| <a href="#R"><strong>R</strong></a>
| <a href="#S"><strong>S</strong></a>
| <a href="#T"><strong>T</strong></a>
</div>
<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="utils/standalone_searx.py.html#standalone_searx.get_search_query">get_search_query() (in module standalone_searx)</a>
</li>
</ul></td>
</tr></table>
<h2 id="J">J</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="utils/standalone_searx.py.html#standalone_searx.json_serial">json_serial() (in module standalone_searx)</a>
</li>
</ul></td>
</tr></table>
<h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
module
<ul>
<li><a href="utils/standalone_searx.py.html#module-standalone_searx">standalone_searx</a>
</li>
</ul></li>
</ul></td>
</tr></table>
<h2 id="N">N</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="utils/standalone_searx.py.html#standalone_searx.no_parsed_url">no_parsed_url() (in module standalone_searx)</a>
</li>
</ul></td>
</tr></table>
<h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="utils/standalone_searx.py.html#standalone_searx.parse_argument">parse_argument() (in module standalone_searx)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
Python Enhancement Proposals
@ -75,6 +125,27 @@
</ul></td>
</tr></table>
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
standalone_searx
<ul>
<li><a href="utils/standalone_searx.py.html#module-standalone_searx">module</a>
</li>
</ul></li>
</ul></td>
</tr></table>
<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="utils/standalone_searx.py.html#standalone_searx.to_dict">to_dict() (in module standalone_searx)</a>
</li>
</ul></td>
</tr></table>
<div class="clearer"></div>

View File

@ -30,6 +30,9 @@
<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="user/index.html" title="User documentation"
accesskey="N">next</a> |</li>
@ -109,6 +112,7 @@ digital rights</p></li>
<li class="toctree-l2"><a class="reference internal" href="utils/filtron.sh.html"><code class="docutils literal notranslate"><span class="pre">utils/filtron.sh</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="utils/morty.sh.html"><code class="docutils literal notranslate"><span class="pre">utils/morty.sh</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="utils/lxc.sh.html"><code class="docutils literal notranslate"><span class="pre">utils/lxc.sh</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="utils/standalone_searx.py.html"><code class="docutils literal notranslate"><span class="pre">utils/standalone_searx.py</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="utils/index.html#common-commands-environment">Common commands &amp; environment</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils/index.html#tooling-box-setup">Tooling box setup</a></li>
</ul>

Binary file not shown.

124
py-modindex.html Normal file
View File

@ -0,0 +1,124 @@
<!DOCTYPE html>
<html>
<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>Python Module Index &#8212; Searx Documentation (Searx-0.17.0.tex)</title>
<link rel="stylesheet" href="_static/searx.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx_tabs/semantic-ui-2.4.1/segment.min.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx_tabs/semantic-ui-2.4.1/menu.min.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx_tabs/tabs.css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script src="_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.js"></script>
<script src="_static/sphinx_tabs/tabs.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<script>DOCUMENTATION_OPTIONS.URL_ROOT = './';</script>
<script>
DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;
</script>
</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="#" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Searx Documentation (Searx-0.17.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Python Module Index</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Python Module Index</h1>
<div class="modindex-jumpbox">
<a href="#cap-s"><strong>s</strong></a>
</div>
<table class="indextable modindextable">
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-s"><td></td><td>
<strong>s</strong></td><td></td></tr>
<tr>
<td></td>
<td>
<a href="utils/standalone_searx.py.html#module-standalone_searx"><code class="xref">standalone_searx</code></a></td><td>
<em></em></td></tr>
</table>
<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/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://searx.space/">Public instances</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="index.html">Overview</a>
</li>
</ul>
<div 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" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2020, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
<script src="_static/version_warning_offset.js"></script>
</body>
</html>

View File

@ -36,6 +36,9 @@
<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="nav-item nav-item-0"><a href="index.html">Searx Documentation (Searx-0.17.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Search</a></li>
</ul>

File diff suppressed because one or more lines are too long

View File

@ -31,6 +31,9 @@
<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="search_syntax.html" title="Search syntax"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="../admin/index.html" title="Administrator documentation"
accesskey="N">next</a> |</li>

View File

@ -31,6 +31,9 @@
<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="own-instance.html" title="Why use a private instance?"
accesskey="N">next</a> |</li>

View File

@ -33,6 +33,9 @@
<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="morty.sh.html" title="utils/morty.sh"
accesskey="N">next</a> |</li>
@ -222,18 +225,18 @@ inspect service
show service status and log
option
set one of the available options
apache (http://10.20.0.78/searx)
apache (http://10.20.0.37/searx)
:install: apache site with a reverse proxy (ProxyPass)
:remove: apache site searx.conf
nginx (http://10.20.0.78/searx)
nginx (http://10.20.0.37/searx)
:install: nginx site with a reverse proxy (ProxyPass)
:remove: nginx site searx.conf
filtron rules: /etc/filtron/rules.json
If needed, set PUBLIC_URL of your WEB service in the &#39;.config.sh&#39; file::
PUBLIC_URL : http://10.20.0.78/searx
PUBLIC_HOST : 10.20.0.78
PUBLIC_URL : http://10.20.0.37/searx
PUBLIC_HOST : 10.20.0.37
SERVICE_USER : filtron
FILTRON_TARGET : 127.0.0.1:8888
FILTRON_API : 127.0.0.1:4005

View File

@ -31,6 +31,9 @@
<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="searx.sh.html" title="utils/searx.sh"
accesskey="N">next</a> |</li>
@ -81,6 +84,7 @@ developers.</p>
<li class="toctree-l2"><a class="reference internal" href="lxc.sh.html#searx-suite">searx suite</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="standalone_searx.py.html"><code class="docutils literal notranslate"><span class="pre">utils/standalone_searx.py</span></code></a></li>
</ul>
</div>
<div class="section" id="common-commands-environment">

View File

@ -20,7 +20,7 @@
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Blog" href="../blog/index.html" />
<link rel="next" title="utils/standalone_searx.py" href="standalone_searx.py.html" />
<link rel="prev" title="utils/morty.sh" href="morty.sh.html" />
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '../';</script>
@ -32,7 +32,10 @@
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../blog/index.html" title="Blog"
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="standalone_searx.py.html" title="utils/standalone_searx.py"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="morty.sh.html" title="utils/morty.sh"
@ -195,7 +198,7 @@ install
:base: prepare LXC; install basic packages
:suite: install LXC searx suite into all (or &lt;name&gt;) containers
LXC suite: searx --&gt; http://10.20.0.78/searx
LXC suite: searx --&gt; http://10.20.0.37/searx
suite includes searx, morty &amp; filtron
suite images:
ubu1604 ubu1804 ubu1910 ubu2004 fedora31 archlinux centos7
@ -341,7 +344,7 @@ lxc_suite_info<span class="o">()</span> <span class="o">{</span>
<li><a href="index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">utils/*</span></code></a>
<ul>
<li>Previous: <a href="morty.sh.html" title="previous chapter"><code class="docutils literal notranslate"><span class="pre">utils/morty.sh</span></code></a>
<li>Next: <a href="../blog/index.html" title="next chapter">Blog</a></ul>
<li>Next: <a href="standalone_searx.py.html" title="next chapter"><code class="docutils literal notranslate"><span class="pre">utils/standalone_searx.py</span></code></a></ul>
</li>
</ul>
</li>

View File

@ -33,6 +33,9 @@
<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="lxc.sh.html" title="utils/lxc.sh"
accesskey="N">next</a> |</li>
@ -224,22 +227,22 @@ inspect service
option
set one of the available options
:new-key: set new morty key
apache : http://10.20.0.78/morty/
apache : http://10.20.0.37/morty/
:install: apache site with a reverse proxy (ProxyPass)
:remove: apache site morty.conf
nginx (http://10.20.0.78/morty/)
nginx (http://10.20.0.37/morty/)
:install: nginx site with a reverse proxy (ProxyPass)
:remove: nginx site morty.conf
If needed, set the environment variables in the &#39;.config.sh&#39; file::
PUBLIC_URL_MORTY: http://10.20.0.78/morty/
PUBLIC_URL_MORTY: http://10.20.0.37/morty/
MORTY_LISTEN: 127.0.0.1:3000
SERVICE_USER: morty
To activate result and image proxy in searx, edit settings.yml (read:
https://searx.github.io/searx/admin/morty.html)::
result_proxy:
url : http://10.20.0.78/morty/
url : http://10.20.0.37/morty/
server:
image_proxy : True
</pre></div>

View File

@ -31,6 +31,9 @@
<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="filtron.sh.html" title="utils/filtron.sh"
accesskey="N">next</a> |</li>
@ -114,8 +117,8 @@ apache
searx settings: /etc/searx/settings.yml
If needed, set PUBLIC_URL of your WEB service in the &#39;.config.sh&#39; file::
PUBLIC_URL : http://10.20.0.78/searx
SEARX_INSTANCE_NAME : searx@10.20.0.78
PUBLIC_URL : http://10.20.0.37/searx
SEARX_INSTANCE_NAME : searx@10.20.0.37
SERVICE_USER : searx
SEARX_INTERNAL_HTTP : http://127.0.0.1:8888
</pre></div>

View File

@ -0,0 +1,226 @@
<!DOCTYPE html>
<html>
<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>utils/standalone_searx.py &#8212; Searx Documentation (Searx-0.17.0.tex)</title>
<link rel="stylesheet" href="../_static/searx.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/segment.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/menu.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/tabs.css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Blog" href="../blog/index.html" />
<link rel="prev" title="utils/lxc.sh" href="lxc.sh.html" />
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '../';</script>
</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="../blog/index.html" title="Blog"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="lxc.sh.html" title="utils/lxc.sh"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-0.17.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Tooling box <code class="docutils literal notranslate"><span class="pre">utils/*</span></code></a> &#187;</li>
<li class="nav-item nav-item-this"><a href=""><code class="docutils literal notranslate"><span class="pre">utils/standalone_searx.py</span></code></a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-standalone_searx">
<span id="utils-standalone-searx-py"></span><span id="standalone-searx-py"></span><h1><code class="docutils literal notranslate"><span class="pre">utils/standalone_searx.py</span></code><a class="headerlink" href="#module-standalone_searx" title="Permalink to this headline"></a></h1>
<p>Script to run searx from terminal.</p>
<p>Getting categories without initiate the engine will only return <cite>[general]</cite></p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">searx.engines</span>
<span class="gp">... </span><span class="nb">list</span><span class="p">(</span><span class="n">searx</span><span class="o">.</span><span class="n">engines</span><span class="o">.</span><span class="n">categories</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="go">[&#39;general&#39;]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">searx</span>
<span class="gp">... </span><span class="n">searx</span><span class="o">.</span><span class="n">engines</span><span class="o">.</span><span class="n">initialize_engines</span><span class="p">(</span><span class="n">searx</span><span class="o">.</span><span class="n">settings</span><span class="p">[</span><span class="s1">&#39;engines&#39;</span><span class="p">])</span>
<span class="gp">... </span><span class="nb">list</span><span class="p">(</span><span class="n">searx</span><span class="o">.</span><span class="n">engines</span><span class="o">.</span><span class="n">categories</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="go">[&#39;general&#39;, &#39;it&#39;, &#39;science&#39;, &#39;images&#39;, &#39;news&#39;, &#39;videos&#39;, &#39;music&#39;, &#39;files&#39;, &#39;social media&#39;, &#39;map&#39;]</span>
</pre></div>
</div>
<p>Example to use this script:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nv">SEARX_DEBUG</span><span class="o">=</span><span class="m">1</span> python3 utils/standalone_searx.py rain
</pre></div>
</div>
<p>Example to run it from python:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">importlib</span>
<span class="gp">... </span><span class="kn">import</span> <span class="nn">json</span>
<span class="gp">... </span><span class="kn">import</span> <span class="nn">sys</span>
<span class="gp">... </span><span class="kn">import</span> <span class="nn">searx</span>
<span class="gp">... </span><span class="kn">import</span> <span class="nn">searx.engines</span>
<span class="gp">... </span><span class="n">search_query</span> <span class="o">=</span> <span class="s1">&#39;rain&#39;</span>
<span class="gp">... </span><span class="c1"># initialize engines</span>
<span class="gp">... </span><span class="n">searx</span><span class="o">.</span><span class="n">engines</span><span class="o">.</span><span class="n">initialize_engines</span><span class="p">(</span><span class="n">searx</span><span class="o">.</span><span class="n">settings</span><span class="p">[</span><span class="s1">&#39;engines&#39;</span><span class="p">])</span>
<span class="gp">... </span><span class="c1"># load engines categories once instead of each time the function called</span>
<span class="gp">... </span><span class="n">engine_cs</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">searx</span><span class="o">.</span><span class="n">engines</span><span class="o">.</span><span class="n">categories</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="gp">... </span><span class="c1"># load module</span>
<span class="gp">... </span><span class="n">spec</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">spec_from_file_location</span><span class="p">(</span>
<span class="gp">... </span> <span class="s1">&#39;utils.standalone_searx&#39;</span><span class="p">,</span> <span class="s1">&#39;utils/standalone_searx.py&#39;</span><span class="p">)</span>
<span class="gp">... </span><span class="n">sas</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">module_from_spec</span><span class="p">(</span><span class="n">spec</span><span class="p">)</span>
<span class="gp">... </span><span class="n">spec</span><span class="o">.</span><span class="n">loader</span><span class="o">.</span><span class="n">exec_module</span><span class="p">(</span><span class="n">sas</span><span class="p">)</span>
<span class="gp">... </span><span class="c1"># use function from module</span>
<span class="gp">... </span><span class="n">prog_args</span> <span class="o">=</span> <span class="n">sas</span><span class="o">.</span><span class="n">parse_argument</span><span class="p">([</span><span class="n">search_query</span><span class="p">],</span> <span class="n">category_choices</span><span class="o">=</span><span class="n">engine_cs</span><span class="p">)</span>
<span class="gp">... </span><span class="n">search_q</span> <span class="o">=</span> <span class="n">sas</span><span class="o">.</span><span class="n">get_search_query</span><span class="p">(</span><span class="n">prog_args</span><span class="p">,</span> <span class="n">engine_categories</span><span class="o">=</span><span class="n">engine_cs</span><span class="p">)</span>
<span class="gp">... </span><span class="n">res_dict</span> <span class="o">=</span> <span class="n">sas</span><span class="o">.</span><span class="n">to_dict</span><span class="p">(</span><span class="n">search_q</span><span class="p">)</span>
<span class="gp">... </span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span>
<span class="gp">... </span> <span class="n">res_dict</span><span class="p">,</span> <span class="n">sort_keys</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">ensure_ascii</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">default</span><span class="o">=</span><span class="n">sas</span><span class="o">.</span><span class="n">json_serial</span><span class="p">))</span>
<span class="go">{</span>
<span class="go"> &quot;answers&quot;: [],</span>
<span class="go"> &quot;infoboxes&quot;: [ {...} ],</span>
<span class="go"> &quot;paging&quot;: true,</span>
<span class="go"> &quot;results&quot;: [... ],</span>
<span class="go"> &quot;results_number&quot;: 820000000.0,</span>
<span class="go"> &quot;search&quot;: {</span>
<span class="go"> &quot;lang&quot;: &quot;all&quot;,</span>
<span class="go"> &quot;pageno&quot;: 1,</span>
<span class="go"> &quot;q&quot;: &quot;rain&quot;,</span>
<span class="go"> &quot;safesearch&quot;: 0,</span>
<span class="go"> &quot;timerange&quot;: null</span>
<span class="go"> },</span>
<span class="go"> &quot;suggestions&quot;: [...]</span>
<span class="go">}</span>
</pre></div>
</div>
<dl class="py function">
<dt id="standalone_searx.get_search_query">
<code class="sig-prename descclassname">standalone_searx.</code><code class="sig-name descname">get_search_query</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">args</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.9)">argparse.Namespace</a></span></em>, <em class="sig-param"><span class="n">engine_categories</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>List<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a><span class="p">]</span><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; searx.search.SearchQuery<a class="reference internal" href="../_modules/standalone_searx.html#get_search_query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#standalone_searx.get_search_query" title="Permalink to this definition"></a></dt>
<dd><p>Get search results for the query</p>
</dd></dl>
<dl class="py function">
<dt id="standalone_searx.json_serial">
<code class="sig-prename descclassname">standalone_searx.</code><code class="sig-name descname">json_serial</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">obj</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> &#x2192; Any<a class="reference internal" href="../_modules/standalone_searx.html#json_serial"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#standalone_searx.json_serial" title="Permalink to this definition"></a></dt>
<dd><p>JSON serializer for objects not serializable by default json code.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#TypeError" title="(in Python v3.9)"><strong>TypeError</strong></a> raised when <strong>obj</strong> is not serializable</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="standalone_searx.no_parsed_url">
<code class="sig-prename descclassname">standalone_searx.</code><code class="sig-name descname">no_parsed_url</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">results</span><span class="p">:</span> <span class="n">List<span class="p">[</span>Dict<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a><span class="p">, </span>Any<span class="p">]</span><span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; List<span class="p">[</span>Dict<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a><span class="p">, </span>Any<span class="p">]</span><span class="p">]</span><a class="reference internal" href="../_modules/standalone_searx.html#no_parsed_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#standalone_searx.no_parsed_url" title="Permalink to this definition"></a></dt>
<dd><p>Remove parsed url from dict.</p>
</dd></dl>
<dl class="py function">
<dt id="standalone_searx.parse_argument">
<code class="sig-prename descclassname">standalone_searx.</code><code class="sig-name descname">parse_argument</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">args</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>List<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a><span class="p">]</span><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">category_choices</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>List<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a><span class="p">]</span><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.9)">argparse.Namespace</a><a class="reference internal" href="../_modules/standalone_searx.html#parse_argument"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#standalone_searx.parse_argument" title="Permalink to this definition"></a></dt>
<dd><p>Parse command line.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#SystemExit" title="(in Python v3.9)"><strong>SystemExit</strong></a> Query argument required on <cite>args</cite></p>
</dd>
</dl>
<p>Examples:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">importlib</span>
<span class="gp">... </span><span class="c1"># load module</span>
<span class="gp">... </span><span class="n">spec</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">spec_from_file_location</span><span class="p">(</span>
<span class="gp">... </span> <span class="s1">&#39;utils.standalone_searx&#39;</span><span class="p">,</span> <span class="s1">&#39;utils/standalone_searx.py&#39;</span><span class="p">)</span>
<span class="gp">... </span><span class="n">sas</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">util</span><span class="o">.</span><span class="n">module_from_spec</span><span class="p">(</span><span class="n">spec</span><span class="p">)</span>
<span class="gp">... </span><span class="n">spec</span><span class="o">.</span><span class="n">loader</span><span class="o">.</span><span class="n">exec_module</span><span class="p">(</span><span class="n">sas</span><span class="p">)</span>
<span class="gp">... </span><span class="n">sas</span><span class="o">.</span><span class="n">parse_argument</span><span class="p">()</span>
<span class="go">usage: ptipython [-h] [--category [{general}]] [--lang [LANG]] [--pageno [PAGENO]] [--safesearch [{0,1,2}]] [--timerange [{day,week,month,year}]]</span>
<span class="go"> query</span>
<span class="go">SystemExit: 2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sas</span><span class="o">.</span><span class="n">parse_argument</span><span class="p">([</span><span class="s1">&#39;rain&#39;</span><span class="p">])</span>
<span class="go">Namespace(category=&#39;general&#39;, lang=&#39;all&#39;, pageno=1, query=&#39;rain&#39;, safesearch=&#39;0&#39;, timerange=None)</span>
</pre></div>
</div>
</dd></dl>
<dl class="py function">
<dt id="standalone_searx.to_dict">
<code class="sig-prename descclassname">standalone_searx.</code><code class="sig-name descname">to_dict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">search_query</span><span class="p">:</span> <span class="n">searx.search.SearchQuery</span></em><span class="sig-paren">)</span> &#x2192; Dict<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)">str</a><span class="p">, </span>Any<span class="p">]</span><a class="reference internal" href="../_modules/standalone_searx.html#to_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#standalone_searx.to_dict" title="Permalink to this definition"></a></dt>
<dd><p>Get result from parsed arguments.</p>
</dd></dl>
</div>
<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/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://searx.space/">Public instances</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Tooling box <code class="docutils literal notranslate"><span class="pre">utils/*</span></code></a>
<ul>
<li>Previous: <a href="lxc.sh.html" title="previous chapter"><code class="docutils literal notranslate"><span class="pre">utils/lxc.sh</span></code></a>
<li>Next: <a href="../blog/index.html" title="next chapter">Blog</a></ul>
</li>
</ul>
</li>
</ul>
<div 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" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2020, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>