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

Namespaces

namespace  core
 
namespace  currencies
 

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 51 of file __init__.py.

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

◆ 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 68 of file __init__.py.

68def ahmia_blacklist_loader():
69 """Load data from `ahmia_blacklist.txt` and return a list of MD5 values of onion
70 names. The MD5 values are fetched by::
71
72 searxng_extra/update/update_ahmia_blacklist.py
73
74 This function is used by :py:mod:`searx.plugins.ahmia_filter`.
75
76 """
77 with open(data_dir / 'ahmia_blacklist.txt', encoding='utf-8') as f:
78 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 39 of file __init__.py.

◆ ENGINE_DESCRIPTIONS

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

Definition at line 23 of file __init__.py.

◆ ENGINE_TRAITS

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

Definition at line 24 of file __init__.py.

◆ EXTERNAL_BANGS

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

Definition at line 21 of file __init__.py.

◆ EXTERNAL_URLS

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

Definition at line 19 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}

Definition at line 27 of file __init__.py.

◆ LOCALES

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

Definition at line 25 of file __init__.py.

◆ OSM_KEYS_TAGS

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

Definition at line 22 of file __init__.py.

◆ USER_AGENTS

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

Definition at line 18 of file __init__.py.

◆ WIKIDATA_UNITS

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

Definition at line 20 of file __init__.py.