Fetching the weather

Introduction

What you will make

This resource teaches you how to access the Raspberry Pi Weather Station database using a RESTful API, how to use the haversine formula to calculate which weather station is closest to you, and how to fetch the latest weather data from that station.

What you will learn

By creating a script to fetch data from a weather database, you will learn:

  • How to access a RESTful API in Python
  • How to convert JSON data into dictionaries
  • How to pretty-print data
  • How to calculate distances between two points on the Earth’s surface

This resource covers elements from the following strands of the Raspberry Pi Digital Making Curriculum: