Python · Shipped
A Flask REST API serving historical temperature data by station, date, and year.
A Flask-based RESTful API that provides historical temperature data for various weather stations. The project allows users to query temperature data by station ID, specific dates, and yearly records.
git clone <repository-url>
cd weather-api
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On Unix or MacOS
source .venv/bin/activate
pip install flask pandas
weather-api/
├── main.py # Main application file
├── data_small/ # Directory containing weather station data
│ └── stations.txt # List of weather stations
│ └── TG_STAID*.txt # Temperature data files
├── templates/ # HTML templates
│ └── home.html # Homepage template
└── static/ # Static files (CSS, JS, etc.)
Homepage
/GETGet Temperature for Specific Station and Date
/api/v1/<station>/<date>GETGet All Data for a Station
/api/v1/<station>GETGet Yearly Data for a Station
/api/v1/yearly/<station>/<year>GEThttp://127.0.0.1:5000/api/v1/10/1988-10-25
http://127.0.0.1:5000/api/v1/10
http://127.0.0.1:5000/api/v1/yearly/10/1988
python main.py
http://127.0.0.1:5000The temperature data is stored in text files with the following format:
Feel free to submit issues and enhancement requests!