Skip to content

weather

weather #

The WeatherKit JSON scalar.

Weather #

Bases: JSONScalar

A WeatherKit capture at a moment and place.

Every field is required except pressure_trend and wind_gust_mps. The capture time is stored as epoch seconds through its field transform.

Attributes:

Name Type Description
temperature_celsius float

Air temperature.

apparent_temperature_celsius float

"Feels like" temperature.

dew_point_celsius float

Dew point.

humidity_ratio float

Relative humidity, 0 to 1.

pressure_hpa float

Sea-level pressure in hectopascals.

wind_speed_mps float

Sustained wind speed.

wind_direction_degrees float

Wind heading.

condition str

WeatherKit condition code — a vendor passthrough string, exempt from the snake_case wire convention.

symbol_name str

SF Symbol name for the condition.

cloud_cover_ratio float

Cloud cover, 0 to 1.

precipitation_intensity_mmph float

Precipitation rate.

visibility_meters float

Visibility distance.

uv_index float

Ultraviolet index.

is_daylight bool

Whether the capture was during daylight.

time Annotated[datetime, Epoch]

The capture time.

pressure_trend PressureTrend | None

The pressure's direction, if the provider reports one.

wind_gust_mps float | None

Peak gust speed, if reported.

Source code in capturegraph-lib/capturegraph/types/scalars/environment/weather.py
class Weather(JSONScalar, name="edu.cornell.weather"):
    """A WeatherKit capture at a moment and place.

    Every field is required except ``pressure_trend`` and ``wind_gust_mps``.
    The capture ``time`` is stored as epoch seconds through its field transform.

    Attributes:
        temperature_celsius: Air temperature.
        apparent_temperature_celsius: "Feels like" temperature.
        dew_point_celsius: Dew point.
        humidity_ratio: Relative humidity, 0 to 1.
        pressure_hpa: Sea-level pressure in hectopascals.
        wind_speed_mps: Sustained wind speed.
        wind_direction_degrees: Wind heading.
        condition: WeatherKit condition code — a vendor passthrough string,
            exempt from the snake_case wire convention.
        symbol_name: SF Symbol name for the condition.
        cloud_cover_ratio: Cloud cover, 0 to 1.
        precipitation_intensity_mmph: Precipitation rate.
        visibility_meters: Visibility distance.
        uv_index: Ultraviolet index.
        is_daylight: Whether the capture was during daylight.
        time: The capture time.
        pressure_trend: The pressure's direction, if the provider reports one.
        wind_gust_mps: Peak gust speed, if reported.
    """

    temperature_celsius: float
    apparent_temperature_celsius: float
    dew_point_celsius: float
    humidity_ratio: float
    pressure_hpa: float
    wind_speed_mps: float
    wind_direction_degrees: float
    condition: str
    symbol_name: str
    cloud_cover_ratio: float
    precipitation_intensity_mmph: float
    visibility_meters: float
    uv_index: float
    is_daylight: bool
    time: Annotated[datetime, Epoch]
    pressure_trend: PressureTrend | None = None
    wind_gust_mps: float | None = None