.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.weather.RelativeHumidity Class Reference

Public Member Functions

 __init__ (self, float humidity)
 __str__ (self)
float value (self)
str l10n (self, babel.Locale|GeoLocation|None locale=None, str template="{value}{unit}", str num_pattern="#,##0")

Public Attributes

 humidity = humidity

Static Public Attributes

 Units = typing.Literal["%"]
 units = list(typing.get_args(Units))

Detailed Description

Amount of relative humidity in the air. The unit is ``%``

Definition at line 417 of file weather.py.

Constructor & Destructor Documentation

◆ __init__()

searx.weather.RelativeHumidity.__init__ ( self,
float humidity )

Definition at line 425 of file weather.py.

425 def __init__(self, humidity: float):
426 self.humidity = humidity
427

Member Function Documentation

◆ __str__()

searx.weather.RelativeHumidity.__str__ ( self)

Definition at line 428 of file weather.py.

428 def __str__(self):
429 return self.l10n()
430

References searx.weather.DateTime.l10n(), searx.weather.Pressure.l10n(), l10n(), searx.weather.Temperature.l10n(), and searx.weather.WindSpeed.l10n().

Here is the call graph for this function:

◆ l10n()

str searx.weather.RelativeHumidity.l10n ( self,
babel.Locale | GeoLocation | None locale = None,
str template = "{value}{unit}",
str num_pattern = "#,##0" )

Definition at line 434 of file weather.py.

439 ) -> str:
440 if isinstance(locale, GeoLocation):
441 locale = locale.locale()
442 elif locale is None:
443 locale = babel.Locale.parse(_get_sxng_locale_tag(), sep='-')
444
445 unit = "%"
446 val_str = babel.numbers.format_decimal(self.value(), locale=locale, format=num_pattern)
447 return template.format(value=val_str, unit=unit)
448
449
450@typing.final

References searx.weather._get_sxng_locale_tag(), searx.preferences.BooleanSetting.value, searx.preferences.EnumStringSetting.value, searx.preferences.MapSetting.value, searx.preferences.MultipleChoiceSetting.value, searx.preferences.SearchLanguageSetting.value, searx.preferences.Setting.value, searx.weather.Pressure.value(), value(), searx.weather.Temperature.value(), and searx.weather.WindSpeed.value().

Referenced by searx.weather.Compass.__str__(), and __str__().

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

◆ value()

float searx.weather.RelativeHumidity.value ( self)

Definition at line 431 of file weather.py.

431 def value(self) -> float:
432 return self.humidity
433

References searx.result_types.answer.WeatherAnswer.Item.humidity, and humidity.

Referenced by searx.weather.Compass.l10n(), and l10n().

Here is the caller graph for this function:

Member Data Documentation

◆ humidity

searx.weather.RelativeHumidity.humidity = humidity

Definition at line 426 of file weather.py.

Referenced by value().

◆ Units

searx.weather.RelativeHumidity.Units = typing.Literal["%"]
static

Definition at line 420 of file weather.py.

◆ units

searx.weather.RelativeHumidity.units = list(typing.get_args(Units))
static

Definition at line 423 of file weather.py.


The documentation for this class was generated from the following file:
  • /home/andrew/Documents/code/public/searxng/searx/weather.py