Skip to main content

An integration for the AEMET service with Plone

Project description

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 these settings for Volto.
  • RestApi endpoint that exposes the current weather forecast for location 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, your Volto project needs to include a new add-on: https://github.com/collective/volto-aemet

Translations

This product has been translated into

  • English
  • Spanish

Compatibility

  • Tested with Python 3.12 and Plone 6.1.5.

Install it

Install collective.volto.aemet with pip:

pip install collective.volto.aemet

And to create the Plone site:

make create-site

@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 weather forecast settings and 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"
}

Update 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)

@aemet-weather-forecast route

This route is used 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 used in for 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.

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

collective_volto_aemet-1.0.0a1.tar.gz (266.3 kB view details)

Uploaded Source

Built Distribution

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

collective_volto_aemet-1.0.0a1-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

File details

Details for the file collective_volto_aemet-1.0.0a1.tar.gz.

File metadata

  • Download URL: collective_volto_aemet-1.0.0a1.tar.gz
  • Upload date:
  • Size: 266.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for collective_volto_aemet-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 9a8e56b0d0d63ed148a0f843a8b6063a3cf53997a9be6008062ce51b15760ccb
MD5 69b39ce705278aa8ba8bc09812a20ef1
BLAKE2b-256 52d194c978ca1a90204a8f7e1d2ac759448660b488f20da10dcc3768449bc117

See more details on using hashes here.

File details

Details for the file collective_volto_aemet-1.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for collective_volto_aemet-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 185df9f870d64cf2bd69928366fd4e508d7489404b44a3e98311a7578c59cdc8
MD5 a1f9f2015080719ef9a08548282eda04
BLAKE2b-256 a12532e5454c1b06f6ea6c4e3b9afdb4436ee71127c67831330d53471201b649

See more details on using hashes here.

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