# swiss-weather > Check weather conditions across Swiss regions and worldwide locations. Use when the user asks about weather forecasts, snow conditions, temperature comparisons, or weather-dependent activity planning. Supports dynamic location lookup for any place worldwide. - Author: nikhilpb - Repository: nikhilpb/skills - Version: 20260127021128 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/nikhilpb/skills - Web: https://mule.run/skillshub/@@nikhilpb/skills~swiss-weather:20260127021128 --- --- name: swiss-weather description: Check weather conditions across Swiss regions and worldwide locations. Use when the user asks about weather forecasts, snow conditions, temperature comparisons, or weather-dependent activity planning. Supports dynamic location lookup for any place worldwide. --- # Swiss Weather Get current weather conditions and forecasts for Swiss regions and worldwide locations to help plan outdoor activities. ## Quick Start The skill provides weather information via Open-Meteo. Use it to: - Compare weather across multiple locations - Get activity-specific forecasts (hiking, skiing, etc.) - Check snow conditions and elevation-based weather - Plan multi-day activities with extended forecasts - **Query any location worldwide** via dynamic geocoding **Quick Example - Find best hiking weather:** ```python import sys sys.path.append('swiss-weather/scripts') from fetch_weather import get_activity_forecast # Compare hiking conditions across multiple locations for location in ["Ticino", "Valais", "Grisons"]: forecast = get_activity_forecast(location, activity="hiking", days=3) if 'error' not in forecast: print(f"{location}: {forecast['suitability']} - {forecast['summary']}") ``` ## Usage Instructions ### 1. Basic Weather Lookup For a simple weather check in a specific location: ```python import sys sys.path.append('swiss-weather/scripts') from fetch_weather import get_current_weather weather = get_current_weather("Zurich") # Check for errors first if 'error' in weather: print(f"Error: {weather['error']}") else: # Available keys: temp, conditions, wind_speed, temp_high, temp_low, precipitation_today print(f"Temperature: {weather['temp']}°C") print(f"Conditions: {weather['conditions']}") print(f"Wind: {weather['wind_speed']} km/h") print(f"High/Low: {weather['temp_high']}/{weather['temp_low']}°C") ``` ### 2. Regional Comparison To compare weather across multiple locations (useful for deciding where to go): ```python from compare_regions import compare_weather # Use exact location names from the available locations list locations = ["Zurich", "Bern", "Ticino", "Valais"] comparison = compare_weather(locations) for location, data in comparison.items(): print(f"{location}: {data['temp']}°C, {data['conditions']}") ``` ### 3. Activity-Specific Forecasts Get weather forecasts tailored to specific activities: ```python from fetch_weather import get_activity_forecast # For hiking - use a valid location name from the Available Locations list forecast = get_activity_forecast("Grisons", activity="hiking", days=3) # Check for errors first if 'error' in forecast: print(f"Error: {forecast['error']}") else: print(f"Hiking conditions: {forecast['suitability']}") print(f"Outlook: {forecast['summary']}") # Show daily breakdown for day in forecast['daily_forecast']: print(f"{day['day_name']}: {day['suitability']} - {', '.join(day['reasons'])}") # For skiing forecast = get_activity_forecast("Valais", activity="skiing", days=3) if 'error' not in forecast: print(f"Overall suitability: {forecast['suitability']}") for day in forecast['daily_forecast']: print(f"{day['day_name']}: {day['suitability']}") ``` ### 4. Multi-Day Forecast For planning activities over several days: ```python from fetch_weather import get_extended_forecast forecast = get_extended_forecast("Interlaken", days=5) for day in forecast: print(f"{day['date']}: {day['temp_high']}/{day['temp_low']}°C - {day['conditions']}") ``` ### 5. Snow Conditions Get snow forecasts and avalanche bulletin links for mountain regions: ```python from fetch_weather import get_snow_conditions snow = get_snow_conditions("Zermatt") print(f"7-day snowfall forecast: {snow['snowfall_forecast_7day']}") print(f"Current temperature: {snow['current_temp']}°C") # Access detailed avalanche and snow depth data print(f"Avalanche bulletin: {snow['resources']['avalanche_bulletin']}") print(f"Snow stations: {snow['resources']['snow_stations']}") ``` ## Data Sources The skill fetches real-time weather data from: 1. **Open-Meteo Weather API** - Primary weather data provider (free, no API key required) - Current conditions and forecasts (up to 14 days) - Temperature, precipitation, wind speed - Snowfall forecasts - WMO weather codes for conditions - Documentation: https://open-meteo.com/ 2. **Open-Meteo Geocoding API** - Location name to coordinates conversion - Converts place names to latitude/longitude - Supports worldwide locations - Returns elevation, country, timezone - Results are cached locally (30-day TTL) - Documentation: https://open-meteo.com/en/docs/geocoding-api 3. **SLF (Snow and Avalanche Research)** - Reference links for detailed mountain data - Avalanche bulletins (linked, not fetched) - Snow depth measurements (linked, not fetched) - High-altitude conditions (linked, not fetched) - Users should check SLF directly for critical avalanche safety information ## Available Locations ### Dynamic Location Lookup The skill now supports **any location worldwide** via dynamic geocoding. Simply provide a place name and the system will automatically look up its coordinates. ```python # Query any location - not just predefined Swiss regions weather = get_current_weather("Paris") # Works! weather = get_current_weather("New York") # Works! weather = get_current_weather("Chamonix") # Works! weather = get_current_weather("Mürren") # Works! (small Swiss village) ``` **How it works:** 1. First checks the predefined Swiss regions (for rich metadata) 2. If not found, queries Open-Meteo Geocoding API 3. Swiss locations are prioritized when multiple matches exist 4. Results are cached locally to reduce API calls ### Predefined Swiss Locations These locations have additional metadata (canton, region, weather characteristics): **Cities & Towns:** - **Zurich** - Central Plateau, 408m elevation - **Bern** - Central Plateau, 542m elevation - **Geneva** - Lake Geneva region, 375m elevation - **Lausanne** - Lake Geneva region, 495m elevation - **Basel** - Northwestern Switzerland, 260m elevation - **Lucerne** - Central Switzerland, 435m elevation - **Interlaken** - Bernese Oberland, 567m elevation - **Lugano** - Ticino region, 273m elevation - **St. Gallen** - Eastern Switzerland, 670m elevation - **Appenzell** - Eastern Switzerland, 780m elevation - **Neuchatel** - Jura foothills, 430m elevation **Mountain Regions:** - **Ticino** - Southern Switzerland, 276m elevation (Mediterranean climate) - **Valais** - Alpine region, 1500m elevation (sunny, dry) - **Zermatt** - High Alps, 1620m elevation (year-round mountain weather) - **Grisons** - Eastern Alps, 1200m elevation (alpine continental) - **Jura** - Jura Mountains, 1000m elevation (cooler, more precipitation) **Note:** Location matching is case-insensitive and uses substring matching (e.g., "zurich" or "Zurich" both work). ## Weather Considerations for Activities When planning activities, consider: - **Hiking**: Temperature at elevation (drops ~0.6°C per 100m), precipitation, visibility - **Stroller-friendly walks**: Avoid areas with recent rain (muddy trails), check wind - **Mountain activities**: Afternoon thunderstorms common in summer, check avalanche bulletins in winter - **Lake activities**: Morning calmest for water sports, afternoon winds on larger lakes ## Scripts Reference - `fetch_weather.py` - Main weather functions: - `get_current_weather(location)` - Current conditions - `get_extended_forecast(location, days)` - Multi-day forecast - `get_activity_forecast(location, activity, days)` - Activity-specific forecasts - `get_snow_conditions(location)` - Snowfall forecasts and SLF links - `geocode.py` - Location lookup functions: - `geocode(location, country_code=None)` - Convert place name to coordinates - `geocode_swiss(location)` - Geocode with Swiss priority - `clear_cache()` - Clear the geocoding cache - `get_cache_stats()` - View cache statistics - `compare_regions.py` - Compare weather across multiple locations - `data/swiss_regions.json` - Regional data with coordinates and characteristics - `data/geocode_cache.json` - Cached geocoding results (auto-generated) ## Common Issues & Troubleshooting ### Location Not Found Error If you get an error like `Location 'XYZ' not found`, ensure you're using one of the exact location names from the "Available Locations" section above. Common mistakes: - ❌ "Bernese Oberland" → ✅ "Interlaken" (the main town in Bernese Oberland) - ❌ "Central Switzerland" → ✅ "Lucerne" (the main city in Central Switzerland) - ❌ "Zurich Region" → ✅ "Zurich" ### Checking for Errors Always check if an error occurred before accessing weather data: ```python weather = get_current_weather("SomeLocation") if 'error' in weather: print(f"Error: {weather['error']}") return # Now safe to access weather data ``` ### Key Names Reference - ✅ Use `weather['temp']` (not `weather['temperature']`) - ✅ Use `weather['wind_speed']` (not `weather['wind']`) - ✅ Use `weather['conditions']` for weather description ## Tips - Weather can vary dramatically by elevation - always check conditions at your target altitude - Ticino often has better weather when the north is cloudy (Föhn effect) - Afternoon thunderstorms are common in mountains during summer - For critical safety decisions (avalanche risk, severe weather warnings), always consult official sources: - MeteoSwiss: https://www.meteoswiss.admin.ch/ - SLF Avalanche Bulletin: https://www.slf.ch/en/avalanche-bulletin-and-snow-situation.html - For families with small children, check not just temperature but wind chill and sun exposure - Open-Meteo provides reliable forecasts but is not an official meteorological service