.oO SearXNG Developer Documentation Oo.
|
Functions | |
value_to_https_link (value) | |
value_to_website_link (value) | |
value_wikipedia_link (value) | |
value_with_prefix (prefix, value) | |
request (query, params) | |
EngineResults | response (resp) |
get_wikipedia_image (raw_value) | |
fetch_wikidata (nominatim_json, user_language) | |
get_title_address (result) | |
get_url_osm_geojson (result) | |
get_img_src (result) | |
get_links (result, user_language) | |
get_data (result, user_language, ignore_keys) | |
get_key_rank (k) | |
get_label (labels, lang) | |
get_tag_label (tag_category, tag_name, lang) | |
get_key_label (key_name, lang) | |
Variables | |
dict | about |
list | categories = ['map'] |
bool | paging = False |
bool | language_support = True |
bool | send_accept_language_header = True |
str | base_url = 'https://nominatim.openstreetmap.org/' |
str | search_string = 'search?{query}&polygon_geojson=1&format=jsonv2&addressdetails=1&extratags=1&dedupe=1' |
str | result_id_url = 'https://openstreetmap.org/{osm_type}/{osm_id}' |
str | result_lat_lon_url = 'https://www.openstreetmap.org/?mlat={lat}&mlon={lon}&zoom={zoom}&layers=M' |
str | route_url = 'https://graphhopper.com/maps' |
str | wikidata_image_sparql |
dict | VALUE_TO_LINK |
list | KEY_ORDER |
dict | KEY_RANKS = {k: i for i, k in enumerate(KEY_ORDER)} |
OpenStreetMap (Map)
searx.engines.openstreetmap.fetch_wikidata | ( | nominatim_json, | |
user_language ) |
Update nominatim_json using the result of an unique to wikidata For result in nominatim_json: If result['extratags']['wikidata'] or r['extratags']['wikidata link']: Set result['wikidata'] to { 'image': ..., 'image_sign':..., 'image_symbal':... } Set result['extratags']['wikipedia'] if not defined Set result['extratags']['contact:website'] if not defined
Definition at line 214 of file openstreetmap.py.
References get_wikipedia_image().
Referenced by response().
searx.engines.openstreetmap.get_data | ( | result, | |
user_language, | |||
ignore_keys ) |
Return key, value of result['extratags'] Must be call after get_links Note: the values are not translated
Definition at line 378 of file openstreetmap.py.
References get_key_label(), and get_key_rank().
Referenced by response().
searx.engines.openstreetmap.get_img_src | ( | result | ) |
Get image URL from either wikidata or r['extratags']
Definition at line 329 of file openstreetmap.py.
Referenced by response().
searx.engines.openstreetmap.get_key_label | ( | key_name, | |
lang ) |
Get key label from OSM_KEYS_TAGS
Definition at line 441 of file openstreetmap.py.
References get_label().
Referenced by get_data(), get_links(), and response().
searx.engines.openstreetmap.get_key_rank | ( | k | ) |
Get OSM key rank The rank defines in which order the key are displayed in the HTML result
Definition at line 404 of file openstreetmap.py.
Referenced by get_data().
searx.engines.openstreetmap.get_label | ( | labels, | |
lang ) |
Get label from labels in OSM_KEYS_TAGS in OSM_KEYS_TAGS, labels have key == '*'
Definition at line 416 of file openstreetmap.py.
Referenced by get_key_label(), and get_tag_label().
searx.engines.openstreetmap.get_links | ( | result, | |
user_language ) |
Return links from result['extratags']
Definition at line 352 of file openstreetmap.py.
References get_key_label().
Referenced by response().
searx.engines.openstreetmap.get_tag_label | ( | tag_category, | |
tag_name, | |||
lang ) |
Get tag label from OSM_KEYS_TAGS
Definition at line 434 of file openstreetmap.py.
References get_label().
Referenced by response().
searx.engines.openstreetmap.get_title_address | ( | result | ) |
Return title and address title may be None
Definition at line 263 of file openstreetmap.py.
Referenced by response().
searx.engines.openstreetmap.get_url_osm_geojson | ( | result | ) |
Get url, osm and geojson
Definition at line 309 of file openstreetmap.py.
Referenced by response().
searx.engines.openstreetmap.get_wikipedia_image | ( | raw_value | ) |
Definition at line 208 of file openstreetmap.py.
Referenced by fetch_wikidata().
searx.engines.openstreetmap.request | ( | query, | |
params ) |
Definition at line 139 of file openstreetmap.py.
EngineResults searx.engines.openstreetmap.response | ( | resp | ) |
Definition at line 144 of file openstreetmap.py.
References fetch_wikidata(), get_data(), get_img_src(), get_key_label(), get_links(), get_tag_label(), get_title_address(), and get_url_osm_geojson().
searx.engines.openstreetmap.value_to_https_link | ( | value | ) |
Definition at line 70 of file openstreetmap.py.
searx.engines.openstreetmap.value_to_website_link | ( | value | ) |
Definition at line 77 of file openstreetmap.py.
searx.engines.openstreetmap.value_wikipedia_link | ( | value | ) |
Definition at line 82 of file openstreetmap.py.
searx.engines.openstreetmap.value_with_prefix | ( | prefix, | |
value ) |
Definition at line 87 of file openstreetmap.py.
dict searx.engines.openstreetmap.about |
Definition at line 19 of file openstreetmap.py.
str searx.engines.openstreetmap.base_url = 'https://nominatim.openstreetmap.org/' |
Definition at line 35 of file openstreetmap.py.
list searx.engines.openstreetmap.categories = ['map'] |
Definition at line 29 of file openstreetmap.py.
list searx.engines.openstreetmap.KEY_ORDER |
Definition at line 117 of file openstreetmap.py.
dict searx.engines.openstreetmap.KEY_RANKS = {k: i for i, k in enumerate(KEY_ORDER)} |
Definition at line 136 of file openstreetmap.py.
bool searx.engines.openstreetmap.language_support = True |
Definition at line 31 of file openstreetmap.py.
bool searx.engines.openstreetmap.paging = False |
Definition at line 30 of file openstreetmap.py.
str searx.engines.openstreetmap.result_id_url = 'https://openstreetmap.org/{osm_type}/{osm_id}' |
Definition at line 37 of file openstreetmap.py.
str searx.engines.openstreetmap.result_lat_lon_url = 'https://www.openstreetmap.org/?mlat={lat}&mlon={lon}&zoom={zoom}&layers=M' |
Definition at line 38 of file openstreetmap.py.
str searx.engines.openstreetmap.route_url = 'https://graphhopper.com/maps' |
Definition at line 40 of file openstreetmap.py.
str searx.engines.openstreetmap.search_string = 'search?{query}&polygon_geojson=1&format=jsonv2&addressdetails=1&extratags=1&dedupe=1' |
Definition at line 36 of file openstreetmap.py.
bool searx.engines.openstreetmap.send_accept_language_header = True |
Definition at line 32 of file openstreetmap.py.
dict searx.engines.openstreetmap.VALUE_TO_LINK |
Definition at line 91 of file openstreetmap.py.
str searx.engines.openstreetmap.wikidata_image_sparql |
Definition at line 42 of file openstreetmap.py.