Skip to main content

MeteoAlarm Python package

DOI PyPI - Downloads

A Python package for accessing and filtering weather warnings from MeteoAlarm's CAP (Common Alerting Protocol) feeds. This package provides easy access to weather warnings across European countries through MeteoAlarm's official feeds.

Features

  • Access weather warnings for multiple European countries
  • Filter warnings based on various attributes (severity, type, description, etc.)
  • Support for multiple languages per warning
  • Automatic parsing of CAP format warnings
  • GeoJSON geometry support for warning areas
  • Timezone-aware datetime handling

Installation

Install the package using pip:

pip install meteoalarm

Quickstart

from meteoalarm import MeteoAlarm

# Initialize with one or more countries
warnings = MeteoAlarm(["estonia", "denmark"])

# Print all warnings
for warning in warnings:
    print(f"""\nWarning for {warning.area["areaDesc"]} ({warning.country}):""")
    print(f"""Headline: {warning.get_headline("en-EN")}""")
    print(f"Severity: {warning.severity}")
    print(f"Valid until: {warning.expires}")

Filtering Warnings

The package provides flexible filtering capabilities:

# Filter by severity
severe_warnings = warnings.filter(severity="Severe")

# Filter by description content (searches in all languages)
wind_warnings = warnings.filter(description="wind")

# Filter by multiple criteria
specific_warnings = warnings.filter(
    country="estonia",
    severity="Moderate",
    awareness_type="2"
)

# Filter with meteoalarm.Regex
from meteoalarm import Regex
regex_warnings = warnings.filter(area=Regex(r"^Orange.*"))

# Filter with datetime.datatime objects
from datetime import datetime
active_warnings = warnings.filter(onset=datetime.now())

# Filter with ISO 8601 date strings
active_warnings_iso = warnings.filter(onset="2024-12-31T23:59:59Z")

# Chain filters
critical_wind = warnings.filter(awareness_type="Wind").filter(severity="Severe")

Multilingual Support

Warnings are available in multiple languages:

# Get available languages for a warning
languages = warning.get_available_languages()

# Get warning information in specific language
english_headline = warning.get_headline("en-EN")
estonian_desc = warning.get_description("et-ET")

Plotting the Warning Area

from shapely.geometry import shape
import geopandas as gpd
import matplotlib.pyplot as plt
import contextily as ctx
import json

# Parse the GeoJSON string
geojson_dict = json.loads(warnings[0].geometry)

# Create geometry object
geometry = shape(geojson_dict)

# Create GeoDataFrame directly
gdf = gpd.GeoDataFrame(geometry=[geometry], crs="EPSG:4326")

# Convert to Web Mercator projection for contextily
gdf_web = gdf.to_crs(epsg=3857)

# Create plot
fig, ax = plt.subplots(figsize=(10, 10))
gdf_web.plot(ax=ax, alpha=0.5, color='red')

# Add background map
ctx.add_basemap(ax)

plt.axis('off')
plt.show()

Warning Attributes

Each warning object contains the following attributes:

  • category: Warning category
  • event: Event type
  • urgency: Urgency level
  • severity: Severity level
  • certainty: Certainty level
  • onset: Start time (datetime object)
  • effective: Effective time (datetime object)
  • expires: Expiration time (datetime object)
  • sender: Dictionary containing sender information
  • headline: Dictionary of headlines in available languages
  • description: Dictionary of descriptions in available languages
  • awareness_level: Awareness level
  • awareness_type: Type of weather warning
  • area: Dictionary containing area description and EMMA_ID
  • geometry: GeoJSON geometry of the warning area

Requirements

  • Python 3.7+
  • requests
  • pytz
  • pyyaml

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • Data provided by MeteoAlarm
  • Based on the CAP (Common Alerting Protocol) standard

Metadata

Release files for meteoalarm 0.3.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 meteoalarm 0.3.0
File Size Uploaded Provenance Actions
meteoalarm-0.3.0.tar.gz 12.4 MB With provenance Details for meteoalarm-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for meteoalarm 0.3.0
File Interpreter ABI Platform Actions
meteoalarm-0.3.0-py3-none-any.whl Python 3 none any Details for meteoalarm-0.3.0-py3-none-any.whl

Total release size: 24.8 MB

Release files / meteoalarm-0.3.0.tar.gz

Download URL meteoalarm-0.3.0.tar.gz
Size 12.4 MB
Tags Source
SHA-256 checksum
How to use checksums
d6b3f112f086589360c9d613c39fc540661c77e7192b37556aca91ec25b6e8c6
BLAKE2b-256 checksum
How to use checksums
f27d609328fa98c815f3f1f7481584fcd4bf7f717af3631789894d78ca9874b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 9, 2026.

Transparency log

Release files / meteoalarm-0.3.0-py3-none-any.whl

Download URL meteoalarm-0.3.0-py3-none-any.whl
Size 12.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8f02c764bb86cdd265e5ee92e0cc04be3ea7eeb621be83fbde6102cbd815f8c9
BLAKE2b-256 checksum
How to use checksums
e569267abfa8033212f7efa02fd0c3ea6f276fb9c3515ed66977cc0080eec4b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 9, 2026.

Transparency log

Security for meteoalarm 0.3.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 meteoalarm-0.3.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 Jun 9, 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.

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