Unit Converter

Back to top

A plugin for converting measured values from one unit to another unit (a unit converter).

The plugin looks up the symbols (given in the query term) in a list of converters, each converter is one item in the list (compare ADDITIONAL_UNITS). If the symbols are ambiguous, the matching units of measurement are evaluated. The weighting in the evaluation results from the sorting of the list of unit converters.

class searx.plugins.unit_converter.SXNGPlugin(plg_cfg: PluginCfg)[source] : Convert between units. The result is displayed in area for the “answers”.

id: [str](https://docs.python.org/3/builtins/stdtypes.html#str) = 'unit\_converter'
:   The ID (suffix) in the HTML form.

post\_search(*request: [SXNG\_Request](https://docs.searxng.org/dev/extended_types.html#searx.extended_types.SXNG_Request)*, *search: [SearchWithPlugins](https://docs.searxng.org/src/searx.search.html#searx.search.SearchWithPlugins)*) → [EngineResults](https://docs.searxng.org/dev/engines/index.html#searx.result_types.EngineResults)[[source]](https://docs.searxng.org/_modules/searx/plugins/unit_converter.html#SXNGPlugin.post_search)
:   Runs AFTER the search request. Can return a list of
    [`Result`](https://docs.searxng.org/dev/result_types/base_result.html#searx.result_types._base.Result) objects to be added to the
    final result list.

Copyright © SearXNG team

Made with Furo

💾 🌐