Skip to main content

collective.volto.aemet

Latest Version Supported - Python Versions Number of PyPI downloads License

AEMET

An integration for the AEMET service with Plone.

Features

  • Control panel in Plone registry to manage AEMET Settings.

  • RestApi endpoint that exposes the AEMET Settings for Volto integration.

  • RestApi endpoint that exposes the current weather forecast for the Location ID defined on the AEMET Settings control panel.

Screenshot

Add-on Configuration Access

Add-on Configuration

AEMET Settings control panel

AEMET Settings

Volto integration

To use this product in Volto, you needs to include the following add-on in your project: volto-aemet.

Translations

This product support the following languages:

  • Basque

  • Catalan

  • English

  • Galician

  • Spanish

Compatibility

  • Tested with Python 3.12 and {term}Plone 6.1.5.

Install it

To install in your project, the collective.volto.aemet add-on with pip command:

pip install collective.volto.aemet

And to create the Plone site:

make create-site

Custom REST services

Plone can expose specific endpoints for Volto. These services encapsulate the logic for communicating with AEMET and provide a standardised format for the front end.

AEMET settings route

Anonymous users can't access registry resources by default with plone.restapi (there is a special permission).

To avoid enabling registry access to everyone, this package exposes a dedicated RestApi route with AEMET Settings (@aemet-settings):

Get the information from the AEMET Settings via curl command:

curl -X GET http://localhost:8080/Plone/@controlpanels/aemet-settings \
  -H "Accept: application/json" \
  --user admin:admin

This route returns a JSON object containing the AEMET Settings and weather forecast data via curl command:

{
  "@id": "http://localhost:8080/Plone/@controlpanels/aemet-settings",
  "data": {
    "location_id": "41091"
  },
  "group": "Add-on Configuration",
  "schema": {
    "fieldsets": [
      {
        "behavior": "plone",
        "fields": [
          "location_id"
        ],
        "id": "default",
        "title": "Default"
      }
    ],
    "properties": {
      "location_id": {
        "description": "The Location ID of the AEMET service, for example '41091' to Sevilla location ID.",
        "factory": "Text line (String)",
        "title": "Location ID",
        "type": "string"
      }
    },
    "required": [
      "location_id"
    ],
    "type": "object"
  },
  "title": "AEMET Settings"
}

Below is a PATCH operation to set up the location_id field value of the AEMET Settings:

curl -i -X PATCH http://localhost:8080/Plone/@controlpanels/aemet-settings \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  --data '{"location_id": "28058"}' \
  --user admin:admin

This route returns a HTTP response:

HTTP/1.1 204 No Content
Connection: close
Date: Fri, 17 Jul 2026 12:52:40 GMT
Server: waitress
Via: waitress
X-Powered-By: Zope (www.zope.dev), Python (www.python.org)

That means you updates the values in the AEMET Settings control panel fields correctly.

NOTE: You can validate the update operation, going to Site setup > Add-on Settings > AEMET Settings.


AEMET weather forecast route

This route is uses to fetch the current weather forecast for location defined on the AEMET Settings control panel:

curl -X GET http://localhost:8080/Plone/++api++/@aemet-weather-forecast

This route returns a JSON object containing the AEMET weather forecast data:

{
  "forecast": [
    {
      "currentHour": 14,
      "date": "2026-07-17",
      "name": "Madrid",
      "province": "Madrid",
      "skyState": "Despejado",
      "skyStateValue": "11",
      "tempMax": "34",
      "tempMin": "20",
      "timePeriod": "12-18"
    }
  ]
}

This can be implements in a Volto integration for example, the WeatherForecast component available into the volto-aemet add-on.


Contribute

Prerequisites ✅

Installation 🔧

  1. Clone this repository, then change your working directory.

    git clone git@github.com:collective/collective.volto.aemet.git
    cd collective.volto.aemet
    
  2. Install this code base.

    make install
    

Add features using plonecli or bobtemplates.plone

This package provides markers as strings (<!-- extra stuff goes here -->) that are compatible with plonecli and bobtemplates.plone. These markers act as hooks to add all kinds of subtemplates, including behaviors, control panels, upgrade steps, or other subtemplates from plonecli.

To run plonecli with configuration to target this package, run the following command.

make add <template_name>

For example, you can add a content type to your package with the following command.

make add content_type

You can add a behavior with the following command.

make add behavior

See also:

You can check the list of available subtemplates in the bobtemplates.plone README.md file. See also the documentation of Mockup and Patternslib for how to build the UI toolkit for Classic UI.

Credits

Developed with the support of:

Acknowledgements 🙏

Generated using Cookieplone (0.9.10) and cookieplone-templates (eb40854) on 2025-11-06 19:48:38.313942. A special thanks to all contributors and supporters!

Authors

This product was developed by Leonardo J. Caballero G..

Leonardo J. Caballero G.

Contributors

You can see a list of contributors in the CONTRIBUTORS.md file.

License

The project is licensed under GPLv2.

Release files for collective.volto.aemet 1.0.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 collective.volto.aemet 1.0.0
File Size Uploaded
collective_volto_aemet-1.0.0.tar.gz 268.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for collective.volto.aemet 1.0.0
File Interpreter ABI Platform
collective_volto_aemet-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 323.2 kB

Release files / collective_volto_aemet-1.0.0.tar.gz

Download URL collective_volto_aemet-1.0.0.tar.gz
Size 268.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cd4efc2e2df102e3bb7d2672feced05fb57ba4c7cc9dba1f20d78e9f0290c4f3
BLAKE2b-256 checksum
How to use checksums
6569b34437483edbe7a4fd8093418c5d2ba7222e14733c42c2561c8030048cbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.18

Release files / collective_volto_aemet-1.0.0-py3-none-any.whl

Download URL collective_volto_aemet-1.0.0-py3-none-any.whl
Size 54.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe0883eceb5224cda93932ccf8467bbfae03c1b034e8fd32ea8d923a4bdc2a46
BLAKE2b-256 checksum
How to use checksums
c16acdc814f18177ccfcd8c10afe06d8bc19fe38fec8b1eb959852f5c688e299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.18

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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