Skip to main content

Unofficial Python client for Weathercloud

Project description

weathercloud-py

Unofficial Python client for Weathercloud. No account needed.

Reverse-engineered from HAR captures. Not affiliated with Weathercloud.

pip install weathercloud-py   # not on PyPI yet — clone and pip install -e .

Quick start

from weathercloud import WeathercloudClient

client = WeathercloudClient()
cond = client.get_current_conditions("5726468552")

print(cond.temperature)   # 22.8
print(cond.humidity)      # 62
print(cond.wind_gust)     # 1.4

API

get_current_conditions(device_id)CurrentConditions

Live sensor readings as a typed dataclass. The one you'll call most.

cond = client.get_current_conditions("5726468552")
cond.temperature      # float °C
cond.dew_point        # float °C
cond.wind_chill       # float °C
cond.heat_index       # float °C
cond.humidity         # int %
cond.pressure         # float hPa
cond.wind_speed       # float m/s (instantaneous)
cond.wind_speed_avg   # float m/s
cond.wind_gust        # float m/s
cond.wind_direction   # int °
cond.rain             # float mm
cond.rain_rate        # float mm/h
cond.solar_radiation  # float W/m²
cond.uv_index         # int
cond.epoch            # int unix timestamp

get_station_info(device_id, scrape_name=True)StationInfo

Station metadata. The name isn't in any JSON endpoint, so it's scraped from HTML (one extra request). Pass scrape_name=False to skip it.

info = client.get_station_info("5726468552")
info.name                   # "Ginometeo"
info.city                   # "Ingelmunster"
info.altitude               # "18.0"  (metres, as string)
info.status                 # "online" | "recently_online" | "offline"
info.seconds_since_update   # int
info.account_type           # 0 = free, >0 = premium

get_device_stats(device_id)dict

Current readings + day / month / year min–max. Each value is a [unix_timestamp, value] pair.

stats = client.get_device_stats("5726468552")
stats["temp_day_max"]       # [1748358122, 30.9]
stats["rain_month_total"]   # [1748358122, 12.4]

Key pattern: {sensor}_{period}_{type} — e.g. wspd_year_max, rain_day_total.

get_evolution(device_id, variable, period)dict

Hourly history for one sensor. period is "day", "week", "month", or "year".

from weathercloud import VariableCode

evo = client.get_evolution("5726468552", VariableCode.TEMPERATURE, "week")

Available codes: TEMPERATURE, HUMIDITY, DEW_POINT, PRESSURE, WIND_SPEED, WIND_DIRECTION, WIND_GUST, RAIN, RAIN_RATE, SOLAR_RADIATION, UV_INDEX.

get_forecast(device_id)dict

6-day WMO daily forecast for the station's location.

get_nearby_stations(lat, lon, distance_km=5)dict

Stations within radius. Note: sensor values inside each result are ×10 integers — divide by 10.

Other raw methods

client.get_device_values(device_id)    # same data as get_current_conditions, as raw dict
client.get_device_info(device_id)      # metadata + current values as strings
client.get_wind_rose(device_id)        # wind direction distribution
client.get_update_status(device_id)    # seconds since last update
client.get_owner_profile(device_id)    # observer name, hardware brand/model
client.get_station_name(device_id)     # scrape name only

Error handling

Everything raises WeathercloudError on failure (network error, bad JSON, HTTP error).

from weathercloud import WeathercloudError

try:
    cond = client.get_current_conditions(device_id)
except WeathercloudError as exc:
    # handle it — set unavailable in HA, log it, whatever
    print(exc)

Device IDs

The number at the end of the station URL:

app.weathercloud.net/d5726468552  →  device_id = "5726468552"

METAR (airport) stations use ICAO codes (EBBR, EGLL, …) and work on most device/* endpoints — just swap the prefix to metar/*.


Notes

  • No auth required for any of these endpoints
  • Poll at most every 10 minutes — that's how often free stations update
  • Default request timeout is 10 s — override with WeathercloudClient(timeout=30)
  • Based on the reverse-engineered OpenAPI spec in this repo

Swagger UI / OpenAPI docs

Hosted at weathercloud-api.maurodruwel.be — or run locally:

pip install flask
python docs/proxy.py   # starts proxy on :8765
# open docs/index.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weathercloud-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weathercloud-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file weathercloud-0.1.0.tar.gz.

File metadata

  • Download URL: weathercloud-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for weathercloud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b202728bec22dcfe027e1572719ac6eafd5b9fa595f5505747f00bb2efbe6cd
MD5 46e4031b342433cecf0d925976c85443
BLAKE2b-256 c86d4fcef06e803b194bdaacd85fe4c1ea4ec5c0ccc098dd663f63f0ca74bb0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for weathercloud-0.1.0.tar.gz:

Publisher: publish.yml on MauroDruwel/Weathercloud-API

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file weathercloud-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: weathercloud-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for weathercloud-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dea2bf5b0d33a192cf727e1538d0ed93e23fd839bda21fb2496de2cef045df8
MD5 dabefe901955dc06b6e44698fe65deb9
BLAKE2b-256 e441c17eb865679e4e56e3bf9ca5b4d4d1c29f6bb4b10de4690158eca2da50aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for weathercloud-0.1.0-py3-none-any.whl:

Publisher: publish.yml on MauroDruwel/Weathercloud-API

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page