.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.search.processors.online_currency Namespace Reference

Classes

class  OnlineCurrencyProcessor
 

Functions

 normalize_name (name)
 
 name_to_iso4217 (name)
 
 iso4217_to_name (iso4217, language)
 

Variables

 parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I)
 

Detailed Description

Processors for engine-type: ``online_currency``

Function Documentation

◆ iso4217_to_name()

searx.search.processors.online_currency.iso4217_to_name ( iso4217,
language )

Definition at line 29 of file online_currency.py.

29def iso4217_to_name(iso4217, language):
30 return CURRENCIES['iso4217'].get(iso4217, {}).get(language, iso4217)
31
32

Referenced by searx.search.processors.online_currency.OnlineCurrencyProcessor.get_params().

+ Here is the caller graph for this function:

◆ name_to_iso4217()

searx.search.processors.online_currency.name_to_iso4217 ( name)

Definition at line 21 of file online_currency.py.

21def name_to_iso4217(name):
22 name = normalize_name(name)
23 currency = CURRENCIES['names'].get(name, [name])
24 if isinstance(currency, str):
25 return currency
26 return currency[-1]
27
28

References searx.search.processors.online_currency.normalize_name().

Referenced by searx.search.processors.online_currency.OnlineCurrencyProcessor.get_params().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalize_name()

searx.search.processors.online_currency.normalize_name ( name)

Definition at line 15 of file online_currency.py.

15def normalize_name(name):
16 name = name.lower().replace('-', ' ').rstrip('s')
17 name = re.sub(' +', ' ', name)
18 return unicodedata.normalize('NFKD', name).lower()
19
20

Referenced by searx.search.processors.online_currency.name_to_iso4217().

+ Here is the caller graph for this function:

Variable Documentation

◆ parser_re

searx.search.processors.online_currency.parser_re = re.compile('.*?(\\d+(?:\\.\\d+)?) ([^.0-9]+) (?:in|to) ([^.0-9]+)', re.I)

Definition at line 12 of file online_currency.py.