id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31,700 | ebay.py | searx_searx/searx/engines/ebay.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Ebay (Videos, Music, Files)
"""
from lxml import html
from searx.engines.xpath import extract_text
from urllib.parse import quote
# about
about = {
"website": 'https://www.ebay.com',
"wikidata_id": 'Q58024',
"official_api_documentation": 'https://developer... | 2,209 | Python | .py | 58 | 32.465517 | 97 | 0.637172 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,701 | core.py | searx_searx/searx/engines/core.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""CORE (science)
"""
# pylint: disable=missing-function-docstring
from json import loads
from datetime import datetime
from urllib.parse import urlencode
from searx import logger
from searx.exceptions import SearxEngineAPIException
logger = logger.getChild('CORE engine'... | 2,144 | Python | .py | 63 | 27.777778 | 76 | 0.621242 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,702 | stackoverflow.py | searx_searx/searx/engines/stackoverflow.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Stackoverflow (IT)
"""
from urllib.parse import urlencode, urljoin, urlparse
from lxml import html
from searx.utils import extract_text
from searx.exceptions import SearxEngineCaptchaException
# about
about = {
"website": 'https://stackoverflow.com/',
"wikidat... | 1,712 | Python | .py | 50 | 29.56 | 93 | 0.673953 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,703 | sepiasearch.py | searx_searx/searx/engines/sepiasearch.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
SepiaSearch (Videos)
"""
from json import loads
from dateutil import parser, relativedelta
from urllib.parse import urlencode
from datetime import datetime
# about
about = {
"website": 'https://sepiasearch.org',
"wikidata_id": None,
"official_api_documenta... | 2,928 | Python | .py | 82 | 28.841463 | 134 | 0.598726 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,704 | doku.py | searx_searx/searx/engines/doku.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Doku Wiki
"""
from urllib.parse import urlencode
from lxml.html import fromstring
from searx.utils import extract_text, eval_xpath
# about
about = {
"website": 'https://www.dokuwiki.org/',
"wikidata_id": 'Q851864',
"official_api_documentation": 'https://ww... | 2,282 | Python | .py | 68 | 25.838235 | 86 | 0.561276 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,705 | bing_videos.py | searx_searx/searx/engines/bing_videos.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Bing (Videos)
"""
from json import loads
from lxml import html
from urllib.parse import urlencode
from searx.utils import match_language
from searx.engines.bing import language_aliases
from searx.engines.bing import _fetch_supported_languages, supported_languages_url ... | 3,122 | Python | .py | 80 | 32.0375 | 122 | 0.608739 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,706 | solidtorrents.py | searx_searx/searx/engines/solidtorrents.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""Solid Torrents
"""
# pylint: disable=missing-function-docstring
from json import loads
from urllib.parse import urlencode
from searx import logger
logger = logger.getChild('solidtor engine')
about = {
"website": 'https://www.solidtorrents.net/',
"wikidata_id"... | 1,376 | Python | .py | 41 | 28.073171 | 69 | 0.62585 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,707 | prowlarr.py | searx_searx/searx/engines/prowlarr.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Prowlarr search (Files)
"""
from json import loads
from urllib.parse import urlencode
from searx.exceptions import SearxEngineAPIException
categories = ''
paging = False
api_key = ''
indexer_ids = ''
search_type = 'search'
search_categories = ''
base_url = ''
def... | 1,827 | Python | .py | 54 | 26.925926 | 104 | 0.623927 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,708 | duckduckgo.py | searx_searx/searx/engines/duckduckgo.py | # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
"""DuckDuckGo Lite
"""
from json import loads
from lxml.html import fromstring
from searx.utils import (
dict_subset,
eval_xpath,
eval_xpath_getindex,
extract_text,
match_language,
)
from searx.poolrequests import get
# about
about = {
... | 5,441 | Python | .py | 140 | 32.85 | 107 | 0.617888 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,709 | framalibre.py | searx_searx/searx/engines/framalibre.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
FramaLibre (It)
"""
from html import escape
from urllib.parse import urljoin, urlencode
from lxml import html
from searx.utils import extract_text
# about
about = {
"website": 'https://framalibre.org/',
"wikidata_id": 'Q30213882',
"official_api_documentati... | 2,104 | Python | .py | 58 | 30.017241 | 114 | 0.633858 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,710 | scanr_structures.py | searx_searx/searx/engines/scanr_structures.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
ScanR Structures (Science)
"""
from json import loads, dumps
from searx.utils import html_to_text
# about
about = {
"website": 'https://scanr.enseignementsup-recherche.gouv.fr',
"wikidata_id": 'Q44105684',
"official_api_documentation": 'https://scanr.ensei... | 2,130 | Python | .py | 62 | 25.83871 | 93 | 0.572891 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,711 | fdroid.py | searx_searx/searx/engines/fdroid.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
F-Droid (a repository of FOSS applications for Android)
"""
from urllib.parse import urlencode
from lxml import html
from searx.utils import extract_text
# about
about = {
"website": 'https://f-droid.org/',
"wikidata_id": 'Q1386210',
"official_api_document... | 1,538 | Python | .py | 42 | 31.119048 | 99 | 0.623315 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,712 | tineye.py | searx_searx/searx/engines/tineye.py | """
Tineye - Reverse search images
"""
from urllib.parse import urlencode
from datetime import datetime
from flask_babel import gettext
from searx import logger
about = {
"website": "https://tineye.com",
"wikidata_id": "Q2382535",
"use_official_api": False,
"require_api_key": False,
"results": "... | 6,247 | Python | .py | 157 | 31.343949 | 95 | 0.595731 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,713 | wikidata.py | searx_searx/searx/engines/wikidata.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wikidata
"""
from urllib.parse import urlencode
from json import loads
from dateutil.parser import isoparse
from babel.dates import format_datetime, format_date, format_time, get_datetime_format
from searx import logger
from searx.data import WIKIDATA_UNITS
from sea... | 25,547 | Python | .py | 570 | 35.970175 | 127 | 0.601022 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,714 | json_engine.py | searx_searx/searx/engines/json_engine.py | # SPDX-License-Identifier: AGPL-3.0-or-later
from collections.abc import Iterable
from json import loads
from urllib.parse import urlencode
from searx.utils import to_string, html_to_text
search_url = None
url_query = None
content_query = None
title_query = None
content_html_to_text = False
title_html_to_text = Fals... | 3,440 | Python | .py | 112 | 22.794643 | 74 | 0.578708 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,715 | yahoo.py | searx_searx/searx/engines/yahoo.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Yahoo (Web)
"""
from urllib.parse import (
unquote,
urlencode,
)
from lxml import html
from searx.utils import (
eval_xpath_getindex,
eval_xpath_list,
extract_text,
match_language,
)
# about
about = {
"website": 'https://search.yahoo.com/'... | 4,100 | Python | .py | 129 | 25.875969 | 91 | 0.596598 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,716 | archlinux.py | searx_searx/searx/engines/archlinux.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Arch Linux Wiki
API: Mediawiki provides API, but Arch Wiki blocks access to it
"""
from urllib.parse import urlencode, urljoin
from lxml import html
from searx.utils import extract_text, eval_xpath_list, eval_xpath_getindex
# about
about = {
"website": 'https://... | 4,098 | Python | .py | 118 | 29.161017 | 78 | 0.633428 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,717 | searx_engine.py | searx_searx/searx/engines/searx_engine.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Searx (all)
"""
from json import loads
from searx.engines import categories as searx_categories
# about
about = {
"website": 'https://github.com/searx/searx',
"wikidata_id": 'Q17639196',
"official_api_documentation": 'https://searx.github.io/searx/dev/sear... | 1,356 | Python | .py | 43 | 27.069767 | 86 | 0.666924 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,718 | redis_server.py | searx_searx/searx/engines/redis_server.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Redis engine (Offline)
"""
# pylint: disable=missing-function-docstring
# pylint: disable=import-error
import redis
engine_type = 'offline'
# redis connection variables
host = '127.0.0.1'
port = 6379
password = ''
db = 0
# engine specific variables
paging = False
res... | 1,585 | Python | .py | 57 | 22.087719 | 77 | 0.609499 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,719 | duckduckgo_images.py | searx_searx/searx/engines/duckduckgo_images.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
DuckDuckGo (Images)
"""
from json import loads
from urllib.parse import urlencode
from searx.exceptions import SearxEngineAPIException
from searx.engines.duckduckgo import get_region_code
from searx.engines.duckduckgo import _fetch_supported_languages, supported_langua... | 2,872 | Python | .py | 76 | 31.75 | 128 | 0.647588 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,720 | recoll.py | searx_searx/searx/engines/recoll.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Recoll (local search engine)
"""
from datetime import date, timedelta
from json import loads
from urllib.parse import urlencode, quote
# about
about = {
"website": None,
"wikidata_id": 'Q15735774',
"official_api_documentation": 'https://www.lesbonscomptes.... | 2,854 | Python | .py | 85 | 26.423529 | 79 | 0.584032 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,721 | mongodb.py | searx_searx/searx/engines/mongodb.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
MongoDB engine (Offline)
"""
# pylint: disable=missing-function-docstring
# pylint: disable=import-error
import re
from pymongo import MongoClient
engine_type = 'offline'
paging = True
# mongodb connection variables
host = '127.0.0.1'
port = 27017
username = ''
passw... | 1,325 | Python | .py | 51 | 21.941176 | 83 | 0.638449 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,722 | google_images.py | searx_searx/searx/engines/google_images.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""Google (Images)
For detailed description of the *REST-full* API see: `Query Parameter
Definitions`_.
.. _admonition:: Content-Security-Policy (CSP)
This engine needs to allow images from the `data URLs`_ (prefixed with the
``data:` scheme).::
Header set Con... | 6,740 | Python | .py | 173 | 32.554913 | 119 | 0.60821 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,723 | xpath.py | searx_searx/searx/engines/xpath.py | # SPDX-License-Identifier: AGPL-3.0-or-later
from lxml import html
from urllib.parse import urlencode
from searx.utils import extract_text, extract_url, eval_xpath, eval_xpath_list
search_url = None
lang_all = 'en'
url_xpath = None
content_xpath = None
title_xpath = None
thumbnail_xpath = False
paging = False
suggest... | 5,371 | Python | .py | 140 | 31.385714 | 102 | 0.616288 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,724 | wolframalpha_api.py | searx_searx/searx/engines/wolframalpha_api.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wolfram|Alpha (Science)
"""
from lxml import etree
from urllib.parse import urlencode
# about
about = {
"website": 'https://www.wolframalpha.com',
"wikidata_id": 'Q207006',
"official_api_documentation": 'https://products.wolframalpha.com/api/',
"use_of... | 4,301 | Python | .py | 104 | 32.865385 | 98 | 0.592513 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,725 | yggtorrent.py | searx_searx/searx/engines/yggtorrent.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Yggtorrent (Videos, Music, Files)
"""
from lxml import html
from operator import itemgetter
from datetime import datetime
from urllib.parse import quote
from searx.utils import extract_text, get_torrent_size
from searx.poolrequests import get as http_get
# about
about... | 3,573 | Python | .py | 103 | 26.368932 | 100 | 0.584035 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,726 | rumble.py | searx_searx/searx/engines/rumble.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Rumble (Videos)
"""
from urllib.parse import urlencode
from lxml import html
from datetime import datetime
# about
from searx.utils import extract_text
about = {
"website": 'https://rumble.com/',
"wikidata_id": 'Q104765127',
"official_api_documentation": '... | 2,803 | Python | .py | 69 | 35.028986 | 93 | 0.646216 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,727 | ahmia.py | searx_searx/searx/engines/ahmia.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Ahmia (Onions)
"""
from urllib.parse import urlencode, urlparse, parse_qs
from lxml.html import fromstring
from searx.engines.xpath import extract_url, extract_text, eval_xpath_list, eval_xpath
# about
about = {
"website": 'http://juhanurmihxlp77nkq76byazcldy2hlmo... | 2,669 | Python | .py | 67 | 33.985075 | 100 | 0.657508 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,728 | deezer.py | searx_searx/searx/engines/deezer.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Deezer (Music)
"""
from json import loads
from urllib.parse import urlencode
# about
about = {
"website": 'https://deezer.com',
"wikidata_id": 'Q602243',
"official_api_documentation": 'https://developers.deezer.com/',
"use_official_api": True,
"req... | 1,781 | Python | .py | 52 | 26.961538 | 84 | 0.579193 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,729 | bing_news.py | searx_searx/searx/engines/bing_news.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Bing (News)
"""
from datetime import datetime
from dateutil import parser
from urllib.parse import urlencode, urlparse, parse_qsl
from lxml import etree
from lxml.etree import XPath
from searx.utils import match_language, eval_xpath_getindex
from searx.engines.bing imp... | 4,331 | Python | .py | 106 | 33.216981 | 122 | 0.628333 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,730 | gentoo.py | searx_searx/searx/engines/gentoo.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Gentoo Wiki
"""
from urllib.parse import urlencode, urljoin
from lxml import html
from searx.utils import extract_text
# about
about = {
"website": 'https://wiki.gentoo.org/',
"wikidata_id": 'Q1050637',
"official_api_documentation": 'https://wiki.gentoo.or... | 3,541 | Python | .py | 103 | 28.679612 | 77 | 0.633643 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,731 | tvmaze.py | searx_searx/searx/engines/tvmaze.py | """
TVmaze
Show Search
"""
from urllib.parse import urlencode
from json import loads
from searx.utils import html_to_text
# about
about = {
"website": 'https://www.tvmaze.com/',
"wikidata_id": 'Q84863617',
"official_api_documentation": 'https://www.tvmaze.com/api',
"use_official_api": True,
"r... | 967 | Python | .py | 36 | 22.25 | 64 | 0.632497 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,732 | bandcamp.py | searx_searx/searx/engines/bandcamp.py | """
Bandcamp (Music)
@website https://bandcamp.com/
@provide-api no
@results HTML
@parse url, title, content, publishedDate, embedded, thumbnail
"""
from urllib.parse import urlencode, urlparse, parse_qs
from dateutil.parser import parse as dateparse
from lxml import html
from searx.utils import extract... | 2,450 | Python | .py | 62 | 33.564516 | 156 | 0.636517 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,733 | dummy-offline.py | searx_searx/searx/engines/dummy-offline.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Dummy Offline
"""
# about
about = {
"wikidata_id": None,
"official_api_documentation": None,
"use_official_api": False,
"require_api_key": False,
"results": 'HTML',
}
def search(query, request_params):
return [{
'result': 'this is wha... | 339 | Python | .py | 16 | 17.625 | 44 | 0.630094 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,734 | yacy.py | searx_searx/searx/engines/yacy.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Yacy (Web, Images, Videos, Music, Files)
"""
from json import loads
from dateutil import parser
from urllib.parse import urlencode
from requests.auth import HTTPDigestAuth
from searx.utils import html_to_text
# about
about = {
"website": 'https://yacy.net/',
... | 3,294 | Python | .py | 88 | 28.056818 | 85 | 0.566038 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,735 | elasticsearch.py | searx_searx/searx/engines/elasticsearch.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Elasticsearch
"""
from json import loads, dumps
from requests.auth import HTTPBasicAuth
from searx.exceptions import SearxEngineAPIException
base_url = 'http://localhost:9200'
username = ''
password = ''
index = ''
search_url = base_url + '/' + index + '/_search'
que... | 4,241 | Python | .py | 106 | 34.273585 | 113 | 0.661621 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,736 | photon.py | searx_searx/searx/engines/photon.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Photon (Map)
"""
from json import loads
from urllib.parse import urlencode
from searx.utils import searx_useragent
# about
about = {
"website": 'https://photon.komoot.de',
"wikidata_id": None,
"official_api_documentation": 'https://photon.komoot.de/',
... | 4,162 | Python | .py | 107 | 27.271028 | 78 | 0.519484 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,737 | wikipedia.py | searx_searx/searx/engines/wikipedia.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wikipedia (Web)
"""
from urllib.parse import quote
from json import loads
from lxml.html import fromstring
from searx.utils import match_language, searx_useragent
from searx.raise_for_httperror import raise_for_httperror
# about
about = {
"website": 'https://www.w... | 3,509 | Python | .py | 87 | 33.195402 | 101 | 0.614773 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,738 | dummy.py | searx_searx/searx/engines/dummy.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Dummy
"""
# about
about = {
"website": None,
"wikidata_id": None,
"official_api_documentation": None,
"use_official_api": False,
"require_api_key": False,
"results": 'empty array',
}
# do search-request
def request(query, params):
return p... | 397 | Python | .py | 19 | 17.894737 | 44 | 0.678284 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,739 | omnom.py | searx_searx/searx/engines/omnom.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Omnom (General)
"""
from json import loads
from urllib.parse import urlencode
# about
about = {
"website": 'https://github.com/asciimoo/omnom',
"wikidata_id": None,
"official_api_documentation": 'http://your.omnom.host/api',
"use_official_api": True,
... | 1,239 | Python | .py | 44 | 23 | 63 | 0.616554 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,740 | dictzone.py | searx_searx/searx/engines/dictzone.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Dictzone
"""
from urllib.parse import urljoin
from lxml import html
from searx.utils import eval_xpath
# about
about = {
"website": 'https://dictzone.com/',
"wikidata_id": None,
"official_api_documentation": None,
"use_official_api": False,
"requir... | 1,458 | Python | .py | 46 | 25.326087 | 117 | 0.598712 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,741 | error_recorder.py | searx_searx/searx/metrology/error_recorder.py | import typing
import inspect
import logging
from json import JSONDecodeError
from urllib.parse import urlparse
from requests.exceptions import RequestException
from searx.exceptions import (SearxXPathSyntaxException, SearxEngineXPathException, SearxEngineAPIException,
SearxEngineAccessDeni... | 5,430 | Python | .py | 116 | 40.034483 | 119 | 0.683125 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,742 | shared_uwsgi.py | searx_searx/searx/shared/shared_uwsgi.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import time
import uwsgi # pylint: disable=E0401
from . import shared_abstract
_last_signal = 10
class UwsgiCacheSharedDict(shared_abstract.SharedDict):
def get_int(self, key):
value = uwsgi.cache_get(key)
if value is None:
return value... | 1,689 | Python | .py | 50 | 25.7 | 79 | 0.606769 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,743 | shared_simple.py | searx_searx/searx/shared/shared_simple.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import threading
from . import shared_abstract
class SimpleSharedDict(shared_abstract.SharedDict):
__slots__ = 'd',
def __init__(self):
self.d = {}
def get_int(self, key):
return self.d.get(key, None)
def set_int(self, key, value):
... | 714 | Python | .py | 25 | 22.2 | 51 | 0.604444 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,744 | shared_abstract.py | searx_searx/searx/shared/shared_abstract.py | # SPDX-License-Identifier: AGPL-3.0-or-later
from abc import ABC, abstractmethod
class SharedDict(ABC):
@abstractmethod
def get_int(self, key):
pass
@abstractmethod
def set_int(self, key, value):
pass
@abstractmethod
def get_str(self, key):
pass
@abstractmethod
... | 368 | Python | .py | 15 | 18.866667 | 44 | 0.657061 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,745 | __init__.py | searx_searx/searx/shared/__init__.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import logging
logger = logging.getLogger('searx.shared')
try:
import uwsgi
except:
# no uwsgi
from .shared_simple import SimpleSharedDict as SharedDict, schedule
logger.info('Use shared_simple implementation')
else:
try:
uwsgi.cache_update('du... | 995 | Python | .py | 26 | 31.5 | 95 | 0.688797 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,746 | infinite_scroll.py | searx_searx/searx/plugins/infinite_scroll.py | from flask_babel import gettext
name = gettext('Infinite scroll')
description = gettext('Automatically load next page when scrolling to bottom of current page')
default_on = False
preference_section = 'ui'
js_dependencies = ('plugins/js/infinite_scroll.js',)
css_dependencies = ('plugins/css/infinite_scroll.css',)
| 317 | Python | .py | 7 | 44 | 94 | 0.788961 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,747 | oa_doi_rewrite.py | searx_searx/searx/plugins/oa_doi_rewrite.py | from urllib.parse import urlparse, parse_qsl
from flask_babel import gettext
import re
from searx import settings
regex = re.compile(r'10\.\d{4,9}/[^\s]+')
name = gettext('Open Access DOI rewrite')
description = gettext('Avoid paywalls by redirecting to open-access versions of publications when available')
default_o... | 1,500 | Python | .py | 37 | 35.027027 | 109 | 0.676309 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,748 | search_on_category_select.py | searx_searx/searx/plugins/search_on_category_select.py | '''
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 WA... | 1,014 | Python | .py | 20 | 48.4 | 85 | 0.777778 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,749 | hostname_replace.py | searx_searx/searx/plugins/hostname_replace.py | import re
from urllib.parse import urlunparse
from searx import settings
from searx.plugins import logger
from flask_babel import gettext
name = gettext('Hostname replace')
description = gettext('Rewrite result hostnames')
default_on = False
preference_section = 'general'
plugin_id = 'hostname_replace'
parsed = 'pars... | 853 | Python | .py | 21 | 36.809524 | 108 | 0.740606 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,750 | hash_plugin.py | searx_searx/searx/plugins/hash_plugin.py | '''
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 WA... | 1,684 | Python | .py | 42 | 36.428571 | 75 | 0.722086 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,751 | search_operators.py | searx_searx/searx/plugins/search_operators.py | import shlex
import string
from flask_babel import gettext
name = gettext("Search operators")
description = gettext("""Filter results using hyphen, site: and -site:.
Please note that you might get less results with the additional filtering.""")
default_on = False
def on_result(request, search, result):
q = sear... | 1,331 | Python | .py | 32 | 36.59375 | 78 | 0.668726 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,752 | self_info.py | searx_searx/searx/plugins/self_info.py | '''
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 WA... | 1,646 | Python | .py | 37 | 40.702703 | 118 | 0.729089 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,753 | vim_hotkeys.py | searx_searx/searx/plugins/vim_hotkeys.py | from flask_babel import gettext
name = gettext('Vim-like hotkeys')
description = gettext('Navigate search results with Vim-like hotkeys '
'(JavaScript required). '
'Press "h" key on main or result page to get help.')
default_on = False
preference_section = 'ui'
js_dependenc... | 409 | Python | .py | 9 | 39.333333 | 74 | 0.675879 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,754 | __init__.py | searx_searx/searx/plugins/__init__.py | '''
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 WA... | 6,682 | Python | .py | 153 | 34.705882 | 119 | 0.638059 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,755 | ahmia_filter.py | searx_searx/searx/plugins/ahmia_filter.py | '''
SPDX-License-Identifier: AGPL-3.0-or-later
'''
from hashlib import md5
from searx.data import ahmia_blacklist_loader
name = "Ahmia blacklist"
description = "Filter out onion results that appear in Ahmia's blacklist. (See https://ahmia.fi/blacklist)"
default_on = True
preference_section = 'onions'
ahmia_blacklis... | 944 | Python | .py | 24 | 35.75 | 107 | 0.751921 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,756 | https_rewrite.py | searx_searx/searx/plugins/https_rewrite.py | '''
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 WA... | 7,152 | Python | .py | 180 | 30.411111 | 76 | 0.602255 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,757 | tracker_url_remover.py | searx_searx/searx/plugins/tracker_url_remover.py | '''
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 WA... | 1,776 | Python | .py | 41 | 37.707317 | 99 | 0.685432 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,758 | __init__.py | searx_searx/searx/answerers/__init__.py | from os import listdir
from os.path import realpath, dirname, join, isdir
from searx.utils import load_module
from collections import defaultdict
answerers_dir = dirname(realpath(__file__))
def load_answerers():
answerers = []
for filename in listdir(answerers_dir):
if not isdir(join(answerers_dir, ... | 1,370 | Python | .py | 34 | 33.882353 | 113 | 0.700151 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,759 | answerer.py | searx_searx/searx/answerers/statistics/answerer.py | from functools import reduce
from operator import mul
from flask_babel import gettext
keywords = ('min',
'max',
'avg',
'sum',
'prod')
# required answerer function
# can return a list of results (any result type) for a given query
def answer(query):
parts = query.... | 1,162 | Python | .py | 39 | 23.333333 | 112 | 0.590991 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,760 | answerer.py | searx_searx/searx/answerers/random/answerer.py | import hashlib
import random
import string
import uuid
from flask_babel import gettext
# required answerer attribute
# specifies which search query keywords triggers this answerer
keywords = ('random',)
random_int_max = 2**31
random_string_letters = string.ascii_lowercase + string.digits + string.ascii_uppercase
de... | 1,604 | Python | .py | 45 | 30.422222 | 87 | 0.679245 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,761 | models.py | searx_searx/searx/search/models.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import typing
class EngineRef:
__slots__ = 'name', 'category'
def __init__(self, name: str, category: str):
self.name = name
self.category = category
def __repr__(self):
return "EngineRef({!r}, {!r})".format(self.name, self.category)... | 2,603 | Python | .py | 55 | 36.818182 | 118 | 0.590837 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,762 | __init__.py | searx_searx/searx/search/__init__.py | '''
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 WA... | 7,663 | Python | .py | 166 | 37.427711 | 108 | 0.66255 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,763 | offline.py | searx_searx/searx/search/processors/offline.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import threading
from time import time
from searx import logger
from searx.metrology.error_recorder import record_exception, record_error
from searx.search.processors.abstract import EngineProcessor
logger = logger.getChild('search.processor.offline')
class OfflineProce... | 2,039 | Python | .py | 38 | 43.578947 | 98 | 0.657948 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,764 | __init__.py | searx_searx/searx/search/processors/__init__.py | # SPDX-License-Identifier: AGPL-3.0-or-later
from .online import OnlineProcessor
from .offline import OfflineProcessor
from .online_dictionary import OnlineDictionaryProcessor
from .online_currency import OnlineCurrencyProcessor
from .abstract import EngineProcessor
from searx import logger
import searx.engines as eng... | 1,374 | Python | .py | 32 | 37.6875 | 101 | 0.745686 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,765 | online_dictionary.py | searx_searx/searx/search/processors/online_dictionary.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import re
from searx.utils import is_valid_lang
from .online import OnlineProcessor
parser_re = re.compile('.*?([a-z]+)-([a-z]+) (.+)$', re.I)
class OnlineDictionaryProcessor(OnlineProcessor):
engine_type = 'online_dictionary'
def get_params(self, search_query... | 1,494 | Python | .py | 38 | 29.184211 | 83 | 0.553472 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,766 | online.py | searx_searx/searx/search/processors/online.py | # SPDX-License-Identifier: AGPL-3.0-or-later
from urllib.parse import urlparse
from time import time
import threading
import requests.exceptions
import searx.poolrequests as poolrequests
from searx.engines import settings
from searx import logger
from searx.utils import gen_useragent
from searx.exceptions import (Se... | 10,741 | Python | .py | 218 | 36.5 | 112 | 0.57957 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,767 | online_currency.py | searx_searx/searx/search/processors/online_currency.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import unicodedata
import re
from searx.data import CURRENCIES
from .online import OnlineProcessor
parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I)
def normalize_name(name):
name = name.lower().replace('-', ' ').rstrip('s')
... | 1,877 | Python | .py | 49 | 31.102041 | 85 | 0.622235 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,768 | abstract.py | searx_searx/searx/search/processors/abstract.py | # SPDX-License-Identifier: AGPL-3.0-or-later
from abc import abstractmethod, ABC
from searx import logger
logger = logger.getChild('searx.search.processor')
class EngineProcessor(ABC):
def __init__(self, engine, engine_name):
self.engine = engine
self.engine_name = engine_name
def get_par... | 1,609 | Python | .py | 39 | 32.74359 | 82 | 0.641618 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,769 | __main__.py | searx_searx/searx/search/checker/__main__.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import sys
import io
import os
import argparse
import logging
import searx.search
import searx.search.checker
from searx.search import processors
from searx.engines import engine_shortcuts
# configure logging
root = logging.getLogger()
handler = logging.StreamHandler(sys... | 3,703 | Python | .py | 81 | 37.580247 | 119 | 0.621951 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,770 | background.py | searx_searx/searx/search/checker/background.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import json
import random
import time
import threading
import os
import signal
from searx import logger, settings, searx_debug
from searx.exceptions import SearxSettingsException
from searx.search.processors import processors
from searx.search.checker import Checker
from s... | 3,708 | Python | .py | 97 | 32.061856 | 99 | 0.664527 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,771 | __init__.py | searx_searx/searx/search/checker/__init__.py | # SPDX-License-Identifier: AGPL-3.0-or-later
from .impl import Checker
from .background import initialize, get_result
| 119 | Python | .py | 3 | 38.333333 | 46 | 0.817391 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,772 | impl.py | searx_searx/searx/search/checker/impl.py | # SPDX-License-Identifier: AGPL-3.0-or-later
import typing
import types
import functools
import itertools
import threading
from time import time
from urllib.parse import urlparse
import re
from langdetect import detect_langs
from langdetect.lang_detect_exception import LangDetectException
import requests.exceptions
... | 16,146 | Python | .py | 338 | 37.446746 | 118 | 0.592244 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,773 | basic_engine.py | searx_searx/examples/basic_engine.py |
categories = ['general'] # optional
def request(query, params):
'''pre-request callback
params<dict>:
method : POST/GET
headers : {}
data : {} # if method == POST
url : ''
category: 'search category'
pageno : 1 # number of the requested page
'''
params['... | 521 | Python | .py | 18 | 23.555556 | 52 | 0.572581 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,774 | build_env.py | searx_searx/utils/build_env.py | # SPDX-License-Identifier: AGPL-3.0-or-later
"""build environment used by shell scripts
"""
# set path
import sys
import os
from os.path import realpath, dirname, join, sep, abspath
repo_root = realpath(dirname(realpath(__file__)) + sep + '..')
sys.path.insert(0, repo_root)
os.environ['SEARX_SETTINGS_PATH'] = abspath... | 1,357 | Python | .py | 31 | 41 | 85 | 0.620167 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,775 | conf.py | searx_searx/docs/conf.py | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: AGPL-3.0-or-later
import sys, os
from pallets_sphinx_themes import ProjectLink
from searx import brand
from searx.version import VERSION_STRING
# Project --------------------------------------------------------------
project = u'searx'
copyright = u'2015-2022, Ada... | 4,736 | Python | .py | 108 | 41.305556 | 96 | 0.656895 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,776 | test_webapp.py | searx_searx/tests/unit/test_webapp.py | # -*- coding: utf-8 -*-
import json
from urllib.parse import ParseResult
from mock import Mock
from searx.testing import SearxTestCase
from searx.search import Search
import searx.engines
class ViewsTestCase(SearxTestCase):
def setUp(self):
# skip init function (no external HTTP request)
self.se... | 9,504 | Python | .py | 204 | 34.294118 | 135 | 0.554991 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,777 | test_external_bangs.py | searx_searx/tests/unit/test_external_bangs.py | from searx.external_bang import get_node, resolve_bang_definition, get_bang_url, get_bang_definition_and_autocomplete
from searx.search import SearchQuery, EngineRef
from searx.testing import SearxTestCase
TEST_DB = {
'trie': {
'exam': {
'ple': '//example.com/' + chr(2) + chr(1) + '0',
... | 4,460 | Python | .py | 91 | 40.384615 | 118 | 0.62123 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,778 | test_standalone_searx.py | searx_searx/tests/unit/test_standalone_searx.py | # -*- coding: utf-8 -*-
"""Test utils/standalone_searx.py"""
import datetime
import io
import sys
from mock import Mock, patch
from nose2.tools import params
from searx.search import SearchQuery, EngineRef, initialize
from searx.testing import SearxTestCase
from searx_extra import standalone_searx as sas
class Stan... | 3,816 | Python | .py | 97 | 27.958763 | 89 | 0.518758 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,779 | test_results.py | searx_searx/tests/unit/test_results.py | # -*- coding: utf-8 -*-
from searx.results import ResultContainer
from searx.testing import SearxTestCase
def fake_result(url='https://aa.bb/cc?dd=ee#ff',
title='aaa',
content='bbb',
engine='wikipedia', **kwargs):
result = {'url': url,
'title': title,... | 1,253 | Python | .py | 32 | 30.9375 | 86 | 0.608911 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,780 | test_search.py | searx_searx/tests/unit/test_search.py | # -*- coding: utf-8 -*-
from searx.testing import SearxTestCase
from searx.search import SearchQuery, EngineRef
import searx.search
SAFESEARCH = 0
PAGENO = 1
PUBLIC_ENGINE_NAME = 'general dummy'
TEST_ENGINES = [
{
'name': PUBLIC_ENGINE_NAME,
'engine': 'dummy',
'categories': 'general',
... | 3,960 | Python | .py | 82 | 37.231707 | 115 | 0.595855 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,781 | test_utils.py | searx_searx/tests/unit/test_utils.py | # -*- coding: utf-8 -*-
import lxml.etree
from lxml import html
from searx.testing import SearxTestCase
from searx.exceptions import SearxXPathSyntaxException, SearxEngineXPathException
from searx import utils
class TestUtils(SearxTestCase):
def test_gen_useragent(self):
self.assertIsInstance(utils.gen_... | 9,618 | Python | .py | 183 | 42.759563 | 119 | 0.619951 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,782 | test_poolrequests.py | searx_searx/tests/unit/test_poolrequests.py | from unittest.mock import patch
from requests.models import Response
from searx.testing import SearxTestCase
import searx.poolrequests
from searx.poolrequests import get_proxy_cycles, get_proxies
CONFIG = {'http': ['http://localhost:9090', 'http://localhost:9092'],
'https': ['http://localhost:9091', 'http... | 3,591 | Python | .py | 73 | 40.438356 | 115 | 0.641633 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,783 | test_webutils.py | searx_searx/tests/unit/test_webutils.py | # -*- coding: utf-8 -*-
import mock
from searx.testing import SearxTestCase
from searx import webutils
class TestWebUtils(SearxTestCase):
def test_prettify_url(self):
data = (('https://searx.me/', 'https://searx.me/'),
('https://searx.me/ű', 'https://searx.me/ű'),
('https:... | 3,504 | Python | .py | 71 | 38.408451 | 108 | 0.600824 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,784 | test_query.py | searx_searx/tests/unit/test_query.py | from mock import patch
from searx.search import initialize
from searx.query import RawTextQuery
from searx.testing import SearxTestCase
import searx.engines
TEST_ENGINES = [
{
'name': 'dummy engine',
'engine': 'dummy',
'categories': 'general',
'shortcut': 'du',
'timeout':... | 10,561 | Python | .py | 222 | 38.716216 | 99 | 0.64196 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,785 | test_plugins.py | searx_searx/tests/unit/test_plugins.py | # -*- coding: utf-8 -*-
from searx.testing import SearxTestCase
from searx import plugins
from mock import Mock
def get_search_mock(query, **kwargs):
return Mock(search_query=Mock(query=query, **kwargs),
result_container=Mock(answers=dict()))
class PluginStoreTest(SearxTestCase):
def test_... | 5,891 | Python | .py | 103 | 47.378641 | 111 | 0.668463 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,786 | test_settings_loader.py | searx_searx/tests/unit/test_settings_loader.py | # SPDX-License-Identifier: AGPL-3.0-or-later
from os.path import dirname, join, abspath
from unittest.mock import patch
from searx.testing import SearxTestCase
from searx.exceptions import SearxSettingsException
from searx import settings_loader
test_dir = abspath(dirname(__file__))
class TestLoad(SearxTestCase):... | 6,679 | Python | .py | 99 | 56.656566 | 115 | 0.669666 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,787 | test_engines_init.py | searx_searx/tests/unit/test_engines_init.py | from searx.testing import SearxTestCase
from searx import settings, engines
class TestEnginesInit(SearxTestCase):
@classmethod
def tearDownClass(cls):
settings['outgoing']['using_tor_proxy'] = False
settings['outgoing']['extra_proxy_timeout'] = 0
def test_initialize_engines_default(self)... | 2,066 | Python | .py | 35 | 49.285714 | 105 | 0.631553 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,788 | test_webadapter.py | searx_searx/tests/unit/test_webadapter.py | # -*- coding: utf-8 -*-
from searx.testing import SearxTestCase
from searx.preferences import Preferences
from searx.engines import engines
import searx.search
from searx.search import EngineRef
from searx.webadapter import validate_engineref_list
PRIVATE_ENGINE_NAME = 'general private offline'
TEST_ENGINES = [
... | 1,978 | Python | .py | 44 | 38.545455 | 101 | 0.68763 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,789 | test_preferences.py | searx_searx/tests/unit/test_preferences.py | from searx.preferences import (EnumStringSetting, MapSetting, MissingArgumentException, SearchLanguageSetting,
MultipleChoiceSetting, PluginsSetting, ValidationException)
from searx.testing import SearxTestCase
class PluginStub:
def __init__(self, plugin_id, default_on):
se... | 6,329 | Python | .py | 111 | 48.234234 | 120 | 0.683471 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,790 | test_answerers.py | searx_searx/tests/unit/test_answerers.py | # -*- coding: utf-8 -*-
from mock import Mock
from searx.answerers import answerers
from searx.testing import SearxTestCase
class AnswererTest(SearxTestCase):
def test_unicode_input(self):
query = Mock()
unicode_payload = 'árvíztűrő tükörfúrógép'
for answerer in answerers:
q... | 466 | Python | .py | 11 | 35.363636 | 79 | 0.70068 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,791 | test_xpath.py | searx_searx/tests/unit/engines/test_xpath.py | # -*- coding: utf-8 -*-
from collections import defaultdict
import mock
from searx.engines import xpath
from searx.testing import SearxTestCase
class TestXpathEngine(SearxTestCase):
def test_request(self):
xpath.search_url = 'https://url.com/{query}'
xpath.categories = []
xpath.paging = F... | 5,218 | Python | .py | 105 | 40.466667 | 86 | 0.618403 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,792 | test_command.py | searx_searx/tests/unit/engines/test_command.py | '''
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 WA... | 9,670 | Python | .py | 213 | 32.685446 | 100 | 0.545657 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,793 | __init__.py | searx_searx/tests/robot/__init__.py | # -*- coding: utf-8 -*-
from time import sleep
url = "http://localhost:11111/"
def test_index(browser):
# Visit URL
browser.visit(url)
assert browser.is_text_present('searx')
def test_404(browser):
# Visit URL
browser.visit(url + 'missing_link')
assert browser.is_text_present('Page not fou... | 2,265 | Python | .py | 50 | 40.48 | 98 | 0.69826 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,794 | google_search.py | searx_searx/searx_extra/google_search.py | from sys import argv, exit
if not len(argv) > 1:
print('search query required')
exit(1)
import requests
from json import dumps
from searx.engines import google
from searx.search import default_request_params
request_params = default_request_params()
# Possible params
# request_params['headers']['User-Agent']... | 877 | Python | .py | 28 | 29.071429 | 49 | 0.730404 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,795 | standalone_searx.py | searx_searx/searx_extra/standalone_searx.py | #!/usr/bin/env python
"""Script to run searx from terminal.
Getting categories without initiate the engine will only return `['general']`
>>> import searx.engines
... list(searx.engines.categories.keys())
['general']
>>> import searx.search
... searx.search.initialize()
... list(searx.engines.categories.keys())
['gen... | 7,479 | Python | .py | 188 | 34.367021 | 149 | 0.664142 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,796 | update_engine_descriptions.py | searx_searx/searx_extra/update/update_engine_descriptions.py | #!/usr/bin/env python
import sys
import json
from urllib.parse import quote, urlparse
import detect_language
from lxml.html import fromstring
from searx.engines.wikidata import send_wikidata_query
from searx.utils import extract_text
import searx
import searx.search
import searx.poolrequests
SPARQL_WIKIPEDIA_ARTICLE... | 7,345 | Python | .py | 166 | 37.006024 | 103 | 0.645667 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,797 | update_wikidata_units.py | searx_searx/searx_extra/update/update_wikidata_units.py | #!/usr/bin/env python
import json
import collections
# set path
from os.path import join
from searx import searx_dir
from searx.engines.wikidata import send_wikidata_query
# the response contains duplicate ?item with the different ?symbol
# "ORDER BY ?item DESC(?rank) ?symbol" provides a deterministic result
# eve... | 1,581 | Python | .py | 43 | 33.372093 | 105 | 0.709234 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,798 | update_languages.py | searx_searx/searx_extra/update/update_languages.py | #!/usr/bin/env python
# This script generates languages.py from intersecting each engine's supported languages.
#
# Output files: searx/data/engines_languages.json and searx/languages.py
import json
from pathlib import Path
from pprint import pformat
from babel import Locale, UnknownLocaleError
from babel.languages i... | 8,559 | Python | .py | 164 | 40.506098 | 102 | 0.617189 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |
31,799 | update_pygments.py | searx_searx/searx_extra/update/update_pygments.py | #!/usr/bin/env python
"""
Update pygments style
Call this script after each upgrade of pygments
"""
# pylint: disable=C0116
# set path
from os.path import join
import pygments
from pygments.formatters import HtmlFormatter # pylint: disable=E0611
from pygments.style import Style
from pygments.token import Comment, E... | 4,754 | Python | .py | 116 | 34.318966 | 140 | 0.589332 | searx/searx | 13,357 | 1,707 | 340 | AGPL-3.0 | 9/5/2024, 5:14:30 PM (Europe/Amsterdam) |