.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) | |
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/?point={}&point={}&locale=en-US&vehicle=car&weighting=fastest&turn_costs=true&use_miles=false&layer=Omniscale' |
route_re = re.compile('(?:from )?(.+) to (.+)') | |
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 215 of file openstreetmap.py.
References searx.engines.openstreetmap.get_wikipedia_image().
Referenced by searx.engines.openstreetmap.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 379 of file openstreetmap.py.
References searx.engines.openstreetmap.get_key_rank().
Referenced by searx.engines.openstreetmap.response().
searx.engines.openstreetmap.get_img_src | ( | result | ) |
Get image URL from either wikidata or r['extratags']
Definition at line 330 of file openstreetmap.py.
Referenced by searx.engines.openstreetmap.response().
searx.engines.openstreetmap.get_key_label | ( | key_name, | |
lang ) |
Get key label from OSM_KEYS_TAGS
Definition at line 442 of file openstreetmap.py.
References searx.engines.openstreetmap.get_label().
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 405 of file openstreetmap.py.
Referenced by searx.engines.openstreetmap.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 417 of file openstreetmap.py.
Referenced by searx.engines.openstreetmap.get_key_label(), and searx.engines.openstreetmap.get_tag_label().
searx.engines.openstreetmap.get_links | ( | result, | |
user_language ) |
Return links from result['extratags']
Definition at line 353 of file openstreetmap.py.
Referenced by searx.engines.openstreetmap.response().
searx.engines.openstreetmap.get_tag_label | ( | tag_category, | |
tag_name, | |||
lang ) |
Get tag label from OSM_KEYS_TAGS
Definition at line 435 of file openstreetmap.py.
References searx.engines.openstreetmap.get_label().
Referenced by searx.engines.openstreetmap.response().
searx.engines.openstreetmap.get_title_address | ( | result | ) |
Return title and address title may be None
Definition at line 264 of file openstreetmap.py.
Referenced by searx.engines.openstreetmap.response().
searx.engines.openstreetmap.get_url_osm_geojson | ( | result | ) |
Get url, osm and geojson
Definition at line 310 of file openstreetmap.py.
Referenced by searx.engines.openstreetmap.response().
searx.engines.openstreetmap.get_wikipedia_image | ( | raw_value | ) |
Definition at line 209 of file openstreetmap.py.
Referenced by searx.engines.openstreetmap.fetch_wikidata().
searx.engines.openstreetmap.request | ( | query, | |
params ) |
do search-request
Definition at line 140 of file openstreetmap.py.
searx.engines.openstreetmap.response | ( | resp | ) |
get response from search-request
Definition at line 150 of file openstreetmap.py.
References searx.engines.openstreetmap.fetch_wikidata(), searx.engines.openstreetmap.get_data(), searx.engines.openstreetmap.get_img_src(), searx.engines.openstreetmap.get_links(), searx.engines.openstreetmap.get_tag_label(), searx.engines.openstreetmap.get_title_address(), and searx.engines.openstreetmap.get_url_osm_geojson().
searx.engines.openstreetmap.value_to_https_link | ( | value | ) |
Definition at line 71 of file openstreetmap.py.
searx.engines.openstreetmap.value_to_website_link | ( | value | ) |
Definition at line 78 of file openstreetmap.py.
searx.engines.openstreetmap.value_wikipedia_link | ( | value | ) |
Definition at line 83 of file openstreetmap.py.
References searx.format.
searx.engines.openstreetmap.value_with_prefix | ( | prefix, | |
value ) |
Definition at line 88 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 118 of file openstreetmap.py.
dict searx.engines.openstreetmap.KEY_RANKS = {k: i for i, k in enumerate(KEY_ORDER)} |
Definition at line 137 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.
searx.engines.openstreetmap.route_re = re.compile('(?:from )?(.+) to (.+)') |
Definition at line 41 of file openstreetmap.py.
str searx.engines.openstreetmap.route_url = 'https://graphhopper.com/maps/?point={}&point={}&locale=en-US&vehicle=car&weighting=fastest&turn_costs=true&use_miles=false&layer=Omniscale' |
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 92 of file openstreetmap.py.
str searx.engines.openstreetmap.wikidata_image_sparql |
Definition at line 43 of file openstreetmap.py.