Skip to main content

Powerline PWS

A Powerline segment for showing weather data from your PWS (Personal Weather Station).

Installation

Using pip

pip install powerline-pws

Note: since PEP 668 installing pip-packages system-wide isn't supported by default anymore. This behaviour can be overwritten using the --break-system-packages. Do this at your own risk.

AUR

A PKGBUILD has been created for this package, available on the AUR.

paru -S python-powerline-pws

Configuration

Configuration

The PWS segment is currently only compatible with the Cumulus Realtime Format (station_type: "cumulus", the default). When your station is using WeeWX for example, this excellent extension can be used for outputting weather data in the CRT-format. Other formats can be added by registering a parser in powerline_pws/parsers.py.

The segment uses some extra highlight groups, defined for example in .config/powerline/colorschemes/default.json (see examples/colorschemes-default.json):

{
    "groups": {
        "pws":                    { "fg": "gray8", "bg": "gray0", "attrs": [] },
        "pws_stale":              { "fg": "gray5", "bg": "gray0", "attrs": ["dim"] },
        "pws_uv_gradient":        { "fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] },
        "pws_temp_gradient":      { "fg": "blue_red", "bg": "gray0", "attrs": [] },
        "pws_humidity_gradient":  { "fg": "white_red", "bg": "gray0", "attrs": [] },
        "pws_wind_gradient":      { "fg": "green_yellow_red", "bg": "gray0", "attrs": [] }
    }
}

Only pws is required; gradient groups that are not defined fall back to it.

Activate the segment in your theme, for example in .config/powerline/themes/tmux/default.json:

{
    "function": "powerline_pws.pws",
    "args": {
      "pws_url": "<URL_TO_YOUR_PWS>"
    }
}

pws_url can be an http(s) URL, a file:// URL or a local path. By default only the outdoor temperature is shown.

Arguments

Argument Default Description
pws_url Location of the station data
station_type "cumulus" Format of the station data
parameters ["outTemp"] Measurements to show, space separated
format Format string, e.g. "{outTemp:.0f} {outHumidity}". Overrides parameters
label Text shown before the measurements
unit_system "metric" "metric" or "imperial"
source_unit_system "metric" Unit system the station reports in
show_units true Append units to values
icons {} Symbol before a measurement, e.g. {"outTemp": "🌡 "}
gradients Per measurement [min, max] (metric) or {"min", "max", "group"}; null disables
temp_coldest / temp_hottest -30 / 40 Bounds (°C) of the temperature gradient
stale_after 900 Seconds before data is considered stale (0 disables)
hide_stale false Hide the segment when stale instead of using pws_stale
date_format "%d/%m/%y" strptime format of the station date
interval 150 Seconds between updates
timeout 3 Seconds to wait for the station
cache true Keep the last data on disk (see below)
silent true Log fetch failures at debug instead of error level
temp_unit, pressure_unit, speed_unit, rain_unit, rain_rate_unit, radiation_unit Override the unit label

Staleness uses the date/time in the station data, read as local time of the machine running Powerline.

Available measurements: outTemp, outHumidity, dewpoint, windSpeed_avg, windSpeed, rainRate, dayRain, barometer, windDir_compass, pressure_trend, rain_month, rain_year, rain_yesterday, inTemp, inHumidity, windchill, temperature_trend, outTemp_max, outTemp_min, windSpeed_max, windGust_max, pressure_max, pressure_min, 10_min_high_gust, heatindex, humidex, UV, radiation, 10min_avg_wind_bearing, rain_hour.

Examples

Choose measurements:

{
    "function": "powerline_pws.pws",
    "args": {
      "pws_url": "<URL_TO_YOUR_PWS>",
      "parameters": ["dayRain", "outTemp", "barometer", "outHumidity"]
    }
}

Imperial units with a custom format:

{
    "function": "powerline_pws.pws",
    "args": {
      "pws_url": "/var/www/realtime.txt",
      "unit_system": "imperial",
      "format": "{outTemp:.0f} / {windSpeed:.0f}"
    }
}

Two stations, each with a label:

{
	"function": "powerline_pws.pws",
	"args": {
	  "pws_url": "<URL_TO_PWS_1>",
	  "label": "🏝️",
	  "parameters": ["outTemp", "UV", "outHumidity"]
	}
},
{
	"function": "powerline_pws.pws",
	"args": {
	  "pws_url": "<URL_TO_PWS_2>",
	  "label": "🏠",
	  "parameters": ["inTemp", "outTemp", "barometer", "outHumidity"]
	}
}

Development

pip install -e ".[test]"
ruff check .
pytest

Slow or missing network

Fetching has a short timeout (3 seconds). The last data is cached in $XDG_CACHE_HOME/powerline-pws/ (default ~/.cache/powerline-pws/), so:

  • when Powerline runs without powerline-daemon (a new process per refresh), the network is only used once per interval, and after a failure not again for 60 seconds, instead of on every refresh;
  • while offline the last known data stays visible, highlighted with pws_stale once older than stale_after.

If tmux shows <'... powerline ...' not ready>, the render command is taking too long: that's tmux's placeholder for a #(...) command that has not produced output yet. Starting powerline-daemon also avoids it. Set "cache": false to disable the disk cache, "silent": false to log fetch failures as errors.

Metadata

Release files for powerline-pws 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for powerline-pws 1.2.0
File Size Uploaded Provenance Actions
powerline_pws-1.2.0.tar.gz 53.7 kB With provenance Details for powerline_pws-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for powerline-pws 1.2.0
File Interpreter ABI Platform Actions
powerline_pws-1.2.0-py3-none-any.whl Python 3 none any Details for powerline_pws-1.2.0-py3-none-any.whl

Total release size: 92.2 kB

Release files / powerline_pws-1.2.0.tar.gz

Download URL powerline_pws-1.2.0.tar.gz
Size 53.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a40deb4b6c66061eeb1f97dd54a7c7a0a930d3263c36caeb36ed26745f12a22e
BLAKE2b-256 checksum
How to use checksums
c929644a037a1b2024f1674cdc8c495052926fc33dd763785bb6372b6f3caa5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / powerline_pws-1.2.0-py3-none-any.whl

Download URL powerline_pws-1.2.0-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e08b18da63480ed424eae07e7ed6ea23baa25a6125e600b2b77e177f91de375a
BLAKE2b-256 checksum
How to use checksums
cce3beef1d1594487c58780f988d0ca5143272cd3a3c838df1f22db6b3898925
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for powerline-pws 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for powerline_pws-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page