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¶
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)
Navigation¶
- Check out the User Guide for detailed usage instructions
- Explore the Mini-Projects for practical examples
- See the Teaching Guide for educational applications
- Review the Technical Documentation for implementation details
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.