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

Functions

 _load (filename)
 
 ahmia_blacklist_loader ()
 

Variables

list __all__
 
 data_dir = Path(__file__).parent
 
 CURRENCIES = _load('currencies.json')
 
 USER_AGENTS = _load('useragents.json')
 
 EXTERNAL_URLS = _load('external_urls.json')
 
 WIKIDATA_UNITS = _load('wikidata_units.json')
 
 EXTERNAL_BANGS = _load('external_bangs.json')
 
 OSM_KEYS_TAGS = _load('osm_keys_tags.json')
 
 ENGINE_DESCRIPTIONS = _load('engine_descriptions.json')
 
 ENGINE_TRAITS = _load('engine_traits.json')
 
 LOCALES = _load('locales.json')
 

Detailed Description

This module holds the *data* created by::

  make data.all

Function Documentation

◆ _load()

searx.data._load ( filename)
protected

Definition at line 27 of file __init__.py.

27def _load(filename):
28 with open(data_dir / filename, encoding='utf-8') as f:
29 return json.load(f)
30
31

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

32def ahmia_blacklist_loader():
33 """Load data from `ahmia_blacklist.txt` and return a list of MD5 values of onion
34 names. The MD5 values are fetched by::
35
36 searxng_extra/update/update_ahmia_blacklist.py
37
38 This function is used by :py:mod:`searx.plugins.ahmia_filter`.
39
40 """
41 with open(data_dir / 'ahmia_blacklist.txt', encoding='utf-8') as f:
42 return f.read().split()
43
44

Variable Documentation

◆ __all__

list searx.data.__all__
private
Initial value:
1= [
2 'ENGINE_TRAITS',
3 'CURRENCIES',
4 'USER_AGENTS',
5 'EXTERNAL_URLS',
6 'WIKIDATA_UNITS',
7 'EXTERNAL_BANGS',
8 'OSM_KEYS_TAGS',
9 'ENGINE_DESCRIPTIONS',
10 'LOCALES',
11 'ahmia_blacklist_loader',
12]

Definition at line 8 of file __init__.py.

◆ CURRENCIES

searx.data.CURRENCIES = _load('currencies.json')

Definition at line 45 of file __init__.py.

◆ data_dir

searx.data.data_dir = Path(__file__).parent

Definition at line 24 of file __init__.py.

◆ ENGINE_DESCRIPTIONS

searx.data.ENGINE_DESCRIPTIONS = _load('engine_descriptions.json')

Definition at line 51 of file __init__.py.

◆ ENGINE_TRAITS

searx.data.ENGINE_TRAITS = _load('engine_traits.json')

Definition at line 52 of file __init__.py.

◆ EXTERNAL_BANGS

searx.data.EXTERNAL_BANGS = _load('external_bangs.json')

Definition at line 49 of file __init__.py.

◆ EXTERNAL_URLS

searx.data.EXTERNAL_URLS = _load('external_urls.json')

Definition at line 47 of file __init__.py.

◆ LOCALES

searx.data.LOCALES = _load('locales.json')

Definition at line 53 of file __init__.py.

◆ OSM_KEYS_TAGS

searx.data.OSM_KEYS_TAGS = _load('osm_keys_tags.json')

Definition at line 50 of file __init__.py.

◆ USER_AGENTS

searx.data.USER_AGENTS = _load('useragents.json')

Definition at line 46 of file __init__.py.

◆ WIKIDATA_UNITS

searx.data.WIKIDATA_UNITS = _load('wikidata_units.json')

Definition at line 48 of file __init__.py.