Skip to content

Simple Weather

A beginner-friendly Python package for fetching weather data, designed for educational use.

Features

  • 🌀️ Easy access to weather data from wttr.in
  • πŸŒ™ Moon phase information
  • πŸ—ΊοΈ Location-based weather (cities, airports, coordinates)
  • 🌍 Multiple language support
  • πŸ“Š Multiple output formats: text, JSON (with Pydantic models), raw JSON (Python dictionaries), and PNG images
  • πŸš€ Built-in caching to be nice to the wttr.in service
  • πŸ›‘οΈ Beginner-friendly error handling (no exceptions)
  • πŸ“š Designed for teaching Python and API interactions

Installation

pip install fetch-my-weather

Quick Start

import fetch_my_weather

# Get weather for your current location (based on IP)
current_weather = fetch_my_weather.get_weather()
print(current_weather)

# Get weather for Berlin in metric units
berlin_weather = fetch_my_weather.get_weather(location="Berlin", units="m")
print(berlin_weather)

# Get moon phase for a specific date
moon = fetch_my_weather.get_weather(is_moon=True, moon_date="2025-07-04")
print(moon)

Contributors

This project is maintained by Michael Borck with contributions from various individuals. See the AUTHORS file for a complete list of contributors.

Acknowledgments

This package is a wrapper around the amazing wttr.in service created by Igor Chubin. Please be respectful of the wttr.in service by not making too many requests.