Skip to main content

Integration of Weather City Forecasts Manager in Wagtail Projects.

Project description

Developer Guide: Adding City Forecasts to ClimWeb

This guide explains three ways to add city forecast data to ClimWeb. For more handson guide visit the Forecast Manager Guide:


1. Using the API

Endpoint

  • POST /api/forecasts/post

Authentication

  • Requires Token.
  • Obtain a token via POST to /api/token/ (TokenAuthentication) with payload
{
    "username":"your_username",
    "password":"your_password"
}
  • Add header: Authorization: Token <token>

Payload Example

{
  "forecast_date": "2026-03-11",
  "effective_time": "06:00:00",
  "source": "local",
  "replace_existing": true,
  "city_forecasts": [
    {
      "city": "nairobi",
      "condition": "Partly Cloudy",
      "data_values": {
        "max_temp": 28.5,
        "min_temp": 18.2,
        "humidity": 64
      }
    }
  ]
}

Example Python Script

import requests
API_URL = "http://<domain_name>/api/forecasts/post"
TOKEN = "your_token_here"
payload = { ... }
headers = {"Authorization": f"Token {TOKEN}", "Content-Type": "application/json"}
response = requests.post(API_URL, json=payload, headers=headers)
print(response.status_code)
print(response.json())

2. Automated City Forecast from Meteorological Providers (Meteorological Norway)

  • This is simply implemented by enabling the automated forecasts checkbox under Forecast Settings > Forecast Source. This forecasts is updated automatically every three hours and has a 1 hour time interval (24 readings in a day)

To read more about Meteorological Norway location forecast visit:


3. Manual CSV Upload

  • Use the admin interface or dedicated upload page to upload city forecast data via CSV. Visit guide here.
  • Download the CSV template .
  • Fill in city forecast data in the template.
  • Upload the CSV file using the web interface (typically via a form).
  • The system will parse, validate, and import the data.
  • Optionally, set 'overwrite existing' if you want to replace previous forecasts.

Notes

  • All methods require valid city and parameter references.
  • For API and automated methods, ensure authentication is set up.
  • For manual upload, follow the template format and check for errors after upload.
  • All weather symbols used are from yr.no

For further details, see the API documentation .

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

forecastmanager-0.6.3.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

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

forecastmanager-0.6.3-py3-none-any.whl (3.6 MB view details)

Uploaded Python 3

File details

Details for the file forecastmanager-0.6.3.tar.gz.

File metadata

  • Download URL: forecastmanager-0.6.3.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for forecastmanager-0.6.3.tar.gz
Algorithm Hash digest
SHA256 19645e4b652269c981eb8d6e207a996cb4b72504e9dc86cfaeef2f969a7f92e7
MD5 ce0b868843d5bc55588e4f916c2a4455
BLAKE2b-256 9dc0e538dcd38a66640026e0cf1a7486ca19b044a3fdfd5a1bec320ec69c9f97

See more details on using hashes here.

Provenance

The following attestation bundles were made for forecastmanager-0.6.3.tar.gz:

Publisher: publish.yml on wmo-raf/forecastmanager

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

File details

Details for the file forecastmanager-0.6.3-py3-none-any.whl.

File metadata

File hashes

Hashes for forecastmanager-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5e3265a7e071261e53a4d9b672a03c2a358373804bf5e6e8abe7c771faa76f98
MD5 82eefc14a9fa47e4161b1b5d5ffcfb2a
BLAKE2b-256 562077d500482b127d25fca575c562fa8d34ca2e6cafbcb993d9ab20f23335c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for forecastmanager-0.6.3-py3-none-any.whl:

Publisher: publish.yml on wmo-raf/forecastmanager

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