.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.data Namespace Reference

Namespaces

namespace  core
namespace  currencies
namespace  tracker_patterns

Functions

 __getattr__ (name)
 ahmia_blacklist_loader ()

Variables

list __all__ = ["ahmia_blacklist_loader"]
dict USER_AGENTS [str, typing.Any]
dict EXTERNAL_URLS [str, typing.Any]
dict WIKIDATA_UNITS [str, typing.Any]
dict EXTERNAL_BANGS [str, typing.Any]
dict OSM_KEYS_TAGS [str, typing.Any]
dict ENGINE_DESCRIPTIONS [str, typing.Any]
dict ENGINE_TRAITS [str, typing.Any]
dict LOCALES [str, typing.Any]
dict lazy_globals
dict data_json_files

Detailed Description

This module holds the *data* created by::

  make data.all

Function Documentation

◆ __getattr__()

searx.data.__getattr__ ( name)

Definition at line 54 of file __init__.py.

54def __getattr__(name):
55 # lazy init of the global objects
56 if name not in lazy_globals:
57 raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
58
59 data = lazy_globals[name]
60 if data is not None:
61 return data
62
63 log.debug("init searx.data.%s", name)
64
65 with open(data_dir / data_json_files[name], encoding='utf-8') as f:
66 lazy_globals[name] = json.load(f)
67
68 return lazy_globals[name]
69
70

◆ ahmia_blacklist_loader()

searx.data.ahmia_blacklist_loader ( )
Load data from `ahmia_blacklist.txt` and return a list of MD5 values of onion
names.  The MD5 values are fetched by::

  searxng_extra/update/update_ahmia_blacklist.py

This function is used by :py:mod:`searx.plugins.ahmia_filter`.

Definition at line 71 of file __init__.py.

71def ahmia_blacklist_loader():
72 """Load data from `ahmia_blacklist.txt` and return a list of MD5 values of onion
73 names. The MD5 values are fetched by::
74
75 searxng_extra/update/update_ahmia_blacklist.py
76
77 This function is used by :py:mod:`searx.plugins.ahmia_filter`.
78
79 """
80 with open(data_dir / 'ahmia_blacklist.txt', encoding='utf-8') as f:
81 return f.read().split()

Variable Documentation

◆ __all__

list searx.data.__all__ = ["ahmia_blacklist_loader"]
private

Definition at line 9 of file __init__.py.

◆ data_json_files

dict searx.data.data_json_files
Initial value:
1= {
2 "USER_AGENTS": "useragents.json",
3 "EXTERNAL_URLS": "external_urls.json",
4 "WIKIDATA_UNITS": "wikidata_units.json",
5 "EXTERNAL_BANGS": "external_bangs.json",
6 "OSM_KEYS_TAGS": "osm_keys_tags.json",
7 "ENGINE_DESCRIPTIONS": "engine_descriptions.json",
8 "ENGINE_TRAITS": "engine_traits.json",
9 "LOCALES": "locales.json",
10}

Definition at line 42 of file __init__.py.

◆ ENGINE_DESCRIPTIONS

dict searx.data.ENGINE_DESCRIPTIONS [str, typing.Any]

Definition at line 24 of file __init__.py.

◆ ENGINE_TRAITS

dict searx.data.ENGINE_TRAITS [str, typing.Any]

Definition at line 25 of file __init__.py.

◆ EXTERNAL_BANGS

dict searx.data.EXTERNAL_BANGS [str, typing.Any]

Definition at line 22 of file __init__.py.

◆ EXTERNAL_URLS

dict searx.data.EXTERNAL_URLS [str, typing.Any]

Definition at line 20 of file __init__.py.

◆ lazy_globals

dict searx.data.lazy_globals
Initial value:
1= {
2 "CURRENCIES": CurrenciesDB(),
3 "USER_AGENTS": None,
4 "EXTERNAL_URLS": None,
5 "WIKIDATA_UNITS": None,
6 "EXTERNAL_BANGS": None,
7 "OSM_KEYS_TAGS": None,
8 "ENGINE_DESCRIPTIONS": None,
9 "ENGINE_TRAITS": None,
10 "LOCALES": None,
11 "TRACKER_PATTERNS": TrackerPatternsDB(),
12}

Definition at line 29 of file __init__.py.

◆ LOCALES

dict searx.data.LOCALES [str, typing.Any]

Definition at line 26 of file __init__.py.

◆ OSM_KEYS_TAGS

dict searx.data.OSM_KEYS_TAGS [str, typing.Any]

Definition at line 23 of file __init__.py.

◆ USER_AGENTS

dict searx.data.USER_AGENTS [str, typing.Any]

Definition at line 19 of file __init__.py.

◆ WIKIDATA_UNITS

dict searx.data.WIKIDATA_UNITS [str, typing.Any]

Definition at line 21 of file __init__.py.